From: Jeff Layton Date: Thu, 18 Oct 2007 10:05:19 +0000 (-0700) Subject: reiserfs: turn of ATTR_KILL_S*ID at beginning of reiserfs_setattr X-Git-Tag: v2.6.24-rc1~401 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cdd6fe6e2f7eb8e940854317613885c33b1fe584;p=karo-tx-linux.git reiserfs: turn of ATTR_KILL_S*ID at beginning of reiserfs_setattr reiserfs_setattr can call notify_change recursively using the same iattr struct. This could cause it to trip the BUG() in notify_change. Fix reiserfs to clear those bits near the beginning of the function. Signed-off-by: Jeff Layton Cc: Chris Mason Cc: Jeff Mahoney Cc: "Vladimir V. Saveliev" Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 9ea12004fa57..0804289d355d 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -3061,7 +3061,11 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error; - unsigned int ia_valid = attr->ia_valid; + unsigned int ia_valid; + + /* must be turned off for recursive notify_change calls */ + ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID); + reiserfs_write_lock(inode->i_sb); if (attr->ia_valid & ATTR_SIZE) { /* version 2 items will be caught by the s_maxbytes check