From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: [PATCH 5/7] locks: break delegations on rename Date: Fri, 9 Mar 2012 17:29:32 -0500 Message-ID: <1331332174-22621-5-git-send-email-bfields@redhat.com> References: <20120309222114.GA22423@fieldses.org> Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "J. Bruce Fields" To: Al Viro Return-path: Received: from fieldses.org ([174.143.236.118]:47724 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755376Ab2CIW3h (ORCPT ); Fri, 9 Mar 2012 17:29:37 -0500 In-Reply-To: <20120309222114.GA22423@fieldses.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: "J. Bruce Fields" Signed-off-by: J. Bruce Fields --- fs/namei.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index eb4166f..21a1d65 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3092,6 +3092,14 @@ static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) goto out; + error = break_deleg(source, O_WRONLY); + if (error) + goto out; + if (target) { + error = break_deleg(target, O_WRONLY); + if (error) + goto out; + } error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); if (error) goto out; -- 1.7.5.4