From c07668dbb16111c388e7c2ca00f3aaffe6131417 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 18 Oct 2007 03:05:21 -0700 Subject: [PATCH] --- yaml --- r: 71141 b: refs/heads/master c: 188b95dd8ecb02dd6c6e5534cddc5a89aa4e2852 h: refs/heads/master i: 71139: 3ac9fe0b2bde0743f3b52a9c718b8e1f9c3d5b19 v: v3 --- [refs] | 2 +- trunk/fs/nfs/inode.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 11f8d8775a22..52812af88eb6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6de0ec00ba8db84d7c452e65e502989455ecb6ea +refs/heads/master: 188b95dd8ecb02dd6c6e5534cddc5a89aa4e2852 diff --git a/trunk/fs/nfs/inode.c b/trunk/fs/nfs/inode.c index 6c22453d77ae..6d2f2a3eccf8 100644 --- a/trunk/fs/nfs/inode.c +++ b/trunk/fs/nfs/inode.c @@ -357,6 +357,10 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) nfs_inc_stats(inode, NFSIOS_VFSSETATTR); + /* skip mode change if it's just for clearing setuid/setgid */ + if (attr->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) + attr->ia_valid &= ~ATTR_MODE; + if (attr->ia_valid & ATTR_SIZE) { if (!S_ISREG(inode->i_mode) || attr->ia_size == i_size_read(inode)) attr->ia_valid &= ~ATTR_SIZE;