diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/dir.c | 37 | ||||
-rw-r--r-- | fs/nfs/getroot.c | 1 | ||||
-rw-r--r-- | fs/nfs/idmap.c | 4 | ||||
-rw-r--r-- | fs/nfs/inode.c | 3 | ||||
-rw-r--r-- | fs/nfs/nfs2xdr.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 11 | ||||
-rw-r--r-- | fs/nfs/pagelist.c | 7 |
7 files changed, 22 insertions, 42 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 625d8e5fb39d..3df428816559 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include "delegation.h" | 38 | #include "delegation.h" |
39 | #include "iostat.h" | 39 | #include "iostat.h" |
40 | 40 | ||
41 | #define NFS_PARANOIA 1 | ||
42 | /* #define NFS_DEBUG_VERBOSE 1 */ | 41 | /* #define NFS_DEBUG_VERBOSE 1 */ |
43 | 42 | ||
44 | static int nfs_opendir(struct inode *, struct file *); | 43 | static int nfs_opendir(struct inode *, struct file *); |
@@ -650,12 +649,15 @@ int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) | |||
650 | */ | 649 | */ |
651 | static int nfs_check_verifier(struct inode *dir, struct dentry *dentry) | 650 | static int nfs_check_verifier(struct inode *dir, struct dentry *dentry) |
652 | { | 651 | { |
652 | unsigned long verf; | ||
653 | |||
653 | if (IS_ROOT(dentry)) | 654 | if (IS_ROOT(dentry)) |
654 | return 1; | 655 | return 1; |
655 | if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0 | 656 | verf = (unsigned long)dentry->d_fsdata; |
656 | || nfs_attribute_timeout(dir)) | 657 | if (nfs_caches_unstable(dir) |
658 | || verf != NFS_I(dir)->cache_change_attribute) | ||
657 | return 0; | 659 | return 0; |
658 | return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); | 660 | return 1; |
659 | } | 661 | } |
660 | 662 | ||
661 | static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) | 663 | static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) |
@@ -665,8 +667,7 @@ static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) | |||
665 | 667 | ||
666 | static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf) | 668 | static void nfs_refresh_verifier(struct dentry * dentry, unsigned long verf) |
667 | { | 669 | { |
668 | if (time_after(verf, (unsigned long)dentry->d_fsdata)) | 670 | nfs_set_verifier(dentry, verf); |
669 | nfs_set_verifier(dentry, verf); | ||
670 | } | 671 | } |
671 | 672 | ||
672 | /* | 673 | /* |
@@ -765,6 +766,10 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) | |||
765 | nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); | 766 | nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); |
766 | inode = dentry->d_inode; | 767 | inode = dentry->d_inode; |
767 | 768 | ||
769 | /* Revalidate parent directory attribute cache */ | ||
770 | if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0) | ||
771 | goto out_zap_parent; | ||
772 | |||
768 | if (!inode) { | 773 | if (!inode) { |
769 | if (nfs_neg_need_reval(dir, dentry, nd)) | 774 | if (nfs_neg_need_reval(dir, dentry, nd)) |
770 | goto out_bad; | 775 | goto out_bad; |
@@ -778,10 +783,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) | |||
778 | goto out_bad; | 783 | goto out_bad; |
779 | } | 784 | } |
780 | 785 | ||
781 | /* Revalidate parent directory attribute cache */ | ||
782 | if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0) | ||
783 | goto out_zap_parent; | ||
784 | |||
785 | /* Force a full look up iff the parent directory has changed */ | 786 | /* Force a full look up iff the parent directory has changed */ |
786 | if (nfs_check_verifier(dir, dentry)) { | 787 | if (nfs_check_verifier(dir, dentry)) { |
787 | if (nfs_lookup_verify_inode(inode, nd)) | 788 | if (nfs_lookup_verify_inode(inode, nd)) |
@@ -1360,11 +1361,6 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry) | |||
1360 | atomic_read(&dentry->d_count)); | 1361 | atomic_read(&dentry->d_count)); |
1361 | nfs_inc_stats(dir, NFSIOS_SILLYRENAME); | 1362 | nfs_inc_stats(dir, NFSIOS_SILLYRENAME); |
1362 | 1363 | ||
1363 | #ifdef NFS_PARANOIA | ||
1364 | if (!dentry->d_inode) | ||
1365 | printk("NFS: silly-renaming %s/%s, negative dentry??\n", | ||
1366 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
1367 | #endif | ||
1368 | /* | 1364 | /* |
1369 | * We don't allow a dentry to be silly-renamed twice. | 1365 | * We don't allow a dentry to be silly-renamed twice. |
1370 | */ | 1366 | */ |
@@ -1681,16 +1677,9 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1681 | new_inode = NULL; | 1677 | new_inode = NULL; |
1682 | /* instantiate the replacement target */ | 1678 | /* instantiate the replacement target */ |
1683 | d_instantiate(new_dentry, NULL); | 1679 | d_instantiate(new_dentry, NULL); |
1684 | } else if (atomic_read(&new_dentry->d_count) > 1) { | 1680 | } else if (atomic_read(&new_dentry->d_count) > 1) |
1685 | /* dentry still busy? */ | 1681 | /* dentry still busy? */ |
1686 | #ifdef NFS_PARANOIA | ||
1687 | printk("nfs_rename: target %s/%s busy, d_count=%d\n", | ||
1688 | new_dentry->d_parent->d_name.name, | ||
1689 | new_dentry->d_name.name, | ||
1690 | atomic_read(&new_dentry->d_count)); | ||
1691 | #endif | ||
1692 | goto out; | 1682 | goto out; |
1693 | } | ||
1694 | } else | 1683 | } else |
1695 | drop_nlink(new_inode); | 1684 | drop_nlink(new_inode); |
1696 | 1685 | ||
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index 234778576f09..d1cbf0a0fbb2 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include "internal.h" | 41 | #include "internal.h" |
42 | 42 | ||
43 | #define NFSDBG_FACILITY NFSDBG_CLIENT | 43 | #define NFSDBG_FACILITY NFSDBG_CLIENT |
44 | #define NFS_PARANOIA 1 | ||
45 | 44 | ||
46 | /* | 45 | /* |
47 | * get an NFS2/NFS3 root dentry from the root filehandle | 46 | * get an NFS2/NFS3 root dentry from the root filehandle |
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index 9d4a6b2d1996..d11eb055265c 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -272,7 +272,7 @@ nfs_idmap_id(struct idmap *idmap, struct idmap_hashtable *h, | |||
272 | set_current_state(TASK_UNINTERRUPTIBLE); | 272 | set_current_state(TASK_UNINTERRUPTIBLE); |
273 | mutex_unlock(&idmap->idmap_im_lock); | 273 | mutex_unlock(&idmap->idmap_im_lock); |
274 | schedule(); | 274 | schedule(); |
275 | current->state = TASK_RUNNING; | 275 | __set_current_state(TASK_RUNNING); |
276 | remove_wait_queue(&idmap->idmap_wq, &wq); | 276 | remove_wait_queue(&idmap->idmap_wq, &wq); |
277 | mutex_lock(&idmap->idmap_im_lock); | 277 | mutex_lock(&idmap->idmap_im_lock); |
278 | 278 | ||
@@ -333,7 +333,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h, | |||
333 | set_current_state(TASK_UNINTERRUPTIBLE); | 333 | set_current_state(TASK_UNINTERRUPTIBLE); |
334 | mutex_unlock(&idmap->idmap_im_lock); | 334 | mutex_unlock(&idmap->idmap_im_lock); |
335 | schedule(); | 335 | schedule(); |
336 | current->state = TASK_RUNNING; | 336 | __set_current_state(TASK_RUNNING); |
337 | remove_wait_queue(&idmap->idmap_wq, &wq); | 337 | remove_wait_queue(&idmap->idmap_wq, &wq); |
338 | mutex_lock(&idmap->idmap_im_lock); | 338 | mutex_lock(&idmap->idmap_im_lock); |
339 | 339 | ||
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 1e9a915d1fea..2a3fd9573207 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -48,7 +48,6 @@ | |||
48 | #include "internal.h" | 48 | #include "internal.h" |
49 | 49 | ||
50 | #define NFSDBG_FACILITY NFSDBG_VFS | 50 | #define NFSDBG_FACILITY NFSDBG_VFS |
51 | #define NFS_PARANOIA 1 | ||
52 | 51 | ||
53 | static void nfs_invalidate_inode(struct inode *); | 52 | static void nfs_invalidate_inode(struct inode *); |
54 | static int nfs_update_inode(struct inode *, struct nfs_fattr *); | 53 | static int nfs_update_inode(struct inode *, struct nfs_fattr *); |
@@ -1075,10 +1074,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1075 | /* | 1074 | /* |
1076 | * Big trouble! The inode has become a different object. | 1075 | * Big trouble! The inode has become a different object. |
1077 | */ | 1076 | */ |
1078 | #ifdef NFS_PARANOIA | ||
1079 | printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n", | 1077 | printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n", |
1080 | __FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode); | 1078 | __FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode); |
1081 | #endif | ||
1082 | out_err: | 1079 | out_err: |
1083 | /* | 1080 | /* |
1084 | * No need to worry about unhashing the dentry, as the | 1081 | * No need to worry about unhashing the dentry, as the |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index abd9f8b48943..cd3ca7b5d3db 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "internal.h" | 26 | #include "internal.h" |
27 | 27 | ||
28 | #define NFSDBG_FACILITY NFSDBG_XDR | 28 | #define NFSDBG_FACILITY NFSDBG_XDR |
29 | /* #define NFS_PARANOIA 1 */ | ||
30 | 29 | ||
31 | /* Mapping from NFS error code to "errno" error code. */ | 30 | /* Mapping from NFS error code to "errno" error code. */ |
32 | #define errno_NFSERR_IO EIO | 31 | #define errno_NFSERR_IO EIO |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index b8c28f2380a5..938f37166788 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -224,7 +224,8 @@ static int nfs4_stat_to_errno(int); | |||
224 | encode_getattr_maxsz) | 224 | encode_getattr_maxsz) |
225 | #define NFS4_dec_setattr_sz (compound_decode_hdr_maxsz + \ | 225 | #define NFS4_dec_setattr_sz (compound_decode_hdr_maxsz + \ |
226 | decode_putfh_maxsz + \ | 226 | decode_putfh_maxsz + \ |
227 | op_decode_hdr_maxsz + 3) | 227 | op_decode_hdr_maxsz + 3 + \ |
228 | nfs4_fattr_maxsz) | ||
228 | #define NFS4_enc_fsinfo_sz (compound_encode_hdr_maxsz + \ | 229 | #define NFS4_enc_fsinfo_sz (compound_encode_hdr_maxsz + \ |
229 | encode_putfh_maxsz + \ | 230 | encode_putfh_maxsz + \ |
230 | encode_fsinfo_maxsz) | 231 | encode_fsinfo_maxsz) |
@@ -2079,9 +2080,11 @@ out: | |||
2079 | 2080 | ||
2080 | #define READ_BUF(nbytes) do { \ | 2081 | #define READ_BUF(nbytes) do { \ |
2081 | p = xdr_inline_decode(xdr, nbytes); \ | 2082 | p = xdr_inline_decode(xdr, nbytes); \ |
2082 | if (!p) { \ | 2083 | if (unlikely(!p)) { \ |
2083 | printk(KERN_WARNING "%s: reply buffer overflowed in line %d.", \ | 2084 | printk(KERN_INFO "%s: prematurely hit end of receive" \ |
2084 | __FUNCTION__, __LINE__); \ | 2085 | " buffer\n", __FUNCTION__); \ |
2086 | printk(KERN_INFO "%s: xdr->p=%p, bytes=%u, xdr->end=%p\n", \ | ||
2087 | __FUNCTION__, xdr->p, nbytes, xdr->end); \ | ||
2085 | return -EIO; \ | 2088 | return -EIO; \ |
2086 | } \ | 2089 | } \ |
2087 | } while (0) | 2090 | } while (0) |
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 388950118f59..e12054c86d0d 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -20,8 +20,6 @@ | |||
20 | 20 | ||
21 | #include "internal.h" | 21 | #include "internal.h" |
22 | 22 | ||
23 | #define NFS_PARANOIA 1 | ||
24 | |||
25 | static struct kmem_cache *nfs_page_cachep; | 23 | static struct kmem_cache *nfs_page_cachep; |
26 | 24 | ||
27 | static inline struct nfs_page * | 25 | static inline struct nfs_page * |
@@ -167,11 +165,6 @@ nfs_release_request(struct nfs_page *req) | |||
167 | if (!atomic_dec_and_test(&req->wb_count)) | 165 | if (!atomic_dec_and_test(&req->wb_count)) |
168 | return; | 166 | return; |
169 | 167 | ||
170 | #ifdef NFS_PARANOIA | ||
171 | BUG_ON (!list_empty(&req->wb_list)); | ||
172 | BUG_ON (NFS_WBACK_BUSY(req)); | ||
173 | #endif | ||
174 | |||
175 | /* Release struct file or cached credential */ | 168 | /* Release struct file or cached credential */ |
176 | nfs_clear_request(req); | 169 | nfs_clear_request(req); |
177 | put_nfs_open_context(req->wb_context); | 170 | put_nfs_open_context(req->wb_context); |