aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/inode.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2007-10-18 06:05:17 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:21 -0400
commit1ac564ecabc777636cf4eb88840802d7dc57d286 (patch)
tree6cad2e3f07b089d424761276215901a93986840e /fs/ecryptfs/inode.c
parentef1d7151d2901295278d5aada39c547ed8601419 (diff)
ecryptfs: allow lower fs to interpret ATTR_KILL_S*ID
Make sure ecryptfs doesn't trip the BUG() in notify_change. This also allows the lower filesystem to interpret ATTR_KILL_S*ID in its own way. Signed-off-by: Jeff Layton <jlayton@redhat.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Neil Brown <neilb@suse.de> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Chris Mason <chris.mason@oracle.com> Cc: Jeff Mahoney <jeffm@suse.com> Cc: "Vladimir V. Saveliev" <vs@namesys.com> Cc: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Steven French <sfrench@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r--fs/ecryptfs/inode.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 5701f816faf4..0b1ab016fa2e 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -914,6 +914,14 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
914 if (rc < 0) 914 if (rc < 0)
915 goto out; 915 goto out;
916 } 916 }
917
918 /*
919 * mode change is for clearing setuid/setgid bits. Allow lower fs
920 * to interpret this in its own way.
921 */
922 if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
923 ia->ia_valid &= ~ATTR_MODE;
924
917 rc = notify_change(lower_dentry, ia); 925 rc = notify_change(lower_dentry, ia);
918out: 926out:
919 fsstack_copy_attr_all(inode, lower_inode, NULL); 927 fsstack_copy_attr_all(inode, lower_inode, NULL);