Commit 5f524444c351e145a5f7e28253594688a421bfe8

Authored by Ilya Dryomov
Committed by David Sterba
1 parent 068132bad1

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 <idryomov@gmail.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -939,6 +939,7 @@
939 939  
940 940 s->s_flags = flags | MS_NOSEC;
941 941 strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
  942 + btrfs_sb(s)->fs_info->bdev_holder = fs_type;
942 943 error = btrfs_fill_super(s, fs_devices, data,
943 944 flags & MS_SILENT ? 1 : 0);
944 945 if (error) {
... ... @@ -946,7 +947,6 @@
946 947 return ERR_PTR(error);
947 948 }
948 949  
949   - btrfs_sb(s)->fs_info->bdev_holder = fs_type;
950 950 s->s_flags |= MS_ACTIVE;
951 951 }
952 952