btrfs-progs: open RW to register device using btrfs-control
authorAnand Jain <anand.jain@oracle.com>
Wed, 15 Oct 2014 00:46:54 +0000 (08:46 +0800)
committerDavid Sterba <dsterba@suse.cz>
Thu, 16 Oct 2014 10:08:59 +0000 (12:08 +0200)
We are passing device path to be registered with in kernel,
so we need to open with RW

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
utils.c

diff --git a/utils.c b/utils.c
index e86292a..b65eef7 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -1246,7 +1246,7 @@ void btrfs_register_one_device(char *fname)
        int ret;
        int e;
 
-       fd = open("/dev/btrfs-control", O_RDONLY);
+       fd = open("/dev/btrfs-control", O_RDWR);
        if (fd < 0) {
                fprintf(stderr, "failed to open /dev/btrfs-control "
                        "skipping device registration: %s\n",