From patchwork Tue May 30 15:49:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42451C7EE2C for ; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9F75900009; Tue, 30 May 2023 11:49:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2B50900005; Tue, 30 May 2023 11:49:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7BA7900009; Tue, 30 May 2023 11:49:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 93EA2900005 for ; Tue, 30 May 2023 11:49:50 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6BADCC0284 for ; Tue, 30 May 2023 15:49:50 +0000 (UTC) X-FDA: 80847356940.12.FD5E14D Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf08.hostedemail.com (Postfix) with ESMTP id 483E3160006 for ; Tue, 30 May 2023 15:49:48 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="QEajw/Sg"; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461788; a=rsa-sha256; cv=none; b=QTwlANJd2RFhGVfaw6PmIng0ByWLQ3d1Df/iJR0AJ8KLWXpXqTd1k0T1KGfL8MClIVwHXD d2lSkvt0IkUbLmzHd4dTwZWwzbI8KWVl7/2p+lzAk7hmhInKRU/PVILqGd10TjeWhQIyNt B5FyQGGWDSi18SnJ8U6QD6L2DyCcbac= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b="QEajw/Sg"; spf=pass (imf08.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461788; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lesC7ZHzHc7ah/ToJ8yOzNcL34jZPc+O7TdhQ2cqcu8=; b=LRGeuyfJ56oxN07FPg8OqN+mAlHXnWjGXTbupy8RKq8gjcbGRkdLHD6LxV8p5FNiin32ai HBLBj8cGcgZT/qKFPiy+HxHSjnVaTFX1XQXF7E7y8CRA7PNJG5p7Q2CQzlHIg3DgvaKzo+ zAJygE7Vdm2Fmr7HYrslRcr4GMCnY/k= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461788; x=1716997788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mEDf+2bPYBdApkRtQGcrKQLhlyK4U4yv8ooj5C9H9Fo=; b=QEajw/SgSrnCZhkVVnpDuYttoAs7WaN/WzMaiWw5CqFTfW0GDo/9Chji GfVc+pZIJZRLXFmrR2fSgO1yXGkZEMfPXvV1mZ2G5+uDQpSKUcY65YT4+ MixRclyeyOUcI5q265uZ4etPVnYOnm9kmG7tB7IschOmRYvHcSlNkrH1W 5RVoLiOts8dqQwFK9tDyymKYtIjHhZBuVSka90aKs7W9uC15VUuLAZRWb r4+LP+HCMby9GjdDDy3COSbe7y5aUIFul54yNugvirWEYE039oFv4VDn6 nUgDvGlqwYPmuOCzOqOQRdMtuAc1vmQaYQ5uQ6alMkP7wm5XllFuWcj8/ Q==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129764" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:47 +0800 IronPort-SDR: DFxP9MCfvntfy36YxVLUS7+dUvr5rFo2Mh/9jl9Zw/j1w1K2pWBovifW3vVhn3f0WMSi8wGYTh PW6UGOgN7+rSQf0UsG2DHb+l91LOWYFekH2b1zFyZPQqQw8Qgzn1RGcSQJMBpDov47v9NVGWzz pzcpYNiHCOVkTXssYeouNaTDqxmWBaMNg1+u+XRcRQU34IBWp6WUCtrXj5VpElnoExvR4k8yu9 1GHeZpZpYQL29dfiMXWdtMkdUNfJy+J0qrFrx1OrvAhBc+b/o+I0cQWmnmH7peitWwwGuntx9z T4Q= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:59:00 -0700 IronPort-SDR: MKlOX/uF8wNEct5950xnnV315MLl9jdeWlyzj552Na9mJDZsmp05yot7aD76Oi4Xbupl3BrWor CH08la1ldQbZ9LbsD2PbKhD1eEz/Wv7IO4J88KwTSohJz4Tcq8kYJ5TJv5OIor4ThvImZ+P9EU dnuo5e3IdJkZtM6PymLdROP06o8OObtizuI8cob1Ebk7RJhUIOuDEY5ObLtCjGKqVpe5/yRxRA o0I5mrkdFpgizKWYnBAUJNxt+kr6dHKCyqjCW1az0geORLLKn3tAB7Qv9196t3xurORVn7mWMo rkk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:45 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 06/20] md: raid5-log: use __bio_add_page to add single page Date: Tue, 30 May 2023 08:49:09 -0700 Message-Id: <1ee0465c7b2634a4435e65a4d0b06019a73d8389.1685461490.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 483E3160006 X-Stat-Signature: mxrpeb8bebdhoogwrjxcuuarjztzej7r X-Rspam-User: X-HE-Tag: 1685461788-906136 X-HE-Meta: U2FsdGVkX18ktukWQAHwwpcJLMLQDRo6odB7w8ydwhSzOTDOTReQ9L2DCgY8xC1+wLrCLGvCb6xMX5RE2SokmRXiaRvafBr86IHOlZZKLbIld4pUvpzMUTXdSkikKCPZT0CtKdG3n5koHJhsOidsjPjZ0Ljwg3OGCuATRWBpy6vF++bJ5gnq4bGCR2DPPWojY/1rjrTAhWkIAJNlTj/oqLlMTYf/XaGoWY9TXAlL9h+cQyonttlskM1UqQwz/RkwBMmNbBMBjeYcUNTyXMSwCR91l1roSjdIIKtwi1AFqUHXq4jE2jyjckx/wytzOpcMkBaE9NxMWxxPKb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TUa7288ADpPZGpfmEgcmzeMNK58mlnpTxNg= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The raid5 log metadata submission code uses bio_add_page() to add a page to a newly created bio. bio_add_page() can fail, but the return value is never checked. Use __bio_add_page() as adding a single page to a newly created bio is guaranteed to succeed. This brings us a step closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- drivers/md/raid5-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 46182b955aef..852b265c5db4 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -792,7 +792,7 @@ static struct r5l_io_unit *r5l_new_meta(struct r5l_log *log) io->current_bio = r5l_bio_alloc(log); io->current_bio->bi_end_io = r5l_log_endio; io->current_bio->bi_private = io; - bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); + __bio_add_page(io->current_bio, io->meta_page, PAGE_SIZE, 0); r5_reserve_log_entry(log, io);