Commit de631e1
xfs: use kvmalloc for xattr buffers
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 <[email protected]>
Fixes: f078d4e ("xfs: convert kmem_alloc() to kmalloc()")
Signed-off-by: Dave Chinner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Darrick J. Wong <[email protected]>
Reviewed-by: Pankaj Raghav <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Acked-by: Darrick J. Wong <[email protected]>
Reviewed-by: Daniel Gomez <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Reviewed-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>1 parent 10553a9 commit de631e1
1 file changed
+6
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
| 1141 | + | |
1145 | 1142 | | |
1146 | 1143 | | |
1147 | 1144 | | |
| |||
1205 | 1202 | | |
1206 | 1203 | | |
1207 | 1204 | | |
1208 | | - | |
| 1205 | + | |
1209 | 1206 | | |
1210 | 1207 | | |
1211 | 1208 | | |
| |||
1613 | 1610 | | |
1614 | 1611 | | |
1615 | 1612 | | |
1616 | | - | |
| 1613 | + | |
1617 | 1614 | | |
1618 | 1615 | | |
1619 | 1616 | | |
| |||
1651 | 1648 | | |
1652 | 1649 | | |
1653 | 1650 | | |
1654 | | - | |
| 1651 | + | |
1655 | 1652 | | |
1656 | 1653 | | |
1657 | 1654 | | |
| |||
2330 | 2327 | | |
2331 | 2328 | | |
2332 | 2329 | | |
2333 | | - | |
| 2330 | + | |
2334 | 2331 | | |
2335 | 2332 | | |
2336 | 2333 | | |
| |||
2371 | 2368 | | |
2372 | 2369 | | |
2373 | 2370 | | |
2374 | | - | |
| 2371 | + | |
2375 | 2372 | | |
2376 | 2373 | | |
2377 | 2374 | | |
| |||
0 commit comments