summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-10-10 14:53:32 +0200
committerDavid Sterba <dsterba@suse.com>2017-10-13 20:15:43 +0200
commit0a694ff4b0bf37b6ade11184401420af002faffd (patch)
tree910036071790a934c9690f06c8c14cb62ecc2afe
parent37f1faef159ebcf91846e7126879b1a413cb29a5 (diff)
btrfs-progs: check: drop exclusive open mode for --force
The check opens the given device in exclusive by default. In the forced mode we want to access a device in use, so we have to drop the exclusivity bit. This works for block devices but not for files, that could be mounted via a loop device. In that respect test check/007 is broken and will be fixed. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-check.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 0c08618e..5c822b84 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -13112,6 +13112,8 @@ int cmd_check(int argc, char **argv)
warning(
"filesystem mounted, continuing because of --force");
}
+ /* A block device is mounted in exclusive mode by kernel */
+ ctree_flags &= ~OPEN_CTREE_EXCLUSIVE;
}
/* only allow partial opening under repair mode */