From: "Pankaj Raghav (Samsung)" <kernel@pankajraghav.com>
To: david@fromorbit.com
Cc: chandanbabu@kernel.org, linux-xfs@vger.kernel.org,
mcgrof@kernel.org, p.raghav@samsung.com
Subject: Re: [PATCH 1/4] xfs: use kvmalloc for xattr buffers
Date: Wed, 17 Apr 2024 16:35:02 +0200 [thread overview]
Message-ID: <20240417143502.1888116-1-kernel@pankajraghav.com> (raw)
In-Reply-To: <20240402221127.1200501-2-david@fromorbit.com>
> Pankaj Raghav reported that when filesystem block size is larger
> than page size, the xattr code can use kmalloc() for high order
> allocations. This triggers a useless warning in the allocator as it
> is a __GFP_NOFAIL allocation here:
>
> static inline
> struct page *rmqueue(struct zone *preferred_zone,
> struct zone *zone, unsigned int order,
> gfp_t gfp_flags, unsigned int alloc_flags,
> int migratetype)
> {
> struct page *page;
>
> /*
> * We most definitely don't want callers attempting to
> * allocate greater than order-1 page units with __GFP_NOFAIL.
> */
> >>>> WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1));
> ...
>
> Fix this by changing all these call sites to use kvmalloc(), which
> will strip the NOFAIL from the kmalloc attempt and if that fails
> will do a __GFP_NOFAIL vmalloc().
>
> This is not an issue that productions systems will see as
> filesystems with block size > page size cannot be mounted by the
> kernel; Pankaj is developing this functionality right now.
>
> Reported-by: Pankaj Raghav <kernel@pankajraghav.com>
> Fixes: f078d4ea8276 ("xfs: convert kmem_alloc() to kmalloc()")
> Signed-off-be: Dave Chinner <dchinner@redhat.com>
Thanks. I tested this patch in my LBS branch and it fixes the warning.
Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>
For now, I will add it to my LBS branch as I don't see it yet land on
6.9-rcs.
> ---
> fs/xfs/libxfs/xfs_attr_leaf.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
--
Pankaj
next prev parent reply other threads:[~2024-04-17 14:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 21:38 [PATCH 0/4] xfs: fixes for 6.9-rcX Dave Chinner
2024-04-02 21:38 ` [PATCH 1/4] xfs: use kvmalloc for xattr buffers Dave Chinner
2024-04-03 3:43 ` Darrick J. Wong
2024-04-03 4:39 ` Christoph Hellwig
2024-04-03 6:16 ` Dave Chinner
2024-04-03 6:19 ` Christoph Hellwig
2024-04-17 14:35 ` Pankaj Raghav (Samsung) [this message]
2024-04-02 21:38 ` [PATCH 2/4] xfs: xfs_alloc_file_space() fails to detect ENOSPC Dave Chinner
2024-04-03 3:46 ` Darrick J. Wong
2024-04-03 4:40 ` Christoph Hellwig
2024-04-03 6:34 ` Dave Chinner
2024-04-03 18:23 ` Christoph Hellwig
2024-04-02 21:38 ` [PATCH 3/4] xfs: handle allocation failure in xfs_dquot_disk_alloc() Dave Chinner
2024-04-03 3:48 ` Darrick J. Wong
2024-04-03 4:41 ` Christoph Hellwig
2024-04-03 4:54 ` Darrick J. Wong
2024-04-03 4:56 ` Christoph Hellwig
2024-04-03 5:04 ` Darrick J. Wong
2024-04-03 6:41 ` Dave Chinner
2024-04-03 14:06 ` Christoph Hellwig
2024-04-03 21:49 ` Dave Chinner
2024-04-02 21:38 ` [PATCH 4/4] xfs: validate block count for XFS_IOC_SET_RESBLKS Dave Chinner
2024-04-03 3:53 ` Darrick J. Wong
2024-04-03 6:55 ` Dave Chinner
2024-04-03 4:43 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240417143502.1888116-1-kernel@pankajraghav.com \
--to=kernel@pankajraghav.com \
--cc=chandanbabu@kernel.org \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=p.raghav@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).