Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[firefly-linux-kernel-4.4.55.git] / fs / f2fs / xattr.c
index 62c82f35087e3a429d61bcc2fc3b2f46065b5e63..9757f65a05bc97dbb0ae2e42cc88e85c9d3e5d54 100644 (file)
@@ -135,7 +135,8 @@ static int f2fs_xattr_advise_get(struct dentry *dentry, const char *name,
        if (strcmp(name, "") != 0)
                return -EINVAL;
 
-       *((char *)buffer) = F2FS_I(inode)->i_advise;
+       if (buffer)
+               *((char *)buffer) = F2FS_I(inode)->i_advise;
        return sizeof(char);
 }
 
@@ -152,6 +153,7 @@ static int f2fs_xattr_advise_set(struct dentry *dentry, const char *name,
                return -EINVAL;
 
        F2FS_I(inode)->i_advise |= *(char *)value;
+       mark_inode_dirty(inode);
        return 0;
 }