]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Btrfs: fix a bug when opening seed devices
authorIlya Dryomov <idryomov@gmail.com>
Wed, 12 Oct 2011 21:20:43 +0000 (00:20 +0300)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:44 +0000 (21:20 -0500)
Initialize fs_info->bdev_holder a bit earlier to be able to pass a
correct holder id to blkdev_get() when opening seed devices with O_EXCL.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 5f524444c351e145a5f7e28253594688a421bfe8)

fs/btrfs/super.c

index ae475fe559bdf0086ba3f9eebaaa5bdda982de1c..7ae014b42a37a7afcd3275c961e713e769350c64 100644 (file)
@@ -950,6 +950,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
 
                s->s_flags = flags | MS_NOSEC;
                strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
+               btrfs_sb(s)->fs_info->bdev_holder = fs_type;
                error = btrfs_fill_super(s, fs_devices, data,
                                         flags & MS_SILENT ? 1 : 0);
                if (error) {
@@ -957,7 +958,6 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
                        return ERR_PTR(error);
                }
 
-               btrfs_sb(s)->fs_info->bdev_holder = fs_type;
                s->s_flags |= MS_ACTIVE;
        }