diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/delegation.c | 4 | ||||
-rw-r--r-- | fs/nfs/file.c | 3 | ||||
-rw-r--r-- | fs/nfs/inode.c | 9 | ||||
-rw-r--r-- | fs/nfs/read.c | 5 |
4 files changed, 10 insertions, 11 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index d7f7eb669d03..4a36839f0bbd 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -85,6 +85,10 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct | |||
85 | struct nfs_delegation *delegation; | 85 | struct nfs_delegation *delegation; |
86 | int status = 0; | 86 | int status = 0; |
87 | 87 | ||
88 | /* Ensure we first revalidate the attributes and page cache! */ | ||
89 | if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR))) | ||
90 | __nfs_revalidate_inode(NFS_SERVER(inode), inode); | ||
91 | |||
88 | delegation = nfs_alloc_delegation(); | 92 | delegation = nfs_alloc_delegation(); |
89 | if (delegation == NULL) | 93 | if (delegation == NULL) |
90 | return -ENOMEM; | 94 | return -ENOMEM; |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index f6b9eda925c5..6bdcfa95de94 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -137,7 +137,8 @@ static int nfs_revalidate_file(struct inode *inode, struct file *filp) | |||
137 | struct nfs_inode *nfsi = NFS_I(inode); | 137 | struct nfs_inode *nfsi = NFS_I(inode); |
138 | int retval = 0; | 138 | int retval = 0; |
139 | 139 | ||
140 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode)) | 140 | if ((nfsi->cache_validity & (NFS_INO_REVAL_PAGECACHE|NFS_INO_INVALID_ATTR)) |
141 | || nfs_attribute_timeout(inode)) | ||
141 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 142 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
142 | nfs_revalidate_mapping(inode, filp->f_mapping); | 143 | nfs_revalidate_mapping(inode, filp->f_mapping); |
143 | return 0; | 144 | return 0; |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 6922469d6fc5..d4eadeea128e 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -877,12 +877,10 @@ static int nfs_wait_on_inode(struct inode *inode) | |||
877 | sigset_t oldmask; | 877 | sigset_t oldmask; |
878 | int error; | 878 | int error; |
879 | 879 | ||
880 | atomic_inc(&inode->i_count); | ||
881 | rpc_clnt_sigmask(clnt, &oldmask); | 880 | rpc_clnt_sigmask(clnt, &oldmask); |
882 | error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, | 881 | error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, |
883 | nfs_wait_schedule, TASK_INTERRUPTIBLE); | 882 | nfs_wait_schedule, TASK_INTERRUPTIBLE); |
884 | rpc_clnt_sigunmask(clnt, &oldmask); | 883 | rpc_clnt_sigunmask(clnt, &oldmask); |
885 | iput(inode); | ||
886 | 884 | ||
887 | return error; | 885 | return error; |
888 | } | 886 | } |
@@ -1226,10 +1224,6 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1226 | loff_t cur_size, new_isize; | 1224 | loff_t cur_size, new_isize; |
1227 | int data_unstable; | 1225 | int data_unstable; |
1228 | 1226 | ||
1229 | /* Do we hold a delegation? */ | ||
1230 | if (nfs_have_delegation(inode, FMODE_READ)) | ||
1231 | return 0; | ||
1232 | |||
1233 | spin_lock(&inode->i_lock); | 1227 | spin_lock(&inode->i_lock); |
1234 | 1228 | ||
1235 | /* Are we in the process of updating data on the server? */ | 1229 | /* Are we in the process of updating data on the server? */ |
@@ -1350,7 +1344,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1350 | nfsi->read_cache_jiffies = fattr->timestamp; | 1344 | nfsi->read_cache_jiffies = fattr->timestamp; |
1351 | 1345 | ||
1352 | /* Are we racing with known updates of the metadata on the server? */ | 1346 | /* Are we racing with known updates of the metadata on the server? */ |
1353 | data_unstable = ! nfs_verify_change_attribute(inode, verifier); | 1347 | data_unstable = ! (nfs_verify_change_attribute(inode, verifier) || |
1348 | (nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)); | ||
1354 | 1349 | ||
1355 | /* Check if our cached file size is stale */ | 1350 | /* Check if our cached file size is stale */ |
1356 | new_isize = nfs_size_to_loff_t(fattr->size); | 1351 | new_isize = nfs_size_to_loff_t(fattr->size); |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 6ceb1d471f20..9758ebd49905 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -184,14 +184,13 @@ static void nfs_readpage_release(struct nfs_page *req) | |||
184 | { | 184 | { |
185 | unlock_page(req->wb_page); | 185 | unlock_page(req->wb_page); |
186 | 186 | ||
187 | nfs_clear_request(req); | ||
188 | nfs_release_request(req); | ||
189 | |||
190 | dprintk("NFS: read done (%s/%Ld %d@%Ld)\n", | 187 | dprintk("NFS: read done (%s/%Ld %d@%Ld)\n", |
191 | req->wb_context->dentry->d_inode->i_sb->s_id, | 188 | req->wb_context->dentry->d_inode->i_sb->s_id, |
192 | (long long)NFS_FILEID(req->wb_context->dentry->d_inode), | 189 | (long long)NFS_FILEID(req->wb_context->dentry->d_inode), |
193 | req->wb_bytes, | 190 | req->wb_bytes, |
194 | (long long)req_offset(req)); | 191 | (long long)req_offset(req)); |
192 | nfs_clear_request(req); | ||
193 | nfs_release_request(req); | ||
195 | } | 194 | } |
196 | 195 | ||
197 | /* | 196 | /* |