summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-09-06 14:31:18 +0200
committerDavid Sterba <dsterba@suse.com>2016-09-21 14:12:38 +0200
commit8a167ec579997cb9e8204b3b4033dd99cbdbd3b8 (patch)
tree36265e39293a8bee7e5b2e02b3037ddfe09e5757 /disk-io.c
parent93a34924e134500b4b770168c366e75903315b9e (diff)
btrfs-progs: catch invalid flags in open_ctree_fd
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/disk-io.c b/disk-io.c
index b7202fab..ce0bbeee 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -1411,7 +1411,11 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
struct btrfs_fs_info *info;
/* This flags may not return fs_info with any valid root */
- BUG_ON(flags & OPEN_CTREE_IGNORE_CHUNK_TREE_ERROR);
+ if (flags & OPEN_CTREE_IGNORE_CHUNK_TREE_ERROR) {
+ error("invalid open_ctree flags: 0x%llx",
+ (unsigned long long)flags);
+ return NULL;
+ }
info = __open_ctree_fd(fp, path, sb_bytenr, 0, 0, flags);
if (!info)
return NULL;