GFS2: make sure S_NOSEC flag isn't overwritten
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 5 May 2015 17:25:48 +0000 (12:25 -0500)
committerBob Peterson <rpeterso@redhat.com>
Tue, 5 May 2015 17:25:48 +0000 (12:25 -0500)
At the end of gfs2_set_inode_flags inode->i_flags is set to flags, so
we should be modifying flags instead of inode->i_flags, so it isn't
overwritten.

Signed-off-by: Benjamin Marzinski <bmarzins redhat com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/file.c

index 8ec43ab5babf4785470ca246cfff9077c683e5c1..c706c6df489877fddc46b613b827358c359f977d 100644 (file)
@@ -180,7 +180,7 @@ void gfs2_set_inode_flags(struct inode *inode)
 
        flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_NOSEC);
        if ((ip->i_eattr == 0) && !is_sxid(inode->i_mode))
-               inode->i_flags |= S_NOSEC;
+               flags |= S_NOSEC;
        if (ip->i_diskflags & GFS2_DIF_IMMUTABLE)
                flags |= S_IMMUTABLE;
        if (ip->i_diskflags & GFS2_DIF_APPENDONLY)