diff options
author | David Sterba <dsterba@suse.com> | 2024-02-07 03:24:06 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-03-04 16:24:51 +0100 |
commit | 636d91d7ee2399df59366fc32b10aa79ba80eefd (patch) | |
tree | 7582b5e78fab58d5ec23e14dbdca269a9407220a /fs/btrfs/inode.c | |
parent | bfe8a0ccbb3a02ff0a3b2e835b550e4180d2f86a (diff) | |
download | linux-636d91d7ee2399df59366fc32b10aa79ba80eefd.tar.gz linux-636d91d7ee2399df59366fc32b10aa79ba80eefd.tar.bz2 linux-636d91d7ee2399df59366fc32b10aa79ba80eefd.zip |
btrfs: delete BUG_ON in btrfs_init_locked_inode()
The purpose of the BUG_ON is not clear. The helper btrfs_grab_root()
could return a NULL in case args->root would be a NULL or if there are
zero references. Then we check if the root pointer stored in the inode
still exists.
The whole call chain is for iget:
btrfs_iget
btrfs_iget_path
btrfs_iget_locked
iget5_locked
btrfs_init_locked_inode
which is called from many contexts where we the root pointer is used and
we can safely assume has enough references.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1a527c7f383b..cb23b3834c3d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5571,7 +5571,6 @@ static int btrfs_init_locked_inode(struct inode *inode, void *p) BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY; BTRFS_I(inode)->location.offset = 0; BTRFS_I(inode)->root = btrfs_grab_root(args->root); - BUG_ON(args->root && !BTRFS_I(inode)->root); if (args->root && args->root == args->root->fs_info->tree_root && args->ino != BTRFS_BTREE_INODE_OBJECTID) |