From: OGAWA Hirofumi Date: Thu, 6 Nov 2008 20:53:54 +0000 (-0800) Subject: fat: Fix ATTR_RO in the case of (~umask & S_WUGO) == 0 X-Git-Tag: v2.6.28-rc4~40 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9183482f5d4a2de00f66641b974e7f351d41b675;p=pandora-kernel.git fat: Fix ATTR_RO in the case of (~umask & S_WUGO) == 0 If inode->i_mode doesn't have S_WUGO, current code assumes it means ATTR_RO. However, if (~[ufd]mask & S_WUGO) == 0, inode->i_mode can't hold S_WUGO. Therefore the updated directory entry will always have ATTR_RO. This adds fat_mode_can_hold_ro() to check it. And if inode->i_mode can't hold, uses -i_attrs to hold ATTR_RO instead. With this, we don't set ATTR_RO unless users change it via ioctl() if (~[ufd]mask & S_WUGO) == 0. And on FAT_IOCTL_GET_ATTRIBUTES path, this adds ->i_mutex to it for not returning the partially updated attributes by FAT_IOCTL_SET_ATTRIBUTES to userland. Signed-off-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed