Merge tag 'ide-5.11-2021-02-28' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / fs / super.c
index 2c6cdea..8c1baca 100644 (file)
@@ -865,7 +865,8 @@ int reconfigure_super(struct fs_context *fc)
 
        if (fc->sb_flags_mask & SB_RDONLY) {
 #ifdef CONFIG_BLOCK
-               if (!(fc->sb_flags & SB_RDONLY) && bdev_read_only(sb->s_bdev))
+               if (!(fc->sb_flags & SB_RDONLY) && sb->s_bdev &&
+                   bdev_read_only(sb->s_bdev))
                        return -EACCES;
 #endif
 
@@ -1718,12 +1719,6 @@ int freeze_super(struct super_block *sb)
 }
 EXPORT_SYMBOL(freeze_super);
 
-/**
- * thaw_super -- unlock filesystem
- * @sb: the super to thaw
- *
- * Unlocks the filesystem and marks it writeable again after freeze_super().
- */
 static int thaw_super_locked(struct super_block *sb)
 {
        int error;
@@ -1759,6 +1754,12 @@ out:
        return 0;
 }
 
+/**
+ * thaw_super -- unlock filesystem
+ * @sb: the super to thaw
+ *
+ * Unlocks the filesystem and marks it writeable again after freeze_super().
+ */
 int thaw_super(struct super_block *sb)
 {
        down_write(&sb->s_umount);