aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback_proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-03 03:55:37 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-06 14:58:51 -0500
commitbeb2a5ec386e5ce6891ebd1c06b913da04354b40 (patch)
tree370e0065936e5739de638389af6c85ee960a6b28 /fs/nfs/callback_proc.c
parent969b7f2522c90dfed5d0d2553a91522bda2c3bf3 (diff)
NFSv4: Ensure change attribute returned by GETATTR callback conforms to spec
According to RFC3530 we're supposed to cache the change attribute at the time the client receives a write delegation. If the inode is clean, a CB_GETATTR callback by the server to the client is supposed to return the cached change attribute. If, OTOH, the inode is dirty, the client should bump the cached change attribute by 1. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/callback_proc.c')
-rw-r--r--fs/nfs/callback_proc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 65f1e19e4d19..462cfceb50c5 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -35,7 +35,9 @@ unsigned nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres
35 if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0) 35 if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
36 goto out_iput; 36 goto out_iput;
37 res->size = i_size_read(inode); 37 res->size = i_size_read(inode);
38 res->change_attr = NFS_CHANGE_ATTR(inode); 38 res->change_attr = delegation->change_attr;
39 if (nfsi->npages != 0)
40 res->change_attr++;
39 res->ctime = inode->i_ctime; 41 res->ctime = inode->i_ctime;
40 res->mtime = inode->i_mtime; 42 res->mtime = inode->i_mtime;
41 res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & 43 res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) &