Skip to content

Commit

Permalink
hugetlbfs: remove useless BUG_ON(!inode) in hugetlbfs_setattr()
Browse files Browse the repository at this point in the history
When we reach here with inode = NULL, we should have crashed as inode has
already been dereferenced via hstate_inode.  So this BUG_ON(!inode) does
not take effect and should be removed.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Miaohe Lin <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
MiaoheLin authored and torvalds committed Feb 24, 2021
1 parent a4fa34c commit d014675
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,6 @@ static int hugetlbfs_setattr(struct user_namespace *mnt_userns,
unsigned int ia_valid = attr->ia_valid;
struct hugetlbfs_inode_info *info = HUGETLBFS_I(inode);

BUG_ON(!inode);

error = setattr_prepare(&init_user_ns, dentry, attr);
if (error)
return error;
Expand Down

0 comments on commit d014675

Please sign in to comment.