From patchwork Wed Feb 9 05:04:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 542951 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1954Tw8010592 for ; Wed, 9 Feb 2011 05:04:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750786Ab1BIFE2 (ORCPT ); Wed, 9 Feb 2011 00:04:28 -0500 Received: from fieldses.org ([174.143.236.118]:45452 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727Ab1BIFE2 (ORCPT ); Wed, 9 Feb 2011 00:04:28 -0500 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1Pn2E7-000444-Su for linux-nfs@vger.kernel.org; Wed, 09 Feb 2011 00:04:27 -0500 Date: Wed, 9 Feb 2011 00:04:27 -0500 From: "J. Bruce Fields" To: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: break lease on unlink due to rename Message-ID: <20110209050427.GB15514@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 09 Feb 2011 05:04:32 +0000 (UTC) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 4218531..d7aa65c 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);