ext4: don't trash state flags in EXT4_IOC_SETFLAGS
authorTheodore Ts'o <tytso@mit.edu>
Fri, 1 Jun 2012 03:46:01 +0000 (23:46 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 10 Jun 2012 13:42:11 +0000 (14:42 +0100)
commit8de426390253cabdcfc7e46b53d2d56c894d23bf
tree3aa3a1bd24cbeb13645b742f943e1387d8f022db
parenta466c7f9d6e61fb19c2d49f82007a0700724a1e3
ext4: don't trash state flags in EXT4_IOC_SETFLAGS

commit 79906964a187c405db72a3abc60eb9b50d804fbc upstream.

In commit 353eb83c we removed i_state_flags with 64-bit longs, But
when handling the EXT4_IOC_SETFLAGS ioctl, we replace i_flags
directly, which trashes the state flags which are stored in the high
32-bits of i_flags on 64-bit platforms.  So use the the
ext4_{set,clear}_inode_flags() functions which use atomic bit
manipulation functions instead.

Reported-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/ioctl.c