]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/blobdiff - fs/namei.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-disco-kernel.git] / fs / namei.c
index 1180f9c58093f723781ce981d8a2f2ef40a3c461..ed8b9488a890c2b936e249ab16e6a44a292a9521 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *  linux/fs/namei.c
  *
@@ -447,8 +448,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;