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>
This commit is contained in:
David Sterba 2017-10-10 14:53:32 +02:00
parent 37f1faef15
commit 0a694ff4b0
1 changed files with 2 additions and 0 deletions

View File

@ -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 */