diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 13:43:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 13:43:51 -0400 |
commit | 53f2c4a8fd882009a2a75c5b72d6898c0808616e (patch) | |
tree | 922293a1056c0c2358203cdab832f0e0891e628a /fs/nfs/inode.c | |
parent | 8f6576ad476b2a22d05ddafd2ddaee102577a4ed (diff) | |
parent | cc0a98436820b161b595b8cc1d2329bcf7328107 (diff) |
Merge tag 'nfs-for-3.5-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"New features include:
- Rewrite the O_DIRECT code so that it can share the same coalescing
and pNFS functionality as the page cache code.
- Allow the server to provide hints as to when we should use pNFS,
and when it is more efficient to read and write through the
metadata server.
- NFS cache consistency updates:
* Use the ctime to emulate a change attribute for NFSv2/v3 so that
all NFS versions can share the same cache management code.
* New cache management code will only look at the change attribute
and size attribute when deciding whether or not our cached data
is still valid or not.
* Don't request NFSv4 post-op attributes on writes in cases such as
O_DIRECT, where we don't care about data cache consistency, or
when we have a write delegation, and know that our cache is still
consistent.
* Don't request NFSv4 post-op attributes on operations such as
COMMIT, where there are no expected metadata updates.
* Don't request NFSv4 directory post-op attributes in cases where
the operations themselves already return change attribute
updates: i.e. operations such as OPEN, CREATE, REMOVE, LINK and
RENAME.
- Speed up 'ls' and friends by using READDIR rather than READDIRPLUS
if we detect no attempts to lookup filenames.
- Improve the code sharing between NFSv2/v3 and v4 mounts
- NFSv4.1 state management efficiency improvements
- More patches in preparation for NFSv4/v4.1 migration functionality."
Fix trivial conflict in fs/nfs/nfs4proc.c that was due to the dcache
qstr name initialization changes (that made the length/hash a 64-bit
union)
* tag 'nfs-for-3.5-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (146 commits)
NFSv4: Add debugging printks to state manager
NFSv4: Map NFS4ERR_SHARE_DENIED into an EACCES error instead of EIO
NFSv4: update_changeattr does not need to set NFS_INO_REVAL_PAGECACHE
NFSv4.1: nfs4_reset_session should use nfs4_handle_reclaim_lease_error
NFSv4.1: Handle other occurrences of NFS4ERR_CONN_NOT_BOUND_TO_SESSION
NFSv4.1: Handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION in the state manager
NFSv4.1: Handle errors in nfs4_bind_conn_to_session
NFSv4.1: nfs4_bind_conn_to_session should drain the session
NFSv4.1: Don't clobber the seqid if exchange_id returns a confirmed clientid
NFSv4.1: Add DESTROY_CLIENTID
NFSv4.1: Ensure we use the correct credentials for bind_conn_to_session
NFSv4.1: Ensure we use the correct credentials for session create/destroy
NFSv4.1: Move NFSPROC4_CLNT_BIND_CONN_TO_SESSION to the end of the operations
NFSv4.1: Handle NFS4ERR_SEQ_MISORDERED when confirming the lease
NFSv4: When purging the lease, we must clear NFS4CLNT_LEASE_CONFIRM
NFSv4: Clean up the error handling for nfs4_reclaim_lease
NFSv4.1: Exchange ID must use GFP_NOFS allocation mode
nfs41: Use BIND_CONN_TO_SESSION for CB_PATH_DOWN*
nfs4.1: add BIND_CONN_TO_SESSION operation
NFSv4.1 test the mdsthreshold hint parameters
...
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 118 |
1 files changed, 49 insertions, 69 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index c6073139b402..2f6f78c4b42d 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -285,9 +285,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
285 | inode->i_mode = fattr->mode; | 285 | inode->i_mode = fattr->mode; |
286 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 | 286 | if ((fattr->valid & NFS_ATTR_FATTR_MODE) == 0 |
287 | && nfs_server_capable(inode, NFS_CAP_MODE)) | 287 | && nfs_server_capable(inode, NFS_CAP_MODE)) |
288 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 288 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
289 | | NFS_INO_INVALID_ACCESS | ||
290 | | NFS_INO_INVALID_ACL; | ||
291 | /* Why so? Because we want revalidate for devices/FIFOs, and | 289 | /* Why so? Because we want revalidate for devices/FIFOs, and |
292 | * that's precisely what we have in nfs_file_inode_operations. | 290 | * that's precisely what we have in nfs_file_inode_operations. |
293 | */ | 291 | */ |
@@ -300,8 +298,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
300 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; | 298 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; |
301 | inode->i_fop = &nfs_dir_operations; | 299 | inode->i_fop = &nfs_dir_operations; |
302 | inode->i_data.a_ops = &nfs_dir_aops; | 300 | inode->i_data.a_ops = &nfs_dir_aops; |
303 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS)) | ||
304 | set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags); | ||
305 | /* Deal with crossing mountpoints */ | 301 | /* Deal with crossing mountpoints */ |
306 | if (fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT || | 302 | if (fattr->valid & NFS_ATTR_FATTR_MOUNTPOINT || |
307 | fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) { | 303 | fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) { |
@@ -327,6 +323,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
327 | inode->i_gid = -2; | 323 | inode->i_gid = -2; |
328 | inode->i_blocks = 0; | 324 | inode->i_blocks = 0; |
329 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); | 325 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); |
326 | nfsi->write_io = 0; | ||
327 | nfsi->read_io = 0; | ||
330 | 328 | ||
331 | nfsi->read_cache_jiffies = fattr->time_start; | 329 | nfsi->read_cache_jiffies = fattr->time_start; |
332 | nfsi->attr_gencount = fattr->gencount; | 330 | nfsi->attr_gencount = fattr->gencount; |
@@ -337,24 +335,19 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
337 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) | 335 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) |
338 | inode->i_mtime = fattr->mtime; | 336 | inode->i_mtime = fattr->mtime; |
339 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) | 337 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) |
340 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 338 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
341 | | NFS_INO_INVALID_DATA; | ||
342 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 339 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
343 | inode->i_ctime = fattr->ctime; | 340 | inode->i_ctime = fattr->ctime; |
344 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) | 341 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) |
345 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 342 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
346 | | NFS_INO_INVALID_ACCESS | ||
347 | | NFS_INO_INVALID_ACL; | ||
348 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 343 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
349 | inode->i_version = fattr->change_attr; | 344 | inode->i_version = fattr->change_attr; |
350 | else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR)) | 345 | else if (nfs_server_capable(inode, NFS_CAP_CHANGE_ATTR)) |
351 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 346 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
352 | | NFS_INO_INVALID_DATA; | ||
353 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) | 347 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) |
354 | inode->i_size = nfs_size_to_loff_t(fattr->size); | 348 | inode->i_size = nfs_size_to_loff_t(fattr->size); |
355 | else | 349 | else |
356 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 350 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR |
357 | | NFS_INO_INVALID_DATA | ||
358 | | NFS_INO_REVAL_PAGECACHE; | 351 | | NFS_INO_REVAL_PAGECACHE; |
359 | if (fattr->valid & NFS_ATTR_FATTR_NLINK) | 352 | if (fattr->valid & NFS_ATTR_FATTR_NLINK) |
360 | set_nlink(inode, fattr->nlink); | 353 | set_nlink(inode, fattr->nlink); |
@@ -363,15 +356,11 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
363 | if (fattr->valid & NFS_ATTR_FATTR_OWNER) | 356 | if (fattr->valid & NFS_ATTR_FATTR_OWNER) |
364 | inode->i_uid = fattr->uid; | 357 | inode->i_uid = fattr->uid; |
365 | else if (nfs_server_capable(inode, NFS_CAP_OWNER)) | 358 | else if (nfs_server_capable(inode, NFS_CAP_OWNER)) |
366 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 359 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
367 | | NFS_INO_INVALID_ACCESS | ||
368 | | NFS_INO_INVALID_ACL; | ||
369 | if (fattr->valid & NFS_ATTR_FATTR_GROUP) | 360 | if (fattr->valid & NFS_ATTR_FATTR_GROUP) |
370 | inode->i_gid = fattr->gid; | 361 | inode->i_gid = fattr->gid; |
371 | else if (nfs_server_capable(inode, NFS_CAP_OWNER_GROUP)) | 362 | else if (nfs_server_capable(inode, NFS_CAP_OWNER_GROUP)) |
372 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | 363 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
373 | | NFS_INO_INVALID_ACCESS | ||
374 | | NFS_INO_INVALID_ACL; | ||
375 | if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) | 364 | if (fattr->valid & NFS_ATTR_FATTR_BLOCKS_USED) |
376 | inode->i_blocks = fattr->du.nfs2.blocks; | 365 | inode->i_blocks = fattr->du.nfs2.blocks; |
377 | if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { | 366 | if (fattr->valid & NFS_ATTR_FATTR_SPACE_USED) { |
@@ -654,6 +643,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f | |||
654 | nfs_init_lock_context(&ctx->lock_context); | 643 | nfs_init_lock_context(&ctx->lock_context); |
655 | ctx->lock_context.open_context = ctx; | 644 | ctx->lock_context.open_context = ctx; |
656 | INIT_LIST_HEAD(&ctx->list); | 645 | INIT_LIST_HEAD(&ctx->list); |
646 | ctx->mdsthreshold = NULL; | ||
657 | return ctx; | 647 | return ctx; |
658 | } | 648 | } |
659 | 649 | ||
@@ -682,6 +672,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) | |||
682 | put_rpccred(ctx->cred); | 672 | put_rpccred(ctx->cred); |
683 | dput(ctx->dentry); | 673 | dput(ctx->dentry); |
684 | nfs_sb_deactive(sb); | 674 | nfs_sb_deactive(sb); |
675 | kfree(ctx->mdsthreshold); | ||
685 | kfree(ctx); | 676 | kfree(ctx); |
686 | } | 677 | } |
687 | 678 | ||
@@ -870,6 +861,15 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *map | |||
870 | return 0; | 861 | return 0; |
871 | } | 862 | } |
872 | 863 | ||
864 | static bool nfs_mapping_need_revalidate_inode(struct inode *inode) | ||
865 | { | ||
866 | if (nfs_have_delegated_attributes(inode)) | ||
867 | return false; | ||
868 | return (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE) | ||
869 | || nfs_attribute_timeout(inode) | ||
870 | || NFS_STALE(inode); | ||
871 | } | ||
872 | |||
873 | /** | 873 | /** |
874 | * nfs_revalidate_mapping - Revalidate the pagecache | 874 | * nfs_revalidate_mapping - Revalidate the pagecache |
875 | * @inode - pointer to host inode | 875 | * @inode - pointer to host inode |
@@ -880,9 +880,7 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
880 | struct nfs_inode *nfsi = NFS_I(inode); | 880 | struct nfs_inode *nfsi = NFS_I(inode); |
881 | int ret = 0; | 881 | int ret = 0; |
882 | 882 | ||
883 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) | 883 | if (nfs_mapping_need_revalidate_inode(inode)) { |
884 | || nfs_attribute_cache_expired(inode) | ||
885 | || NFS_STALE(inode)) { | ||
886 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 884 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
887 | if (ret < 0) | 885 | if (ret < 0) |
888 | goto out; | 886 | goto out; |
@@ -948,6 +946,8 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
948 | unsigned long invalid = 0; | 946 | unsigned long invalid = 0; |
949 | 947 | ||
950 | 948 | ||
949 | if (nfs_have_delegated_attributes(inode)) | ||
950 | return 0; | ||
951 | /* Has the inode gone and changed behind our back? */ | 951 | /* Has the inode gone and changed behind our back? */ |
952 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) | 952 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) |
953 | return -EIO; | 953 | return -EIO; |
@@ -960,7 +960,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
960 | 960 | ||
961 | /* Verify a few of the more important attributes */ | 961 | /* Verify a few of the more important attributes */ |
962 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&inode->i_mtime, &fattr->mtime)) | 962 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&inode->i_mtime, &fattr->mtime)) |
963 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE; | 963 | invalid |= NFS_INO_INVALID_ATTR; |
964 | 964 | ||
965 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { | 965 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { |
966 | cur_size = i_size_read(inode); | 966 | cur_size = i_size_read(inode); |
@@ -1279,14 +1279,26 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1279 | nfs_display_fhandle_hash(NFS_FH(inode)), | 1279 | nfs_display_fhandle_hash(NFS_FH(inode)), |
1280 | atomic_read(&inode->i_count), fattr->valid); | 1280 | atomic_read(&inode->i_count), fattr->valid); |
1281 | 1281 | ||
1282 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) | 1282 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) { |
1283 | goto out_fileid; | 1283 | printk(KERN_ERR "NFS: server %s error: fileid changed\n" |
1284 | "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n", | ||
1285 | NFS_SERVER(inode)->nfs_client->cl_hostname, | ||
1286 | inode->i_sb->s_id, (long long)nfsi->fileid, | ||
1287 | (long long)fattr->fileid); | ||
1288 | goto out_err; | ||
1289 | } | ||
1284 | 1290 | ||
1285 | /* | 1291 | /* |
1286 | * Make sure the inode's type hasn't changed. | 1292 | * Make sure the inode's type hasn't changed. |
1287 | */ | 1293 | */ |
1288 | if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1294 | if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1289 | goto out_changed; | 1295 | /* |
1296 | * Big trouble! The inode has become a different object. | ||
1297 | */ | ||
1298 | printk(KERN_DEBUG "NFS: %s: inode %ld mode changed, %07o to %07o\n", | ||
1299 | __func__, inode->i_ino, inode->i_mode, fattr->mode); | ||
1300 | goto out_err; | ||
1301 | } | ||
1290 | 1302 | ||
1291 | server = NFS_SERVER(inode); | 1303 | server = NFS_SERVER(inode); |
1292 | /* Update the fsid? */ | 1304 | /* Update the fsid? */ |
@@ -1314,7 +1326,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1314 | if (inode->i_version != fattr->change_attr) { | 1326 | if (inode->i_version != fattr->change_attr) { |
1315 | dprintk("NFS: change_attr change on server for file %s/%ld\n", | 1327 | dprintk("NFS: change_attr change on server for file %s/%ld\n", |
1316 | inode->i_sb->s_id, inode->i_ino); | 1328 | inode->i_sb->s_id, inode->i_ino); |
1317 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | 1329 | invalid |= NFS_INO_INVALID_ATTR |
1330 | | NFS_INO_INVALID_DATA | ||
1331 | | NFS_INO_INVALID_ACCESS | ||
1332 | | NFS_INO_INVALID_ACL | ||
1333 | | NFS_INO_REVAL_PAGECACHE; | ||
1318 | if (S_ISDIR(inode->i_mode)) | 1334 | if (S_ISDIR(inode->i_mode)) |
1319 | nfs_force_lookup_revalidate(inode); | 1335 | nfs_force_lookup_revalidate(inode); |
1320 | inode->i_version = fattr->change_attr; | 1336 | inode->i_version = fattr->change_attr; |
@@ -1323,38 +1339,15 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1323 | invalid |= save_cache_validity; | 1339 | invalid |= save_cache_validity; |
1324 | 1340 | ||
1325 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { | 1341 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { |
1326 | /* NFSv2/v3: Check if the mtime agrees */ | 1342 | memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); |
1327 | if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) { | ||
1328 | dprintk("NFS: mtime change on server for file %s/%ld\n", | ||
1329 | inode->i_sb->s_id, inode->i_ino); | ||
1330 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; | ||
1331 | if (S_ISDIR(inode->i_mode)) | ||
1332 | nfs_force_lookup_revalidate(inode); | ||
1333 | memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); | ||
1334 | } | ||
1335 | } else if (server->caps & NFS_CAP_MTIME) | 1343 | } else if (server->caps & NFS_CAP_MTIME) |
1336 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR | 1344 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR |
1337 | | NFS_INO_INVALID_DATA | ||
1338 | | NFS_INO_REVAL_PAGECACHE | ||
1339 | | NFS_INO_REVAL_FORCED); | 1345 | | NFS_INO_REVAL_FORCED); |
1340 | 1346 | ||
1341 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { | 1347 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { |
1342 | /* If ctime has changed we should definitely clear access+acl caches */ | 1348 | memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); |
1343 | if (!timespec_equal(&inode->i_ctime, &fattr->ctime)) { | ||
1344 | invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | ||
1345 | /* and probably clear data for a directory too as utimes can cause | ||
1346 | * havoc with our cache. | ||
1347 | */ | ||
1348 | if (S_ISDIR(inode->i_mode)) { | ||
1349 | invalid |= NFS_INO_INVALID_DATA; | ||
1350 | nfs_force_lookup_revalidate(inode); | ||
1351 | } | ||
1352 | memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); | ||
1353 | } | ||
1354 | } else if (server->caps & NFS_CAP_CTIME) | 1349 | } else if (server->caps & NFS_CAP_CTIME) |
1355 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR | 1350 | invalid |= save_cache_validity & (NFS_INO_INVALID_ATTR |
1356 | | NFS_INO_INVALID_ACCESS | ||
1357 | | NFS_INO_INVALID_ACL | ||
1358 | | NFS_INO_REVAL_FORCED); | 1351 | | NFS_INO_REVAL_FORCED); |
1359 | 1352 | ||
1360 | /* Check if our cached file size is stale */ | 1353 | /* Check if our cached file size is stale */ |
@@ -1466,12 +1459,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1466 | nfsi->cache_validity |= invalid; | 1459 | nfsi->cache_validity |= invalid; |
1467 | 1460 | ||
1468 | return 0; | 1461 | return 0; |
1469 | out_changed: | ||
1470 | /* | ||
1471 | * Big trouble! The inode has become a different object. | ||
1472 | */ | ||
1473 | printk(KERN_DEBUG "NFS: %s: inode %ld mode changed, %07o to %07o\n", | ||
1474 | __func__, inode->i_ino, inode->i_mode, fattr->mode); | ||
1475 | out_err: | 1462 | out_err: |
1476 | /* | 1463 | /* |
1477 | * No need to worry about unhashing the dentry, as the | 1464 | * No need to worry about unhashing the dentry, as the |
@@ -1480,13 +1467,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1480 | */ | 1467 | */ |
1481 | nfs_invalidate_inode(inode); | 1468 | nfs_invalidate_inode(inode); |
1482 | return -ESTALE; | 1469 | return -ESTALE; |
1483 | |||
1484 | out_fileid: | ||
1485 | printk(KERN_ERR "NFS: server %s error: fileid changed\n" | ||
1486 | "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n", | ||
1487 | NFS_SERVER(inode)->nfs_client->cl_hostname, inode->i_sb->s_id, | ||
1488 | (long long)nfsi->fileid, (long long)fattr->fileid); | ||
1489 | goto out_err; | ||
1490 | } | 1470 | } |
1491 | 1471 | ||
1492 | 1472 | ||
@@ -1547,7 +1527,7 @@ static inline void nfs4_init_once(struct nfs_inode *nfsi) | |||
1547 | nfsi->delegation_state = 0; | 1527 | nfsi->delegation_state = 0; |
1548 | init_rwsem(&nfsi->rwsem); | 1528 | init_rwsem(&nfsi->rwsem); |
1549 | nfsi->layout = NULL; | 1529 | nfsi->layout = NULL; |
1550 | atomic_set(&nfsi->commits_outstanding, 0); | 1530 | atomic_set(&nfsi->commit_info.rpcs_out, 0); |
1551 | #endif | 1531 | #endif |
1552 | } | 1532 | } |
1553 | 1533 | ||
@@ -1559,9 +1539,9 @@ static void init_once(void *foo) | |||
1559 | INIT_LIST_HEAD(&nfsi->open_files); | 1539 | INIT_LIST_HEAD(&nfsi->open_files); |
1560 | INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); | 1540 | INIT_LIST_HEAD(&nfsi->access_cache_entry_lru); |
1561 | INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); | 1541 | INIT_LIST_HEAD(&nfsi->access_cache_inode_lru); |
1562 | INIT_LIST_HEAD(&nfsi->commit_list); | 1542 | INIT_LIST_HEAD(&nfsi->commit_info.list); |
1563 | nfsi->npages = 0; | 1543 | nfsi->npages = 0; |
1564 | nfsi->ncommit = 0; | 1544 | nfsi->commit_info.ncommit = 0; |
1565 | atomic_set(&nfsi->silly_count, 1); | 1545 | atomic_set(&nfsi->silly_count, 1); |
1566 | INIT_HLIST_HEAD(&nfsi->silly_list); | 1546 | INIT_HLIST_HEAD(&nfsi->silly_list); |
1567 | init_waitqueue_head(&nfsi->waitqueue); | 1547 | init_waitqueue_head(&nfsi->waitqueue); |