From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: [PATCH 5/6] leases: break leases on any attribute modification Date: Wed, 21 Sep 2011 10:58:16 -0400 Message-ID: <1316617097-21384-6-git-send-email-bfields@redhat.com> References: <1316617097-21384-1-git-send-email-bfields@redhat.com> Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org, Christoph Hellwig , Al Viro , Mimi Zohar , "J. Bruce Fields" To: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: In-Reply-To: <1316617097-21384-1-git-send-email-bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org NFSv4 uses leases to guarantee that clients can cash metadata as well as data. (I suspect the same is true for Samba.) This covers chmod, chown, etc. Signed-off-by: J. Bruce Fields --- fs/attr.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index 538e279..4ce31cb 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -231,6 +231,9 @@ int notify_change(struct dentry * dentry, struct iattr * attr) error = security_inode_setattr(dentry, attr); if (error) return error; + error = break_lease(inode, O_WRONLY); + if (error) + return error; if (inode->i_op->setattr) error = inode->i_op->setattr(dentry, attr); -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html