From: Trond Myklebust Date: Sat, 13 Jan 2007 07:28:12 +0000 (-0500) Subject: NFS: Fix up "rm -rf"... X-Git-Tag: v2.6.21-rc1~298 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccfeb506231348a3c60ab0fdb5753a574653e3c0;p=linux-2.6 NFS: Fix up "rm -rf"... When a file is being scheduled for deletion by means of the sillyrename mechanism, it makes sense to start out writeback of the dirty data as soon as possible in order to ensure that the delete can occur. Examples of cases where this is an issue include "rm -rf", which will busy-wait until the file is closed, and the sillyrename completes. Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index d9ba8cb0ee..bd269d2688 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1443,6 +1443,8 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry) if (atomic_read(&dentry->d_count) > 1) { spin_unlock(&dentry->d_lock); spin_unlock(&dcache_lock); + /* Start asynchronous writeout of the inode */ + write_inode_now(dentry->d_inode, 0); error = nfs_sillyrename(dir, dentry); unlock_kernel(); return error;