ext4: flush any pending end_io requests before DIO reads w/dioread_nolock
[firefly-linux-kernel-4.4.55.git] / fs / attr.c
index 91dbe2a107f2adef13f1141ad57794240a704334..caf2aa521e2b4101e29e288ed1ed4b5fb895f226 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -175,6 +175,13 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
                        return -EPERM;
        }
 
+       if ((ia_valid & ATTR_MODE)) {
+               mode_t amode = attr->ia_mode;
+               /* Flag setting protected by i_mutex */
+               if (is_sxid(amode))
+                       inode->i_flags &= ~S_NOSEC;
+       }
+
        now = current_fs_time(inode->i_sb);
 
        attr->ia_ctime = now;