aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_fs.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-15 18:17:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-19 17:19:16 -0400
commit565277f63c616e11c37309a1e98c052d18ebbb55 (patch)
tree60fdddc5a1c97df696392e47ead71d33d39e487f /include/linux/nfs_fs.h
parent61e930a904966cc37e0a3404276f0b73037e57ca (diff)
NFS: Fix a race in sillyrename
lookup() and sillyrename() can race one another because the sillyrename() completion cannot take the parent directory's inode->i_mutex since the latter may be held by whoever is calling dput(). We therefore have little option but to add extra locking to ensure that nfs_lookup() and nfs_atomic_open() do not race with the sillyrename completion. If somebody has looked up the sillyrenamed file in the meantime, we just transfer the sillydelete information to the new dentry. Please refer to the bug-report at http://bugzilla.linux-nfs.org/show_bug.cgi?id=150 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r--include/linux/nfs_fs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c5164c257f71..e82a6ebc725d 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -160,6 +160,12 @@ struct nfs_inode {
160 /* Open contexts for shared mmap writes */ 160 /* Open contexts for shared mmap writes */
161 struct list_head open_files; 161 struct list_head open_files;
162 162
163 /* Number of in-flight sillydelete RPC calls */
164 atomic_t silly_count;
165 /* List of deferred sillydelete requests */
166 struct hlist_head silly_list;
167 wait_queue_head_t waitqueue;
168
163#ifdef CONFIG_NFS_V4 169#ifdef CONFIG_NFS_V4
164 struct nfs4_cached_acl *nfs4_acl; 170 struct nfs4_cached_acl *nfs4_acl;
165 /* NFSv4 state */ 171 /* NFSv4 state */
@@ -394,6 +400,8 @@ extern void nfs_release_automount_timer(void);
394 */ 400 */
395extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); 401extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry);
396extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); 402extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
403extern void nfs_block_sillyrename(struct dentry *dentry);
404extern void nfs_unblock_sillyrename(struct dentry *dentry);
397 405
398/* 406/*
399 * linux/fs/nfs/write.c 407 * linux/fs/nfs/write.c