xfs: don't use __GFP_NOFAIL in xfs_init_fs_context
PATCH 1/1 xfs: don't use __GFP_NOFAIL in xfs_init_fs_context
xfs_init_fs_context is early in the mount process, and if we really are out of memory there we'd better give up ASAP.
--- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_super.c +1 -1
@@ -2275,7 +2275,7 @@ xfs_init_fs_context(struct xfs_mount *mp;int i; - mp =kzalloc (sizeof (struct xfs_mount ),GFP_KERNEL | __GFP_NOFAIL); + mp =kzalloc (sizeof (struct xfs_mount ),GFP_KERNEL );if (!mp)return -ENOMEM ;
Signature · 1 line
2.47.3
Quoted 4 lines · Christoph Hellwig
xfs_init_fs_contextis early in the mount process, and if we really are out of memory there we'd better give up ASAP.Signed-off-by Christoph Hellwig <[email protected]>
Is this the fix for that recent sysbot report? If so, maybe you ought to link to the syzbot thread:
In any case the logic is sound and it's quite easy to bloat xfs_mount to be larger than 4k so the kzalloc is simply fallible:
--D
Quoted 21 lines
--- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_super.c +1
-1@@ -2275,7 +2275,7 @@ xfs_init_fs_context(struct xfs_mount *mp;int i; - mp =kzalloc (sizeof (struct xfs_mount ),GFP_KERNEL | __GFP_NOFAIL); + mp =kzalloc (sizeof (struct xfs_mount ),GFP_KERNEL );if (!mp)return -ENOMEM ;Signature · 1 line
2.47.3
Quoted 9 lines · Darrick J. Wong
Quoted 4 lines · Christoph Hellwig
xfs_init_fs_contextis early in the mount process, and if we really are out of memory there we'd better give up ASAP.Signed-off-by Christoph Hellwig <[email protected]>Is this the fix for that recent sysbot report? If so, maybe you ought to link to the syzbot thread:
At least if my theory there was correct the bug is in the mm code and it doesn't actually fix the bug, it just removes one way to trigger it.
Quoted 2 lines
In any case the logic is sound and it's quite easy to bloat
xfs_mountto be larger than 4k so the kzalloc is simply fallible:
If OTOH your theory here is correct, it does fix the bug. Let me check their .config to see which theory is correct.