Merge tag 'uniphier-fixes-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / fs / namei.c
index 1180f9c..c75ea03 100644 (file)
@@ -447,8 +447,7 @@ static int sb_permission(struct super_block *sb, struct inode *inode, int mask)
                umode_t mode = inode->i_mode;
 
                /* Nobody gets write access to a read-only fs. */
-               if ((sb->s_flags & MS_RDONLY) &&
-                   (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
+               if (sb_rdonly(sb) && (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
                        return -EROFS;
        }
        return 0;