summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-02-21 07:40:44 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-03-02 20:55:50 -0800
commit93baa55af1a19a4b86129fea40bc36c82f8b9905 (patch)
treebb99e31c3ac068e8cdad9ca46a02c59cdcb6ae21 /fs/xfs/xfs_buf.c
parentd0c7feaf87678371c2c09b3709400be416b2dc62 (diff)
downloadlinux-93baa55af1a19a4b86129fea40bc36c82f8b9905.tar.bz2
xfs: improve error message when we can't allocate memory for xfs_buf
If xfs_buf_get_map can't allocate enough memory for the buffer it's trying to create, it'll cough up an error about not being able to allocate "pagesn". That's not particularly helpful (and if we're really out of memory the message is very spammy) so change the message to tell us how many pages were actually requested, and ratelimit it too. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r--fs/xfs/xfs_buf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 217e4f82a44a..c805ffae8913 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -727,8 +727,9 @@ found:
if (!bp->b_addr) {
error = _xfs_buf_map_pages(bp, flags);
if (unlikely(error)) {
- xfs_warn(target->bt_mount,
- "%s: failed to map pagesn", __func__);
+ xfs_warn_ratelimited(target->bt_mount,
+ "%s: failed to map %u pages", __func__,
+ bp->b_page_count);
xfs_buf_relse(bp);
return error;
}