From patchwork Fri Feb 21 15:41:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11396779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 959F41395 for ; Fri, 21 Feb 2020 15:41:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 750FD24650 for ; Fri, 21 Feb 2020 15:41:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="twpmF0ip" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728177AbgBUPlh (ORCPT ); Fri, 21 Feb 2020 10:41:37 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:43602 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727312AbgBUPlg (ORCPT ); Fri, 21 Feb 2020 10:41:36 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01LFXUG0190734 for ; Fri, 21 Feb 2020 15:41:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=/DtV47bHZgl1QYaE+aATpjQ4q/zRwrketPpO8XjlHjs=; b=twpmF0ipPF+VGxEW2+3+KlXU5FWN2f2GiVIY0Ufh5wiQYyv8EvoylGDCrc70KzUvKMUU BVgMmkNUZuhAxgK7BYsnnB7O2UdALf1PegjQ94cYZ7oQfI38MIPsSCSOX0eUQ8HQ85CZ 7LrK7yE688iCHzzz681kSVqMMk++IuRrM90jrDCeY6YTEbh8CxRg4RtMJa95PDjN0KY6 94aIZTHINp+AIqd4OR1r1hn7Tn/Spuk3ZmeK3vmO5YIcUE6vO8GRd54GKiOTIG7Z9hfA UBNe0Tn4ttYfHa+iLsP0oJ1w4TFaeskeqG80Cz1SCLF8AM6ESVxLQ9oakYnffl/8r7bd jw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2y8udks8jv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 21 Feb 2020 15:41:35 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01LFfTfK163687 for ; Fri, 21 Feb 2020 15:41:34 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2y8ud91j6b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 21 Feb 2020 15:41:34 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01LFfXxX003850 for ; Fri, 21 Feb 2020 15:41:33 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 21 Feb 2020 07:41:33 -0800 Date: Fri, 21 Feb 2020 07:41:32 -0800 From: "Darrick J. Wong" To: xfs Subject: [PATCH] xfs: improve error message when we can't allocate memory for xfs_buf Message-ID: <20200221154132.GQ9506@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9537 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=995 mlxscore=0 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002210118 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9537 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 priorityscore=1501 adultscore=0 mlxscore=0 clxscore=1015 malwarescore=0 mlxlogscore=999 phishscore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002210118 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong 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 Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_buf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 0ceaa172545b..f8e4fee206ff 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -727,8 +727,9 @@ xfs_buf_get_map( 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; }