* [PATCH v2] hugetlbfs: Remove useless BUG_ON(!inode) in hugetlbfs_setattr()
@ 2021-01-18 11:07 Miaohe Lin
2021-01-19 18:46 ` Mike Kravetz
0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2021-01-18 11:07 UTC (permalink / raw)
To: mike.kravetz; +Cc: linux-mm, linux-kernel, linmiaohe
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.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
fs/hugetlbfs/inode.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 016c863b493b..79464963f95e 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -759,8 +759,6 @@ static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr)
unsigned int ia_valid = attr->ia_valid;
struct hugetlbfs_inode_info *info = HUGETLBFS_I(inode);
- BUG_ON(!inode);
-
error = setattr_prepare(dentry, attr);
if (error)
return error;
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] hugetlbfs: Remove useless BUG_ON(!inode) in hugetlbfs_setattr()
2021-01-18 11:07 [PATCH v2] hugetlbfs: Remove useless BUG_ON(!inode) in hugetlbfs_setattr() Miaohe Lin
@ 2021-01-19 18:46 ` Mike Kravetz
0 siblings, 0 replies; 2+ messages in thread
From: Mike Kravetz @ 2021-01-19 18:46 UTC (permalink / raw)
To: Miaohe Lin; +Cc: linux-mm, linux-kernel, Andrew Morton
CC Andrew
On 1/18/21 3:07 AM, Miaohe Lin wrote:
> 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.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> fs/hugetlbfs/inode.c | 2 --
> 1 file changed, 2 deletions(-)
Thanks,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
>
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index 016c863b493b..79464963f95e 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -759,8 +759,6 @@ static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr)
> unsigned int ia_valid = attr->ia_valid;
> struct hugetlbfs_inode_info *info = HUGETLBFS_I(inode);
>
> - BUG_ON(!inode);
> -
> error = setattr_prepare(dentry, attr);
> if (error)
> return error;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-19 21:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 11:07 [PATCH v2] hugetlbfs: Remove useless BUG_ON(!inode) in hugetlbfs_setattr() Miaohe Lin
2021-01-19 18:46 ` Mike Kravetz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).