On 11/13/2018 11:47 PM, Anand Jain wrote:


On 11/13/2018 11:31 PM, David Sterba wrote:
On Mon, Oct 01, 2018 at 09:31:04PM +0800, Anand Jain wrote:
+        /*
+         * we are going to replace the device path, make sure its the
+         * same device if the device mounted
+         */
+        if (device->bdev) {
+            struct block_device *path_bdev;
+
+            path_bdev = lookup_bdev(path);
+            if (IS_ERR(path_bdev)) {
+                mutex_unlock(&fs_devices->device_list_mutex);
+                return ERR_CAST(path_bdev);
+            }
+
+            if (device->bdev != path_bdev) {
+                bdput(path_bdev);
+                mutex_unlock(&fs_devices->device_list_mutex);
+                return ERR_PTR(-EEXIST);

 I have installed ubuntu with btrfs as root and with a subvol to be
 mounted at boot. Its working fine.

Thanks, Anand

Reply via email to