]> git.karo-electronics.de Git - linux-beck.git/commit
nfs: don't use d_move in nfs_async_rename_done
authorJeff Layton <jlayton@redhat.com>
Mon, 18 Jul 2011 15:26:30 +0000 (11:26 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 25 Jul 2011 19:00:21 +0000 (15:00 -0400)
commit73ca1001ed6881b476e8252adcd0eede1ea368ea
tree41aca7b930405f1d50e552e22a272ece61835995
parent2773395b34883fe54418de188733a63bb38e0ad6
nfs: don't use d_move in nfs_async_rename_done

If the task that initiated the sillyrename ends up being killed by a
fatal signal, then it will eventually return back to userspace and end
up releasing the i_mutex. d_move however needs to be done while holding
the i_mutex.

Instead of using d_move here, just unhash the old and new dentries to
prevent them from being found by lookups. With this change though, the
dentries are now incorrect post-rename and do not reflect the actual
name of the file on the server. I'm proceeding under the assumption
that since they are unhashed that this isn't really a problem.

In order for the sillydelete to still work though, the dname must be
copied earlier when setting up the sillydelete info, and the name must
be recopied if the sillydelete info has to be moved to a new dentry.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/unlink.c