]> git.proxmox.com Git - pve-kernel-2.6.32.git/blame - fix-nfs-block-count.patch
update to vzkernel-2.6.32-042stab113.12.src.rpm
[pve-kernel-2.6.32.git] / fix-nfs-block-count.patch
CommitLineData
5855228a
DM
1nfs: return inode i_bytes update to generic code in case of inactive quota
2
3From: Stanislav Kinsbursky <skinsbursky@parallels.com>
4
5This hack is ugly. All the quota should be redesigned and partially rewritten.
6
7https://bugzilla.openvz.org/show_bug.cgi?id=2738
8
9Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
10---
11 fs/nfs/inode.c | 15 +++++++++++++++
12 1 files changed, 15 insertions(+), 0 deletions(-)
13
14diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
15index 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) {