public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PROBLEM: Corrupt inode flags when remove ATTR_SYS flag on fat file system mounted with “sys_immutable” mount option.
@ 2011-05-31  8:27 Dmitry Dmitriev
  2011-06-06 23:51 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Dmitriev @ 2011-05-31  8:27 UTC (permalink / raw)
  To: hirofumi, linux-kernel

Hello,

Inode flags are corrupted when removing ATTR_SYS flag by FAT_IOCTL_SET_ATTRIBUTES ioctl on fat file system mounted with “sys_immutable” mount option. In this case S_IMMUTABLE flag must be removed from inode flags, but actually removed all other flags except S_IMMUTABLE. This problem observed on 2.6.34 kernel, but it seems still exist( after examine of 2.6.39 kernel source code ).

The problem in fat_ioctl_set_attributes function( fs/fat/file.c ). This function contains following code(2.6.39 kernel):
 101        if (sbi->options.sys_immutable) {
 102                if (attr & ATTR_SYS)
 103                        inode->i_flags |= S_IMMUTABLE;
 104                else
 105                        inode->i_flags &= S_IMMUTABLE;
 106        }

Instead of removing S_IMMUTABLE flag from inode flags on line 105 function removes all other flags from inode flags. I think that line 105 must be following:

 105                        inode->i_flags &= ~S_IMMUTABLE;

Regards,
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-06 23:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31  8:27 PROBLEM: Corrupt inode flags when remove ATTR_SYS flag on fat file system mounted with “sys_immutable” mount option Dmitry Dmitriev
2011-06-06 23:51 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox