]>
Commit | Line | Data |
---|---|---|
5855228a DM |
1 | nfs: return inode i_bytes update to generic code in case of inactive quota |
2 | ||
3 | From: Stanislav Kinsbursky <skinsbursky@parallels.com> | |
4 | ||
5 | This hack is ugly. All the quota should be redesigned and partially rewritten. | |
6 | ||
7 | https://bugzilla.openvz.org/show_bug.cgi?id=2738 | |
8 | ||
9 | Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> | |
10 | --- | |
11 | fs/nfs/inode.c | 15 +++++++++++++++ | |
12 | 1 files changed, 15 insertions(+), 0 deletions(-) | |
13 | ||
14 | diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c | |
15 | index c0278ba..13cb69e 100644 | |
16 | --- a/fs/nfs/inode.c | |
17 | +++ b/fs/nfs/inode.c | |
18 | @@ -39,6 +39,7 @@ | |
19 | #include <linux/slab.h> | |
20 | #include <linux/compat.h> | |
21 | #include <linux/freezer.h> | |
22 | +#include <linux/quotaops.h> | |
23 | ||
24 | #include <asm/system.h> | |
25 | #include <asm/uaccess.h> | |
26 | @@ -1397,6 +1398,20 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |
27 | } else if (server->caps & NFS_CAP_NLINK) | |
28 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR | |
29 | | NFS_INO_REVAL_FORCED); | |
30 | + /* | |
31 | + * Incredibly ugly. Must be threw away with proper NFS quota | |
32 | + * reimplemetation. | |
33 | + */ | |
34 | + if (!sb_any_quota_active(inode->i_sb)) { | |
35 | + if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { | |
36 | + /* | |
37 | + * report the blocks in 512byte units | |
38 | + */ | |
39 | + inode->i_blocks = nfs_calc_block_size(inode, fattr->du.nfs3.used); | |
40 | + } | |
41 | + if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) | |
42 | + inode->i_blocks = fattr->du.nfs2.blocks; | |
43 | + } | |
44 | ||
45 | /* Update attrtimeo value if we're out of the unstable period */ | |
46 | if (invalid & NFS_INO_INVALID_ATTR) { |