From: Ilya Dryomov Date: Wed, 12 Oct 2011 21:20:43 +0000 (+0300) Subject: Btrfs: fix a bug when opening seed devices X-Git-Tag: v2.6.39-400.9.0~845^2~39 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=65d38bcf97a845f2aaf9c45a36385e79e8b50593;p=users%2Fjedix%2Flinux-maple.git Btrfs: fix a bug when opening seed devices 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 (cherry picked from commit 5f524444c351e145a5f7e28253594688a421bfe8) --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index ae475fe559bd..7ae014b42a37 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -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; }