On 2025/07/08 17:50, Vlastimil Babka wrote: > On 7/8/25 00:10, Dave Chinner wrote: >> On Wed, Jul 02, 2025 at 09:30:30AM +0200, Vlastimil Babka wrote: >>> On 7/2/25 3:41 AM, Tetsuo Handa wrote: >>>> By the way, why is xfs_init_fs_context() using __GFP_NOFAIL ? >>>> >>>> mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL | __GFP_NOFAIL); >>>> if (!mp) >>>> return -ENOMEM; >>>> >>>> This looks an allocation attempt which can fail safely. >> >> It's irrelevant - it shouldn't fail regardless of __GFP_NOFAIL being >> specified. > > If you mean the "too small to fail" behavior then it's generally true, > except in some corner cases like being an oom victim, in which case the > allocation can fail - the userspace process is doomed anyway. But a (small) > kernel allocation not handling NULL would still need __GFP_NOFAIL to prevent > that corner case. init_fs_context() is allowed to fail. https://elixir.bootlin.com/linux/v6.16-rc4/source/fs/fs_context.c#L318 https://elixir.bootlin.com/linux/v6.16-rc4/source/fs/ext4/super.c#L1990 Therefore, I wonder why xfs does not want xfs_init_fs_context() to fail with -ENOMEM.