From: J. Bruce Fields Date: Sun, 6 Feb 2011 21:46:30 +0000 (-0500) Subject: nfsd: break lease on unlink due to rename X-Git-Tag: v2.6.38-rc5~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83f6b0c18204f68961f58b9f69e5dba0d36056a2;p=platform%2Fupstream%2Fkernel-adaptation-pc.git nfsd: break lease on unlink due to rename 4795bb37effb7b8fe77e2d2034545d062d3788a8 "nfsd: break lease on unlink, link, and rename", only broke the lease on the file that was being renamed, and didn't handle the case where the target path refers to an already-existing file that will be unlinked by a rename--in that case the target file should have any leases broken as well. Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 30c73f8..da1d970 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1744,6 +1744,13 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, host_err = nfsd_break_lease(odentry->d_inode); if (host_err) goto out_drop_write; + if (ndentry->d_inode) { + host_err = nfsd_break_lease(ndentry->d_inode); + if (host_err) + goto out_drop_write; + } + if (host_err) + goto out_drop_write; host_err = vfs_rename(fdir, odentry, tdir, ndentry); if (!host_err) { host_err = commit_metadata(tfhp);