From patchwork Wed Mar 29 17:05:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192953 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 BFF13C761AF for ; Wed, 29 Mar 2023 17:06:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FA3C6B007D; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 55CC4900002; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3D6BE6B0080; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 21D536B007D for ; Wed, 29 Mar 2023 13:06:35 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EAB051C624F for ; Wed, 29 Mar 2023 17:06:34 +0000 (UTC) X-FDA: 80622564708.03.54885A3 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id C4E791C0013 for ; Wed, 29 Mar 2023 17:06:32 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=duqTnaPt; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=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=1680109593; 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=rasp905dSQTJPw1S7wJBQPjV4Dpg0Zhy7IvXBhZnf/g=; b=P0WrdznHOIiM+awrGj+m2dcreHfzvjt+HHUB0tmk0jLEcl1h3EKMomR75zVaa5pIxS7lF8 5zaB7Q2K8zX7GRlXb0IVcGvzm5ixptKsUHDuCWP+u/Oi1IxM96Rjp3MebcQXdGlmlbFEzL RvX87baOdRx9vhFUwSsBJ6tJGNg3P20= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=duqTnaPt; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109593; a=rsa-sha256; cv=none; b=jEbxJvo8iJeLr16ucvMX22QZnStqt27Wistu9+nuYfwBBI7hbT0YFbxZwIY7W3Lrd/mzh5 QrOHCk59W05FYIHe6woUs55gHECbIEVmgJkdZWMljomuuWqxqAuTwd1DHJGMcVrC6TMTWf pFZmxvOnwCeShFkGGqu2I+CAJc+eca8= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109592; x=1711645592; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w7ULCTtwVmRs76XZxrCBBgDjRvqinAOmkneoFyK+NvA=; b=duqTnaPtzkLL98plrZ66TzJ4SALNmFKX3I14A0s59SS47hUb7HxzLp26 lwMNlJ8qLt1X9vM9LLoHB/BMT6G1Z284thEo8LwdAHVc9c/oqgZv7kVUw Jy9PCojGWKBceAZjJFwh0LIuG5hyATLnkO9GcaZpaQB6bn2Hn/TTf41xn KceTLeNjVDVCd/hHWw0DtZvDopdzNcg7/QerWJU7Kd2EMRVUpOq6ij4MR P39rrzME+W+4R6mr8A4Vio0vDGuytu9pxZLNf98V9itD305x4H5xR0e8T yvrqAzUFSlsnFLCWIgyqB2KXafSwsGTRGodkb56A3a3NJCJ1knrrme/VP Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807027" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 01:06:32 +0800 IronPort-SDR: 5sWxfJad9DoJAjhUpSzMNwSVa1diasb2erVRa5Gu/TQw9lyBM7IspDwFo3eTHNl7pLRgz5BGJw q62UbOnYxL+nKdolEu1XieScKikfx3OzY7T4FQWkThF5ZAiyElGfAz3fGJHSuqpzOVIMSaNRcH /hwAUH2jkcZtCN9ozAvPd9R8jRmHpHkgPKHROY1zdPRiokW3fYf2QCYi+I8/3iEesBNkUhabyA 1/+3R6+94GAiGLIAti6Sg0InmMt0s9rLuclydTN0E7pALJ1JwryfDoxUxAuakPgPArOn+ruHtM wQc= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:41 -0700 IronPort-SDR: HxoeR2ZiwSifjLJAm4GM6J9SbigI8oViKXc7BCkcshpggE9TOaZcyDqhVSgcBLgj4CeCbAetZI +UtoI8hvcC0aeY4gXAT+WWBWHXSNAnTXctf9VPJWFomeAXHReYsBRLLfqTSsStRS6jxBLp1674 vgvEKqUZp9f6u7w4Gk4HVPSF59cBQy2yyUeoHZgaezaaXfhXfpLpfF7TyUmHcjLZzHv3zOPW/B mD5ohyDY4XjUiEY10JRmTnJm3UatvjKaPFVIROi629lwjbNdQVKZlCgN+4RJr2LXT9esfOlGAy MBk= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:31 -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 , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 04/19] fs: buffer: use __bio_add_page to add single page to bio Date: Wed, 29 Mar 2023 10:05:50 -0700 Message-Id: <56321f8ef1e70e9e541074593575b74d3e25ade2.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C4E791C0013 X-Stat-Signature: 5nb6bxgsrwjdjetwuat1su6bjqht6aqt X-Rspam-User: X-HE-Tag: 1680109592-258213 X-HE-Meta: U2FsdGVkX18Nv2AjfgLSX+kUK3PKc3c2ygL4muCkhDUD9X2TVc/ltjFf4US46KL32Bfi0lYMlXF8Uj69cl2J1ACt2QtvvI+20+ZS7AGDwjrd02nr8J66VUFkz84bC23ieKIRo74I21uX5na7cGzYosXDFBBg7/pSnzf/jxN3Dmq0ga9hbpZqPgX6rNHpKMWAmfFLDPuwzBu93x9H6/wm+7WBWdGnMHg2OhXJQBlhQT85iPh4hqM+LhppbtU+J4aI0w1YHQevq4ZsfRhmUeLuS2C9e6XSEh5LXnCg3hyK0WeCDO00myBFHBZsab4KlvGgXBsZ8sj/1U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ity: 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 buffer_head 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. Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Reviewed-by: Pankaj Raghav --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9e1e2add541e..855dc41fe162 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2733,7 +2733,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); BUG_ON(bio->bi_iter.bi_size != bh->b_size); bio->bi_end_io = end_bio_bh_io_sync;