diff options
Diffstat (limited to '')
-rw-r--r-- | fs/btrfs/export.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index bfa2bf445..d908afa1f 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c @@ -161,8 +161,15 @@ struct dentry *btrfs_get_parent(struct dentry *child) ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) goto fail; + if (ret == 0) { + /* + * Key with offset of -1 found, there would have to exist an + * inode with such number or a root with such id. + */ + ret = -EUCLEAN; + goto fail; + } - BUG_ON(ret == 0); /* Key with offset of -1 found */ if (path->slots[0] == 0) { ret = -ENOENT; goto fail; |