From patchwork Tue May 30 15:49:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260505 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17236C7EE39 for ; Tue, 30 May 2023 15:50:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461817; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EyCxZFIddmCCtWdgUTAPnZ2XzSO3bli8v+yftF1Fw4M=; b=TxRWdLDhYmuaZFi7LZOp+wVgjEvQU4LeUwPRjHiT9bynTD1fmB3dboc150LmU2ZlGLxZIA yUm1VGOxAQDDuTh7IcO8pFtZ1LyCXrbuqmMYCzGtrXnO+bDNx5ogIdVwOBkw7x2frFjLmH n5dvUihvaei3zqPlnrPpVz+HkYx7hw4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-316-HnlAcNP-N7iTyi5peHbo7Q-1; Tue, 30 May 2023 11:50:16 -0400 X-MC-Unique: HnlAcNP-N7iTyi5peHbo7Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 906F385A5BD; Tue, 30 May 2023 15:50:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4213740C6CD8; Tue, 30 May 2023 15:50:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E8BC519465B3; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 274171946595 for ; Tue, 30 May 2023 15:49:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 161A0140E956; Tue, 30 May 2023 15:49:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E3F6140E955 for ; Tue, 30 May 2023 15:49:40 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E71463823A0F for ; Tue, 30 May 2023 15:49:39 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-344-QcvOjM71NaeS1OoOrpJsig-2; Tue, 30 May 2023 11:49:33 -0400 X-MC-Unique: QcvOjM71NaeS1OoOrpJsig-2 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905666" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:32 +0800 IronPort-SDR: xroKP1pKGxmB3VCmNPJeYhlDf49TOp0iUduKoaDk3+qXtVDkCJLjAkq4GSx0iC0oviUZeBOXat w/1QFPF0wvmcHsjJPEvHi/HPUcTRSdAzP8isWfJHUJE658O6Ls/vPTV9WzWHDhp2gxRDpPepzR L516tytQWM58wHrRx6RntZsG6EePAVovfaVakxTOb6BBpqZHSQxDK//PbSs/RPYJfLm3C10wTm ltx/2wBECoObPDKsJfEh7PsuMCFa7Ga28SsmGOAksagGmUHnl0nWpY577Xf8aR4ljNb3rokmF1 AE8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:25 -0700 IronPort-SDR: MYtng4S7szwYjmaxW/lAI1po1aVI+hTjdUIVPGMboe1qhLkMmlIPBx55GCHPb7iFjshgwqgb14 taHOFDWoBB5QsexrzNlhVmGiIcOK+oldoY3/MpOlT3CcL5onketnanRTkYr6ZmC2FvhSM442mz 17UT2jJ9dXq/oFStL90HimJSMt2PrDkDWQR2G05pjD2qMu0xYmDRYB0m13nqKi5P34VcIS4KVl n0sZXsW5hHYHRvULOtbMH2PTcIdjRzQbfuLkG8GBoOKlbeAFN0jwHUkWg8F+PstTBRqzjOtvYO Qiw= 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:29 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:04 -0700 Message-Id: <64f8ac179cc54aa316c75aaadd71e107ba12917d.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Subject: [dm-devel] [PATCH v6 01/20] swap: use __bio_add_page to add page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The swap code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 87b682d18850..684cd3c7b59b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -338,7 +338,7 @@ static void swap_writepage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc)); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); bio_associate_blkg_from_page(&bio, page); count_swpout_vm_event(page); @@ -360,7 +360,7 @@ static void swap_writepage_bdev_async(struct page *page, GFP_NOIO); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_write; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); @@ -468,7 +468,7 @@ static void swap_readpage_bdev_sync(struct page *page, bio_init(&bio, sis->bdev, &bv, 1, REQ_OP_READ); bio.bi_iter.bi_sector = swap_page_sector(page); - bio_add_page(&bio, page, thp_size(page), 0); + __bio_add_page(&bio, page, thp_size(page), 0); /* * Keep this task valid during swap readpage because the oom killer may * attempt to access it in the page fault retry time check. @@ -488,7 +488,7 @@ static void swap_readpage_bdev_async(struct page *page, bio = bio_alloc(sis->bdev, 1, REQ_OP_READ, GFP_KERNEL); bio->bi_iter.bi_sector = swap_page_sector(page); bio->bi_end_io = end_swap_bio_read; - bio_add_page(bio, page, thp_size(page), 0); + __bio_add_page(bio, page, thp_size(page), 0); count_vm_event(PSWPIN); submit_bio(bio); } From patchwork Tue May 30 15:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260509 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78F2EC77B7A for ; Tue, 30 May 2023 15:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461851; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ISTx9svpilkChGTlw+E2n+N6RCWQrnOXstG4ApF7jaI=; b=RrEpUDqIfdzywcEqtuirNxLKNpzxO4Y/B8rEpbHW1+snA+9NIMfx/n+vjxZ1pwrB0OACxD K5dIkC1eA5v/uHLCKlM9JJWao7csxYJk4oLtJVaDKSOLeCmWBWr8zrIKzkCDge1AediAQ9 fk9hApyb078kJ/g3VbVPz6tfpEFUZe0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-372-GCevk787OMWSv5Ye_dDkfg-1; Tue, 30 May 2023 11:50:50 -0400 X-MC-Unique: GCevk787OMWSv5Ye_dDkfg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6575A3825BB1; Tue, 30 May 2023 15:50:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54EF3140E955; Tue, 30 May 2023 15:50:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E921D19452C5; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 19B0919465BD for ; Tue, 30 May 2023 15:49:54 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 05057112132E; Tue, 30 May 2023 15:49:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1AB9112132C for ; Tue, 30 May 2023 15:49:48 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D610A29ABA16 for ; Tue, 30 May 2023 15:49:48 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-H7QJJE6uOdaes_Fs9zDozQ-2; Tue, 30 May 2023 11:49:44 -0400 X-MC-Unique: H7QJJE6uOdaes_Fs9zDozQ-2 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905673" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:40 +0800 IronPort-SDR: cusp5fVdZKy67CPwNMuYDkQWu3YYdmxSmEdIt839dLsC3liFSJ2ExwJHljfYksdyQkIeZ2719O oqhu9cZAsOSL4j82Y1eTKqG0hJ4CI1IRE2jJuO6H/wG1ISflB3RUAUD2WwhrJ4QHubC1HCw+fz ghPLpQIkAQJEjcgJ+eTdFYAb5v4cMJe9q/+njGgJYDteyApMcpiwS7uqkNuSVGp03n8W1jWMQE AVlKbjIvdVb0SQ6pFZEHDBGk94jNgUhvtli/Iqys9h8ZVTEUeJsafIyHaEApcwUJ+ECAphgLxb Ou8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:31 -0700 IronPort-SDR: yyyyMz2TAyAtxiGu5+SWb7d/x9PogCVD4itlH+FOZL5M/obbujzn0nPyfJX5f76wmH56HSlR9F zkurIL57b/oE5ItIAM3mh+0TCxwpK0Osc0l70ZtbuGZDq2Rs1n51DtbbNViftHEWLZ73mey9zy 2cUmbpQh/Z5J5zOcjj/YTd3YK2PiCTKftG8A1EENSystxnnFIuMK7Oe+UZdJx94whGX4awAqm2 /U8JBrcdaMvSOP4HNMkLK5PxyRVKrvl3XxjQW8zcaD6MbGJ9RpKug8LVrI9FIoeuVVWNz6eSxF 8ic= 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:32 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:05 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Subject: [dm-devel] [PATCH v6 02/20] drbd: use __bio_add_page to add page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The drbd code only adds a single page to a newly created bio. So use __bio_add_page() to add the page which is guaranteed to succeed in this case. This brings us closer to marking bio_add_page() as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/block/drbd/drbd_bitmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 6ac8c54b44c7..85ca000a0564 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -1043,9 +1043,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, &drbd_md_io_bio_set); bio->bi_iter.bi_sector = on_disk_sector; - /* bio_add_page of a single page to an empty bio will always succeed, - * according to api. Do we want to assert that? */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); bio->bi_private = ctx; bio->bi_end_io = drbd_bm_endio; From patchwork Tue May 30 15:49:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260510 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8D5AC77B73 for ; Tue, 30 May 2023 15:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461853; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Ilkof+xaeNWF6VyyjBnJy1OI1mBBRt3jMRAa1MoR3n8=; b=P68khMehbPqRGH3WB1IAIYNQsbJjMtD1Qvp2uNF7f+L0HG+ZKUe0B8NDsRtwTAaLcfZvyl CR1Pdd6GLagmC/IijMqhFR08nPhREgMsTp8GEDp4atGOsqfkr5hCRrBS9bZ+ULmsQmO2hk TA94JMfEUHyX27EXoSlynxDJJsfiXoY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-178-BoErVLD4OK6Cyci0K4NZbA-1; Tue, 30 May 2023 11:50:50 -0400 X-MC-Unique: BoErVLD4OK6Cyci0K4NZbA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3699B3825BA8; Tue, 30 May 2023 15:50:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 211E42166B26; Tue, 30 May 2023 15:50:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BDD421946A44; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1BB3219465BD for ; Tue, 30 May 2023 15:49:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E44D12166B27; Tue, 30 May 2023 15:49:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB8872166B26 for ; Tue, 30 May 2023 15:49:46 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C0D7C3C0F66B for ; Tue, 30 May 2023 15:49:46 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-_FHwFxFGPkOQy2FG8L0IOQ-1; Tue, 30 May 2023 11:49:42 -0400 X-MC-Unique: _FHwFxFGPkOQy2FG8L0IOQ-1 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905674" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:40 +0800 IronPort-SDR: KhsrRzATgDUmSCi7sRMkhpMvFr4Oy7iIyjCA8A2A8003/8/Y5IWQKjBzya0D/hTdAqcfFogPqw l+Bn6OX2N/lXHtwtY1pOeyInRoi1DVuen+XUtjVlxyqTCSpw1KnF4ckIoBXMETz0g9A/q6ptLz gUVUFLBR/WtpqhaWEBEltle6KuhHZi8KL42mX0/3e9ngmACISGi19g2OhO5y7CsWwjoUxTwQgb JETMhPXEf39HIpWtHopSWvMlCoxXb4fv9qYtKLRVTaFsvvrLRDP8/gdnRxaNsjAABz7EuNREQR sYs= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:31 -0700 IronPort-SDR: rDb04cLPnHkw83pxdqtCHKsua7HM5tgjjmF6YXHJIVLNeG4c320WrXtss9t9FpJkHk8dSG8jrZ U37pjVXEoaNU8XYLzdmKXeGmEFd+1dDT4nL97b8EqiMmuRm14WWVuMYkCCNNBQqq0YdinOO5yq Lxf5U0o9U/edHt5LmR3MVSlhItwiTl+U8LIJ90qQ/E0eH322rprOjcHnRMPPJHrvTPHPHmMyw2 XmVBT7OeOZhz0Z77oO06/HoQL/Numzb2HGonQSheeFZI4laqGj05EvNx/k0pFoJFGK5U9EVg6i 1Sg= 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:35 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:06 -0700 Message-Id: <442aec07a192f0b2fe918b66357bdf7d7c25ffdd.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Subject: [dm-devel] [PATCH v6 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 8f0896a6990b..9d3cca8e3dc9 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Tue May 30 15:49:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260507 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8684DC7EE2C for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461829; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tuAEw+dFk01Kck8uHZcjpGSSaC5VzihSaazNN/1OO+0=; b=D7mICDV+IEy5D1SftWZ3Xd0Z8cmzwMG/w8v+/CLRUcVQ++K6cg//aLBGVO8pofFxIT4EuR 3El+/mn0WTEEUNGxjBYblszoZUUbYIRw2ObZwlgfX2+l1VSixouqv7dHz/SFj+qeN3aeLT HKq1LuAgc/xy0soYF8uKO1u32L55VU0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-427-jX1s5v4lOki0BIgbjohs_w-1; Tue, 30 May 2023 11:50:26 -0400 X-MC-Unique: jX1s5v4lOki0BIgbjohs_w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F3B4811E91; Tue, 30 May 2023 15:50:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE7BB2166B25; Tue, 30 May 2023 15:50:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 539F919451C8; Tue, 30 May 2023 15:50:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D5C3F1946595 for ; Tue, 30 May 2023 15:49:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C666CC0297C; Tue, 30 May 2023 15:49:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF1EFC0448F for ; Tue, 30 May 2023 15:49:49 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A27CB811E7F for ; Tue, 30 May 2023 15:49:49 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-417-7uOonBLuPEyGMf2mkgwlOQ-1; Tue, 30 May 2023 11:49:45 -0400 X-MC-Unique: 7uOonBLuPEyGMf2mkgwlOQ-1 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905686" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:41 +0800 IronPort-SDR: 435UAHl9u8Hj+x0R11HsSzQMQZlGOpJPYA8KIElWxSVhiZDw/iHmjP2NBxsXuuSgtEkbiS430n O15fa5cohj9gSnJmOrGK1dVJEgXMX+A92q7vNlB1R45K+A83WbPtRYoM6NeR7MKvLZ5zycneaa 2rEs4suDN8Iiy7vUNcWkNe1j5NR5gRiY3r5uAvFGwYKiVrotwDBQJUgrJHvQLQjC+1pFpt2yge EkfkJtpNaGy0M3GDS1Sy0TsdPZgCronP2XpTbi3YIiIfYUOT1BBAmtloof/qb+vYaWnzyxrAU0 Jx0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:35 -0700 IronPort-SDR: flqRBN6t8oeSRa1BabMxnUCvrp7PztzsM6fP6YmtGqWahobry6jFcPjHqu76BmTmRg0k7xB+eW Xd41xDIbR1903c6oA+KNiyFakHUZmxnJUerK8kgF9kwCVwoChx0oBjxovMtZJ/BUIUTKUH9A2r 71Gjv2BTIfgq1jrGmK0RWrNe0WL9Ca0Hz/IorQC319U3yD+iig7YZY1mUOiG90XjQrt9L7sEd2 guJGoE6VxoZaYn17klSHxaUFROzgECTIVBStNd3SnsVgan18w3VkwfB17pJewsQNiwzdzvk0B0 ZGE= 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:38 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:07 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Subject: [dm-devel] [PATCH v6 04/20] fs: buffer: use __bio_add_page to add single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com 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. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Gou Hao Reviewed-by: Christoph Hellwig --- fs/buffer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index a7fc561758b1..63da30ce946a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2760,8 +2760,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)); - BUG_ON(bio->bi_iter.bi_size != bh->b_size); + __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; From patchwork Tue May 30 15:49:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260513 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94B1FC77B73 for ; Tue, 30 May 2023 15:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461889; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nYev5XBoIJzjJlRSplo6PgXAu96rj14hiZJhX3qZCWo=; b=M5r85QKwLJz7xH7Wh4Ho0rJkC+RMxYdWQIu9EouuS37hlweajE68nskqezghXAUEsvB2Is Yth8WNbEnT365qFHgnPw31HZ5mMT/kSQJ8ByiuIC4Es+ge0cu+sxsrxY8W4QIQO0GKi/TV 8tF+CJpXLS2K7OfQ36x39l7CLgPIS0U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-JJvjjiIuMe-JdcyZVGw7EA-1; Tue, 30 May 2023 11:51:26 -0400 X-MC-Unique: JJvjjiIuMe-JdcyZVGw7EA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F8C41019C8C; Tue, 30 May 2023 15:51:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F90E202696C; Tue, 30 May 2023 15:51:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 44D2919452D1; Tue, 30 May 2023 15:50:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2AC551946A42 for ; Tue, 30 May 2023 15:49:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0265640CFD46; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEAC640CFD47 for ; Tue, 30 May 2023 15:49:50 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D40CD8032FE for ; Tue, 30 May 2023 15:49:50 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-Yq2MgvCGO-iz-cLQA3ok8A-1; Tue, 30 May 2023 11:49:47 -0400 X-MC-Unique: Yq2MgvCGO-iz-cLQA3ok8A-1 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905692" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:45 +0800 IronPort-SDR: mRifpxeh03wC8dA2xvJqkecEgv40VVSzH3Xrf6HDUm3NW1FdIpMD/ElVnBg4BvBDLuaDdwr+gr H2q1BQBKEN4Qc2Fy/SXgSCUn63PI+noglo6ggqc8nHgqVin2qv8SqbTZifxMCTdhxjkYPqnP1A awFKkseZGbJWPUcLxzVWIlD+XXS+RRdHs72aD9sN59UAIWUpSHCoOaQ2CLhAp2ZG/2VH0OhghG UZ4OJKt6EVvkhceZEzJJx3K7i1sOLOwY7+OlhXqzG2fdAN/n2d2QNXPIQaeX3ZaL8Bkt/IEIhl N38= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:38 -0700 IronPort-SDR: KJrqulCfq2cqwjkpQuj6PyVKpC28Y9PRziJGpvtZLpCh0rnCFASYlRta5kVMItHLPqq5rbqivp lMPfQqlHbxJojiNO1f2byMk3lcSCsyJM5076LR2t1Uk8MU+mMSei3mzF7GpXMo0mg3+kEecLxf OyMUtTmjzDB92M0Oo1Hytx+Eufwx2D2FdxOYnT1IorOXPeITVFL5E8NvDvefbboj9O9qo/Gmak p1SuxcEHaJrwbUasxNHzxhTj/f1bmxtqyWfrTpTKU/3g7I5gd2SasjsbToJ4cuAKPzx8T5MMe9 2F0= 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:41 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:08 -0700 Message-Id: <8b046033b3b073d1ea91c45cd278b7aadd0b7e1e.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Subject: [dm-devel] [PATCH v6 05/20] md: use __bio_add_page to add single page X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The md-raid superblock writing 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-of_-by: Johannes Thumshirn Reviewed-by: Damien Le Moal Acked-by: Song Liu Reviewed-by: Christoph Hellwig --- drivers/md/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 8e344b4b3444..6a559a7e89c0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -938,7 +938,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, atomic_inc(&rdev->nr_pending); bio->bi_iter.bi_sector = sector; - bio_add_page(bio, page, size, 0); + __bio_add_page(bio, page, size, 0); bio->bi_private = rdev; bio->bi_end_io = super_written; @@ -979,7 +979,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, bio.bi_iter.bi_sector = sector + rdev->new_data_offset; else bio.bi_iter.bi_sector = sector + rdev->data_offset; - bio_add_page(&bio, page, size, 0); + __bio_add_page(&bio, page, size, 0); submit_bio_wait(&bio); 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: 13260508 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1789C77B7A for ; Tue, 30 May 2023 15:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461847; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QBzN4BQpSf1bhzWDg5IxcvifEKS6QsfAsqp6FWS0Rug=; b=J+6v611AsSEN3bxqJREXuHsy1ha/8HhFvQVYV8bv2PxCYk8IM0d+CT9y78mKvnqV2/d3fi 2fTP2+5/0GMqYPB+aF9HyyPum+U0uF6vL1GF3LS8qKo88NhevgVydP1vFMKHsyQfe9sYKN U/yCqbAFjUNoiO9lgNeNKNfHxFJOHmU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-341-zh-8r6YHPFq1qlxToKJljw-1; Tue, 30 May 2023 11:50:44 -0400 X-MC-Unique: zh-8r6YHPFq1qlxToKJljw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E85081C0904E; Tue, 30 May 2023 15:50:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5713140EBD7; Tue, 30 May 2023 15:50:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 860AE19465A2; Tue, 30 May 2023 15:50:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8203719465B2 for ; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4B80240C6CCC; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 43AEE40C6EC4 for ; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 290473C0F66F for ; Tue, 30 May 2023 15:49:51 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-K4Rg0Jv4Pw2FwVjtX8jqqg-2; Tue, 30 May 2023 11:49:49 -0400 X-MC-Unique: K4Rg0Jv4Pw2FwVjtX8jqqg-2 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231905701" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:48 +0800 IronPort-SDR: u5LjIzeIZ1PumzpvK4C/Ynnz2ua78VNOaPApx90ttOc8s2hPTJpHaKxV4ldVL7Nek1KvbyJmB9 +pD/AmWE/baidhhvCI0SMargITJsz5qR7F8mnBj9QbBZ85FkWAMyXf/3kmLTsbi7XJnpj4kF7u HwTLW6/0QVFpjofZIzSDiajtVyeU+RBFk0Y/Yta7xvQQd9ljuSo5QYdC6PozmOkxQDZqXiqZZ+ SuLt5hrzd5qHif7hx1uluPuXzvosohUFkIPJs4Bapi7Un8CwGQ9nXSmcWcNmlpOxgMIYdbtRq5 qQQ= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:41 -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 Date: Tue, 30 May 2023 08:49:09 -0700 Message-Id: <1ee0465c7b2634a4435e65a4d0b06019a73d8389.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Subject: [dm-devel] [PATCH v6 06/20] md: raid5-log: use __bio_add_page to add single page X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com 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); From patchwork Tue May 30 15:49:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260517 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A663C7EE2F for ; Tue, 30 May 2023 15:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461905; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=y/ZUc9kiCfxgP+CAn3UswkNWxS0oS5PgbFi5rsT8+Es=; b=a1vtxelStHyETmD9I1Swv/z/iAaDfuSm7Y94dNb0/ycosG+KJ8/mmwBClo5gPz48VIDhd3 vlW3BzqEFob2+KmBPqYtaXOvdEL16ttQMv9bnkFG3U5XmGmFd5jg3GLc/gn45XMYc1gFnv SkE7BFi5vPc4XmmeMC3KURGHz/6aucs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-604-s4-FnQDZNdWmJS1fDG5SuQ-1; Tue, 30 May 2023 11:51:41 -0400 X-MC-Unique: s4-FnQDZNdWmJS1fDG5SuQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D76E185A792; Tue, 30 May 2023 15:51:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B5B340CFD46; Tue, 30 May 2023 15:51:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A5316193F51D; Tue, 30 May 2023 15:50:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B932C19465A2 for ; Tue, 30 May 2023 15:50:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9CEC3140E958; Tue, 30 May 2023 15:50:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94F42140E956 for ; Tue, 30 May 2023 15:50:00 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 791D1299E75D for ; Tue, 30 May 2023 15:50:00 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-PW0QXhhENFq9qF1TpKq3AA-1; Tue, 30 May 2023 11:49:55 -0400 X-MC-Unique: PW0QXhhENFq9qF1TpKq3AA-1 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231985988" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:53 +0800 IronPort-SDR: YP6HCcVTAqHIOL5TDfFAf984H2pZsQ20o/pmljypqEWqFJVMMUpaZGv+mCX+ONzJcqu7j8nToD l8qq5F4zDQn+cWxbki6EYVN3/ARmGInuHooty/CD0WJ1eqZcUHvJULR4VgGKxwWvL17ao2r4gQ AYyGJSAc2Kfs2eVCP4FvauOQCzUP7DtMRVWvvrZUyKKyaapZNYFR6D6sND3p5iyqqZXaTZVihl XKFcJRyl4jup0wUFLWF8Vo2FR2XcaBxGGcUaE9HOGbF7vWXuOnfGWQ33k/kEy7zDmNbQfaWeXh Tg8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:45 -0700 IronPort-SDR: u+PASvmVFMOeoxAfCOzPTJVxs9w/SxKXdV+WL45zR5MhQmBtIcKpxPC+suAbA8R40WSAoABsDU Savu3CckUXivbi6WToWKdQUwLLmbPrlu+t0D2w2adCHgpIa07VBP9yc9YZfQWP/W4p3Ho8L2TP qdpGq1vryZADT62MQ7QL5o4LjYTKjHlalTuDTjetxk+HbtcWGU7QYi1lbKcIylnIUUvlIOyZMf GU4oqaEupybuJkpumSK7vLspE4ZBbcyj/b78AtZhDrf17exWHWQM4qistlncc13/I/U8bGzbTt Qx0= 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:48 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:10 -0700 Message-Id: <6cdf62501852fa43493ba866a49dfc9e859aa5ee.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Subject: [dm-devel] [PATCH v6 07/20] md: raid5: use __bio_add_page to add single page to new bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The raid5-ppl 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. For adding consecutive pages, the return is actually checked and a new bio is allocated if adding the page fails. 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-ppl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index e495939bb3e0..eaea57aee602 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -465,7 +465,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) bio->bi_end_io = ppl_log_endio; bio->bi_iter.bi_sector = log->next_io_sector; - bio_add_page(bio, io->header_page, PAGE_SIZE, 0); + __bio_add_page(bio, io->header_page, PAGE_SIZE, 0); pr_debug("%s: log->current_io_sector: %llu\n", __func__, (unsigned long long)log->next_io_sector); @@ -496,7 +496,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) prev->bi_opf, GFP_NOIO, &ppl_conf->bs); bio->bi_iter.bi_sector = bio_end_sector(prev); - bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); + __bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0); bio_chain(bio, prev); ppl_submit_iounit_bio(io, prev); From patchwork Tue May 30 15:49:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260519 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D59EC77B73 for ; Tue, 30 May 2023 15:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461934; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eukrDg3tZkwtleciLO1prc1KRN/XuUA5L4G9Y0owrzI=; b=QYnKJP1rslpn+zz83JSH7cHvZO2ncNS8YmGmmbuMg1jjX2nxDDQ6gbE1lWkeAmsm2sD89w Bg8M437+ZyM6keJH+hnFaZX9n6EX1wMDXHS/XcDVADUh1+s5cj272A9JWXpObNDfiJBvZG 5PStO3R6zAgkglcoMdme+hyaRJTOAgY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161-AXut9Fe8OuSGLDXsMv8uxg-1; Tue, 30 May 2023 11:52:12 -0400 X-MC-Unique: AXut9Fe8OuSGLDXsMv8uxg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E341101AA6D; Tue, 30 May 2023 15:52:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A26D200B407; Tue, 30 May 2023 15:52:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 15A3619451D2; Tue, 30 May 2023 15:50:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9861D19465B6 for ; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7588FC0448F; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C81EC154D2 for ; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BB8A1C01505 for ; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-Zuy6Wpu_NVKBa0tGXqOyww-2; Tue, 30 May 2023 11:49:57 -0400 X-MC-Unique: Zuy6Wpu_NVKBa0tGXqOyww-2 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231985991" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:54 +0800 IronPort-SDR: l6oaGFPJMTZ4CIicYHcyZuaAMJyZ/vzVMly//zJbY/oN7T38DWRGJH7s6y5V/bG1OmGxNxS3nS rN5y3Jupb1ZdfMPShRZEiPRC55L7KPo/N3ApI3uS1eRBVq4q/y/YYEtRIx5hkkWsDwpHpvOTeh 0mS1PJSOZwk49Y1ZkU5h5Zsp+wtgQriOwFxttrcV+HfRThp7cZiN15TUK+j8dAT32k4y/nBDCn avL4tsNUynS8/h2vud6yN3HBCPUn/bnB7X5yOO4j4OxI4yWhgZBKSGxFNKwUpgoZRxDqwqtUvx u3w= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:47 -0700 IronPort-SDR: zGTfFG0qpO3ekSs1jkbGf4NhCicS6v3Qh5GV0UwEUz6d58kwkQKUnQDffRvOn1PEv9wQNQpTvS L1oZuq/z0RSqONooE5ZtKTVt8hxkZujCOVwJhVMeym4kHlGOkhBiwzfmYNOjlDQQVkrsyxQ4tH p80L+3HwbQfc7Jh5sAenLjk04IkjBZOWxj0Hrxyd4f/4OoEOyS4v4abehlJeUA1wJ/hSkRbMfX MOJa9T2/0JxEuYE5ao9I9xF38mYJMK2+8AiT0scG/a3lHdVDEa8s97Vq0v8rwx5fkZZoJMlOnW T3A= 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:51 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:11 -0700 Message-Id: <328ebcc2da2307aeb03ce17957a73547c1222e34.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Subject: [dm-devel] [PATCH v6 08/20] jfs: logmgr: use __bio_add_page to add single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Dave Kleikamp , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The JFS IO 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: Dave Kleikamp Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- fs/jfs/jfs_logmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 695415cbfe98..15c645827dec 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1974,7 +1974,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bio = bio_alloc(log->bdev, 1, REQ_OP_READ, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; @@ -2115,7 +2115,7 @@ static void lbmStartIO(struct lbuf * bp) bio = bio_alloc(log->bdev, 1, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS); bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; From patchwork Tue May 30 15:49:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260511 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 546B9C77B73 for ; Tue, 30 May 2023 15:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461873; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qKFZ+7nw2vI6Qt5bhH7VVyQZjYwxrD9pg7s/KewbHb8=; b=fp09ek8xDuYRP/FoqUKo5j90AMhZ1ms868+uTf8o5juWLr31i1hylXqwW5Jj5D5UzqAij6 bTwQqsi2NOGN/ZpztWDG2JAhOYRQLiUnw44tIH9FEMsL8rWkT7SXXt2U/iG75A6pdDOUQS 4AbKurn61wMqnXRNlZODTLLtzyYenD4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-307-S6eeA4DIPmy3os9unp4aow-1; Tue, 30 May 2023 11:51:09 -0400 X-MC-Unique: S6eeA4DIPmy3os9unp4aow-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA4F085A5A8; Tue, 30 May 2023 15:51:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B917AC154D1; Tue, 30 May 2023 15:51:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CD6F19451C1; Tue, 30 May 2023 15:50:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A7A3A19465BA for ; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8BEA42166B28; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83ED62166B25 for ; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64D74811621 for ; Tue, 30 May 2023 15:50:03 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-2mwfD9uiNKyd3P8LIrumhg-3; Tue, 30 May 2023 11:49:59 -0400 X-MC-Unique: 2mwfD9uiNKyd3P8LIrumhg-3 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986002" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:57 +0800 IronPort-SDR: YaSIultwjf3IkfWNTJg2x4xyE02/7ARFa9Q5xkk7wbkO84x6ZXpp7+FdUWHLJWruiONeP6JuL8 QTKTDNN+iXG2hHscFEarBcs6+Vssc8Kf4RO67KqXmqu0HGeLyQLW1pejwPyX0s7xMgO1seeD6z KnDynGvaKWiI5DlxbaF6MN48kGyJA7QfpI2JXkfMX6mRtbRWYaZS865bZt+JtMTDhG6fOCCFrd 3BnJifDR32/7w1rRgCCYpHgIeS6joHCIaCqsL3R0TM1wdgRvaUO37qzR+Tthpag9afbZZ17chL kT8= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:50 -0700 IronPort-SDR: syhtlBwgzrZqo2FxlZ+3+3UNQOSy9KOrXWDC7tRnbhEDdQ7M+iJ8X9kfYPjunQnyzAJ/BUunY7 TJFCtDpOg2F5DZ15LsnpaT3Bwo2hrn6uLSc+fNqG13pjWmrx9wooa6bynhnNQMlDHsy2Hk38NM QrDHnT8XkrjMZUyM4mGcFvGUGlEisF2RVaO8OEk9Qwnu8PpGMQpoWoaS1QquWy7J7yXqddyE5U EJEo3uszMCInYfCLIryejOvT01pFM14+/21EyuCsYg0N/wZvR8GfT4QE1m8ln383WoalorxH4j QYQ= 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:54 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:12 -0700 Message-Id: <15cfecbbac931aa18bfd89cede85bcde1d6edd77.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Subject: [dm-devel] [PATCH v6 09/20] gfs2: use __bio_add_page for adding single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The GFS2 superblock reading 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 Reviewed-by: Andreas Gruenbacher Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 9af9ddb61ca0..cd962985b058 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -254,7 +254,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent) bio = bio_alloc(sb->s_bdev, 1, REQ_OP_READ | REQ_META, GFP_NOFS); bio->bi_iter.bi_sector = sector * (sb->s_blocksize >> 9); - bio_add_page(bio, page, PAGE_SIZE, 0); + __bio_add_page(bio, page, PAGE_SIZE, 0); bio->bi_end_io = end_bio_io_page; bio->bi_private = page; From patchwork Tue May 30 15:49:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260512 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03B88C77B7A for ; Tue, 30 May 2023 15:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461888; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=shDulqELLWrPJoFtWjQAeMSQ98GK9wqdngZic3+RDjI=; b=Vqn3AoZ9Elb1izwznQDGIqOQablCpABHv/FNRRikqz7yXo6Da8HutOye+pKfqQrUViZRUd H2TrLMKLRinv6rH4ztB4UiamqMMKrw6S+ldOj7Sr56udlT5BZk5BHtvPXJWuNP1A2jVd1h jvb6YfJnEjbak4+AenpmC9m1o+4CBKE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-408-UiLDddqLOEWCHhpN1CQr8g-1; Tue, 30 May 2023 11:51:26 -0400 X-MC-Unique: UiLDddqLOEWCHhpN1CQr8g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2ADC03825BA7; Tue, 30 May 2023 15:51:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A5D320296C6; Tue, 30 May 2023 15:51:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4F9D019451DF; Tue, 30 May 2023 15:50:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DB24719465B6 for ; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B271F40CFD46; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB56340CFD45 for ; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90EDF3823A24 for ; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-f3j7VLpIMquWct2msjPeKw-4; Tue, 30 May 2023 11:50:01 -0400 X-MC-Unique: f3j7VLpIMquWct2msjPeKw-4 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986007" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:00 +0800 IronPort-SDR: aLG/zMLRUmV4frTFQN5APqxj8u7jEEltW6SEFuNd6aJTk6pUAZJNy3YBaeiYqMKNqtuCLkmIIM VNN2Hq+5tCd5SmSQkYwmZWOpKn0+6K4Zdtz3F8yOfgVlRkC7qq1Z7fmB6G7JEYMb91IG+Y6Uq2 Y8VxxE7WnC5BUe8gqhYdfZXjyMS49gcPnhIAKdRq/qicDRIRigbX7zTjc+3soyifXaEu0KL6Ai iIkY7i/aufF508IycgrwIsakoW0GYNk6xkejVHBdtVfR1JGbrNR0xbdxAUQj157csCPVNkD4EN OsE= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:53 -0700 IronPort-SDR: ZMHPyde+x3oZg2TtUSRL/5p5WqVr/ZfKqvYwCZxUYP2qYQ91FJJt40KpHRQdugU8uEYsX/I3K/ I9FEFvtZk6Bs4sVviWPES8u2Sy6mkQSXkjcdYwONAcCuJSehDyyyLlFwpmPv+ibIXsEmu0GWG4 2Y8ns+RdUjXQlTNei1wm9AL/aSe4WsIWt+fbIYohfizzZXwI2DiTr8AG9+VlPVIh3eTqf/W2/A sFbZ+/LPFzOwaTFd1WGs1qMqHoly+Y7z8CXi9+Jw0hugo7ke60l0xnB9VSjPDyKn0GdZOBduyf BL8= 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:57 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:13 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Subject: [dm-devel] [PATCH v6 10/20] zonefs: use __bio_add_page for adding single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The zonefs superblock reading 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. Acked-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- fs/zonefs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 23b8b299c64e..9350221abfc5 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -1128,7 +1128,7 @@ static int zonefs_read_super(struct super_block *sb) bio_init(&bio, sb->s_bdev, &bio_vec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = 0; - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); ret = submit_bio_wait(&bio); if (ret) From patchwork Tue May 30 15:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260515 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DE86C7EE2F for ; Tue, 30 May 2023 15:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jwDjA5Pq75EdrNHli4t4OrVDJ2qyxg578GWIt0I7Azw=; b=D7oFI0n10TVYxSbL0FY04zvizMiYecbo07LhI1hMawZvUwyt0sDgh8Hj9tECmwCc5j631U PoOTvTxmDLCpaWaNMK8D0WxQYxQFS9sK9okOgcbSbG56hD0Nb5xBC95T/eAH7R1lKycH9F wAruvfBqSMR9IHBMdH43v4uUiF4fJCw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-376-8X2eEN5iN0WMufhFQk5AiA-1; Tue, 30 May 2023 11:51:31 -0400 X-MC-Unique: 8X2eEN5iN0WMufhFQk5AiA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A41328030CF; Tue, 30 May 2023 15:51:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93A37140E956; Tue, 30 May 2023 15:51:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AB89119451CA; Tue, 30 May 2023 15:50:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 37C0019465A0 for ; Tue, 30 May 2023 15:50:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 19970420A8; Tue, 30 May 2023 15:50:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11EEA17103 for ; Tue, 30 May 2023 15:50:09 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7E328039A7 for ; Tue, 30 May 2023 15:50:08 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-hPxXAT6yOQqWF-Q0VM1UTA-1; Tue, 30 May 2023 11:50:04 -0400 X-MC-Unique: hPxXAT6yOQqWF-Q0VM1UTA-1 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986013" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:03 +0800 IronPort-SDR: lViGYHuDWVLv6UKo06H1EhfEEFhORt2bsfoOuXMe3iaFRtm2VGFVf4WOz72F7A3mIvW+HKbklB ZfX74V/XPnEHxx+//9SDT0TOj/Frav0wGipiu4emwIczi2gkBQh4xaCOLa4qHY+l6N/lxWz+aY 1FNNbzKTmemwcKXEMUV+BaD1bDo2PZZKxbQdwcRs9qTkROo8kKm991vSSGcRX5TzGKqvxM07ka q48z6b4IXZXrfQbdjIVI7UqaXlb6OJ4O/QyOmHQoARaDjzM+k8VKfo2m6ixmQxR26kRCn65K1W jbk= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:56 -0700 IronPort-SDR: uoO7OAb8Rbai8cKgJymQK7W4XKI+NlAnG6HDCi8QqM7mtI6E9SBztbMSPVAHHXkyD5wS0TiagB zwsZz4Lc/J2aZzF+Mlm2SSoQODj2TQmcJ97GwYMdyo0esUPwJRVyQz9paaoxA4nohmqRdWmmxO S250ZL7bmPo0YQ7S943KQRNaXs/Lw2JPLCCx68yUQpjAN3ERvara5+yzICrxbaCvHvUKuOeFn5 WQ2BgTAjgwj+oUkxmFhmgnUej8e/Wo6551HAGEv9hdjrJsbcc4zdEck0heYyMZJ0oinBH2yZjQ tl0= 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:50:00 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:14 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Subject: [dm-devel] [PATCH v6 11/20] zram: use __bio_add_page for adding single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , Sergey Senozhatsky , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The zram writeback 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 Reviewed-by: Sergey Senozhatsky Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index f6d90f1ba5cf..b86691d2133e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -700,7 +700,7 @@ static ssize_t writeback_store(struct device *dev, bio_init(&bio, zram->bdev, &bio_vec, 1, REQ_OP_WRITE | REQ_SYNC); bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); - bio_add_page(&bio, page, PAGE_SIZE, 0); + __bio_add_page(&bio, page, PAGE_SIZE, 0); /* * XXX: A single page IO would be inefficient for write From patchwork Tue May 30 15:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260514 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49060C7EE31 for ; Tue, 30 May 2023 15:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=14vrXOFzq+iR04sSC8jblU8daL7GiQViYFdrX/pSPOw=; b=D5bfvYK/+C22kNHQLCQVnSFQDE9mzBJrT9aCs4wsNdcwVBR1UXJ6jVIeXyRb3jncu87lYH c7Mo9SzQ+jXrHs0v3ZN8uwPtFdc8WcauyVJm5F1UgmyUcOygCPsW8WwDDntw9qt5KX5WDH 2AgwJ+6eAdpx7ei4m3yLpSuJh+ZBWmA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-311-uFmQgIa0ME-TcBu4PbSKcw-1; Tue, 30 May 2023 11:51:31 -0400 X-MC-Unique: uFmQgIa0ME-TcBu4PbSKcw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43DB9858293; Tue, 30 May 2023 15:51:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3304A2029F6D; Tue, 30 May 2023 15:51:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4010719451F6; Tue, 30 May 2023 15:50:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6984819465A0 for ; Tue, 30 May 2023 15:50:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4CD9A140E957; Tue, 30 May 2023 15:50:11 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45131140E956 for ; Tue, 30 May 2023 15:50:11 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 28C151C0150F for ; Tue, 30 May 2023 15:50:11 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-nQVFMzk_OEGiWCxn2-cakA-2; Tue, 30 May 2023 11:50:07 -0400 X-MC-Unique: nQVFMzk_OEGiWCxn2-cakA-2 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986023" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:06 +0800 IronPort-SDR: qpLm0jrsrUaeXjwLR9KD3NCvgFr2HBY99pDG+YAhkV6w+XP6NE1DnucSQDDdwD9hH3vNApKu6o 0SyM3BkkR10xMIfZbsGkWslOuyKsdM+UM5XkTRpU6fsRTJD9q6GWZp2WZjoHPFrbU/TLr+kjjg jTyvVs/nhQ2LctyJK78Rl7FKBK6qMS9dxZ38Q20FxY0GWB/y1Fn980XankgsZZ9cNHG6GD6uav y85ORfAYcCDBlyEQmLrbCKH2cHK8QSJgTPXRwjbKrrBrDkiXfUi0W55+ZMiQMQFmK5XbJJCPCo wSM= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:04:59 -0700 IronPort-SDR: EhH4NXigyhjdlA+o9IGwq9toIdfLXKwjqpigNPLms4HX2ZY0xdq+HGjMqjM/LXPE0H0lh+M4yV XOUH1WqeeUTQLRM43o4YQyLZh/QIjvwzVGZbVmNMXHvT5n2wQIzYOdHngHeSW32GE9fp8AeZ38 O7IBIim14OZkdwKoUagjTCGpbHBhvSrPULKGTbznjjKuwsGFp7K4CnPG+U/LPiXHGWkqFNNUNH jUB2k76eBdmfrU2hEjhb4tbcKZs+3fgO9fPe2xuInJzHIOQ0mXkmAO0bd7p4K36l0YuHQ9uRO9 U7A= 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:50:03 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:15 -0700 Message-Id: <7e817bf13ca47fd863385997c0a9794221df7781.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Subject: [dm-devel] [PATCH v6 12/20] floppy: use __bio_add_page for adding single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The floppy 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 Signed-off-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- drivers/block/floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index cec2c20f5e59..28ec6b442e9c 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4147,7 +4147,7 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) cbdata.drive = drive; bio_init(&bio, bdev, &bio_vec, 1, REQ_OP_READ); - bio_add_page(&bio, page, block_size(bdev), 0); + __bio_add_page(&bio, page, block_size(bdev), 0); bio.bi_iter.bi_sector = 0; bio.bi_flags |= (1 << BIO_QUIET); From patchwork Tue May 30 15:49:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260516 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CF2EC7EE32 for ; Tue, 30 May 2023 15:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461903; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Vl1CXUuG6XM01SActTDc+pzD+18B0mDsn0UIPoZDCpQ=; b=bpocgbOjr8MhmAx49SvmML8GcEhz+K8t1JDL9FAvOX3K5gTwpfeEO8shaAz8fujSTGrTSB RboyVjH3rD+1QeSOJOI77x+jVu0mtmWsmw+BohPHsAbTd7cwfV6QIdUVx3vP1UGPrbB5qW XqmN79gqqGfYZaMvjWReDFF1P5TDK1A= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-138-6PGMQ1MjPdunDfzwGzAbzw-1; Tue, 30 May 2023 11:51:42 -0400 X-MC-Unique: 6PGMQ1MjPdunDfzwGzAbzw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 873F11C09053; Tue, 30 May 2023 15:51:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 725B22166B26; Tue, 30 May 2023 15:51:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 719A719465B2; Tue, 30 May 2023 15:50:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 18C1C1946A41 for ; Tue, 30 May 2023 15:50:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 065C1112132E; Tue, 30 May 2023 15:50:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2E6A112132C for ; Tue, 30 May 2023 15:50:13 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2D7C1C0150F for ; Tue, 30 May 2023 15:50:13 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-OQf3uMGUMOOxCGLOiOmwaQ-3; Tue, 30 May 2023 11:50:10 -0400 X-MC-Unique: OQf3uMGUMOOxCGLOiOmwaQ-3 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986026" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:09 +0800 IronPort-SDR: lNlJXE7pwxIf54LKLnZNV6nUFWgyubk4VcKxL8YjMLswPhDJPsA+r5TLxsJ0JfFvsP83YX2HAZ L1ikjIOViOrewVOkO+t7RX/2ofIuRZ84ZfaFsM5FF3YiKwjHJb42ti0nt6qF18OSAVOwtggZhw 7QAlL9Eqx4DGh3w0GCUnNQOP/vQpPq6oNwG18z+WO+Q2TkW98OzcNFyoj9D4K1ovA2i6xnl3mH KhgJNqFjzNMCSH/b8aPgtPb2rGSZfOT57xFndF2/FH3Ssz2rDnNePJkhquO8KPjkijxuv/avOZ Vzw= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:02 -0700 IronPort-SDR: P8Y6Jd83vQweumNav4silCK78F18+npfP53U6otRJi27bXYVZjQeG19QgfdDPNWr1dSjMk/mR0 TdQwe1yI9lQT8scICxHJ6QWWNvtw6CpvMEfGKX0/h2/HRnwwlFzCTEOhpHvRwXqArmvKCIqw33 ppmdUhNH/kHH580hO75tFT3x/8Uyc3S+cBMv20/BBkhaZLKkAVgh0pxoEQ8eaQU2CR7VRKPGtI xQvmwMzb+rhKJ4KrnyzbkU6q4fYwpSUwIQMfpbXadsUNzjaagJ7+TEz8B0KEm1VNYW+RFH1x1t ltA= 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:50:06 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:16 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Subject: [dm-devel] [PATCH v6 13/20] md: check for failure when adding pages in alloc_behind_master_bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com alloc_behind_master_bio() can possibly add multiple pages to a bio, but it is not checking for the return value of bio_add_page() if adding really succeeded. Check if the page adding succeeded and if not bail out. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn Acked-by: Song Liu Reviewed-by: Christoph Hellwig --- drivers/md/raid1.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 68a9e2d9985b..8283ef177f6c 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1147,7 +1147,10 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, if (unlikely(!page)) goto free_pages; - bio_add_page(behind_bio, page, len, 0); + if (!bio_add_page(behind_bio, page, len, 0)) { + free_page(page); + goto free_pages; + } size -= len; i++; From patchwork Tue May 30 15:49:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260520 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AB70C77B73 for ; Tue, 30 May 2023 15:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461946; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Emfa9vXZ2GCl8FU796CnbYsL7ljJOHmybDIs0meU2Gs=; b=Wm0hvJATCAwCxnriG4YhK2JMCvHXh6KOZe2yuyMStB8A3k5Sa12igk7EtLeV61KRBcWm1a nop7Up9+15rBSssNhQSLinKXkoiaw2nVmA8p0zlXI0DVdhYGGBFHZGMI7qs5qOG/CcWXIX Ce0bKlaVs3BLwCZ280okEH3nHkWPtP0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-258-ShIqSrdrM-Swm8yirMQD7A-1; Tue, 30 May 2023 11:52:22 -0400 X-MC-Unique: ShIqSrdrM-Swm8yirMQD7A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8C5E8032F5; Tue, 30 May 2023 15:52:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D45A52166B26; Tue, 30 May 2023 15:52:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 69F74194E11B; Tue, 30 May 2023 15:50:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9690A19465B7 for ; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7D88840C6EC4; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7650340C6CCC for ; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59D273C11A1F for ; Tue, 30 May 2023 15:50:17 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-F05qfpfkMDy-Qn31BKRlDQ-4; Tue, 30 May 2023 11:50:13 -0400 X-MC-Unique: F05qfpfkMDy-Qn31BKRlDQ-4 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986036" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:12 +0800 IronPort-SDR: 8psBub3QEOQpI72v9CT0zV+oZ2k6hBB+IL+lEo+fQOOqM/xGFUj81Xh1wq8TPkfQ/Y/IblgZoA WNrJGupKs5Y+KMoAkkBVkBAv8xHOB6MPMKkTmiq3K1NRZYFHWWrVbTTO1Hw8eoA1r0R9EvsXfD eZM/W5dUM0O+fkQJ7ZtyQpWa5lpiiUnXguquBdujH/+8ttZTnviW5MhKoWidI2FijKxQjd9DQM eSeyQf6ElqeXiRjkIHlJ7xOlHCj5UuLQH9iOlVHX3q2/OkUofBZR+NOwDYRPEMZDBI61UdkRuX XeY= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:05 -0700 IronPort-SDR: snoYL5vkwQY2fHovd8/bCtXAqv6z6MFk87CGOha3y1t4nQ3bzraGCrnIzedV0/LXm49W2WzhWH OUgIPuepqt5ylCZ0SV/DMCPXbIyw1ZMmkUrTUJnzVN/uHZbS+HyYQMQ7p9zgdDgEpDAO0bKSNQ b9sBV2ZsNYFfhtNaL7pMTYRcvQHa2AW5lh3lf8gZABJoQuBL9ohV1zESC6t075E2qXQDGdMKNU jeEnItThG3PlPxvvohrB/SNHt+pgq8Cps3WQ5E3BrPDTb9RtzCLgejg2k7fg+5N4Buz0u9oIhz Zbw= 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:50:09 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:17 -0700 Message-Id: <05f4a70914885813a2ccdbb8aa7eb7d75f79329a.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Subject: [dm-devel] [PATCH v6 14/20] md: raid1: use __bio_add_page for adding single page to bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com The sync request 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/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 8283ef177f6c..ff89839455ec 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2917,7 +2917,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, * won't fail because the vec table is big * enough to hold all these pages */ - bio_add_page(bio, page, len, 0); + __bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9; From patchwork Tue May 30 15:49:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260523 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71979C77B7A for ; Tue, 30 May 2023 15:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461959; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hdo6+phXs3dL3gYPogQ2mP52x8rNzReMmTryGKuA6LY=; b=HW0wg3yVluooe96V7gmpsAOvE2RNySBxzi6u6P+auTR61b10Y0mglD6ON4YX+i09DfYK28 eLZPfGVjKMkVwUhKvsQjjMHG/AUSa/iIHOBsZIvbEn7tdgqMBkabH5lA+CE+18g2xKnd+2 mt1QzVUPuLsqyuwbMiNlUKtUBTFAjqg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-575-8Oldjc3ZPIGZ10aKV3GMaA-1; Tue, 30 May 2023 11:52:37 -0400 X-MC-Unique: 8Oldjc3ZPIGZ10aKV3GMaA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11D923C11CF6; Tue, 30 May 2023 15:52:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01B8217103; Tue, 30 May 2023 15:52:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1D56D194F256; Tue, 30 May 2023 15:51:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C3EE9193F51D for ; Tue, 30 May 2023 15:50:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B11932166B26; Tue, 30 May 2023 15:50:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A90322166B25 for ; Tue, 30 May 2023 15:50:24 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 86F133C11A2C for ; Tue, 30 May 2023 15:50:24 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-Jjetg8HMNUOtN6dg53zqmg-5; Tue, 30 May 2023 11:50:16 -0400 X-MC-Unique: Jjetg8HMNUOtN6dg53zqmg-5 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986043" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:15 +0800 IronPort-SDR: w2yvAwzkk3nSffqoywfWBAkuTp5heGnw7EArn+HKI20fiMe2js8gWB2s/I6UsvV+pxCoE4Pp7v 30uz3edo1AIb5ta+xk2hAI3zCuhQW1GhLFzlheDPCsFLlWazAXX9yXz1uaxdOPF5xHJHFEymHH Q0RM9ih6VG/ViLrqhVXftuLv+G9/Dqi1HjNpzGYlkEnbqVLqofiaS6sAQVmsmu9dngUd7kueVG z+gqvhahKB8x+/eeXjwCZIojjJen2WvaM7lbOnbN8rpKi7zKhSuVe3UslwgCHqjNyDJvaCscXa VEI= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:08 -0700 IronPort-SDR: 7c9W4va7M7i7mOYdzqZM8x7PuIzd8bUXS81kk72ffccwZ6ZkU4gnwE7FR84LvLjYB86fEAuYwt cXn5GwLOtz5LieaQs84gdIlp6RO2hZOK/Ic6UwD4MNGrVkqvJ5LsygmJvgCDU0mJKU4+2g9Rib NOa0IbGiRr60yWN5pk4jtqYmp4DsQOvrRO9O0wvUsb0lo8oWhw/bmV6Xf7GGSKfY/bdv8SGb7j X21UMdAublIFCrvsHnUfL3ViWaZJVFO/anGXJGxTYW7s2jPCdwz49/iJqACLwkL9I9X1q4xZdH KrA= 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:50:12 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:18 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Subject: [dm-devel] [PATCH v6 15/20] md: raid1: check if adding pages to resync bio fails X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com Check if adding pages to resync bio fails and if bail out. As the comment above suggests this cannot happen, WARN if it actually happens. This way we can mark bio_add_pages as __must_check. Reviewed-by: Damien Le Moal Acked-by: Song Liu Signed-off-by: Johannes Thumshirn --- drivers/md/raid1-10.c | 11 ++++++----- drivers/md/raid10.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index e61f6cad4e08..cd349e69ed77 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -101,11 +101,12 @@ static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pages *rp, struct page *page = resync_fetch_page(rp, idx); int len = min_t(int, size, PAGE_SIZE); - /* - * won't fail because the vec table is big - * enough to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return; + } + size -= len; } while (idx++ < RESYNC_PAGES && size > 0); } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 4fcfcb350d2b..381c21f7fb06 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3819,11 +3819,11 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, for (bio= biolist ; bio ; bio=bio->bi_next) { struct resync_pages *rp = get_resync_pages(bio); page = resync_fetch_page(rp, page_idx); - /* - * won't fail because the vec table is big enough - * to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + goto giveup; + } } nr_sectors += len>>9; sector_nr += len>>9; @@ -4997,11 +4997,11 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, if (len > PAGE_SIZE) len = PAGE_SIZE; for (bio = blist; bio ; bio = bio->bi_next) { - /* - * won't fail because the vec table is big enough - * to hold all these pages - */ - bio_add_page(bio, page, len, 0); + if (WARN_ON(!bio_add_page(bio, page, len, 0))) { + bio->bi_status = BLK_STS_RESOURCE; + bio_endio(bio); + return sectors_done; + } } sector_nr += len >> 9; nr_sectors += len >> 9; From patchwork Tue May 30 15:49:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260518 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8657DC77B73 for ; Tue, 30 May 2023 15:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461925; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LR9YmlQDOHct7MUSOtSjcgJiE3wrzSuEDR5r3xeYqtg=; b=edGZF2tLabahR43OngF3Jv6ld7qwxh6rHGnFMdmmis97L5EhqhdseQsaXVsDl01reeqkwO Ktx5TlTTMYXa8LAic4CTUaS9O4swWK6uZbZ/99H6BhQnh9mHITrjMcBXcIrV68Zp9W6goq aCjIeIIdMLPisFVhF4XDXYtCgVc9OCo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-423-P5qSiXhCMWOxJA8gBM_rPQ-1; Tue, 30 May 2023 11:52:02 -0400 X-MC-Unique: P5qSiXhCMWOxJA8gBM_rPQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 284D63C11CD7; Tue, 30 May 2023 15:52:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17050140E955; Tue, 30 May 2023 15:52:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CC0621946A45; Tue, 30 May 2023 15:50:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 624D919452CA for ; Tue, 30 May 2023 15:50:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 45037140E957; Tue, 30 May 2023 15:50:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BCA9140E955 for ; Tue, 30 May 2023 15:50:23 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F6BD8028B2 for ; Tue, 30 May 2023 15:50:23 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-6BmMRIoiORqt-0BN6faARA-6; Tue, 30 May 2023 11:50:19 -0400 X-MC-Unique: 6BmMRIoiORqt-0BN6faARA-6 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986052" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:18 +0800 IronPort-SDR: DyQu/Bz9itPCoV3gVbQwwXXHyM6CLDT487GpBA3jH0jYeFn1Eh7FvJXJpKdEcJO8xAJHkKuFzf 0rw0vQd10B14M0Mn9oQ8QBxK9rLgcRsOQjFPMmlKEsQEtEO0RoDeeOk/GFyaclh1qAlYhB5tIw XhX1nLxXxRslL5H6h1TcN96vh/bDneidY+9FhsOnAvqSQv+Gyb7y8BYeiKw22SXlsq28APwVgh AZYj9Xvqqifp4Wu/gkitGltfN0keb2Lhoe+CrkgTlKs2yndcSBsaX07AT/0G+jsHC1M4eKTeiv MWQ= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:11 -0700 IronPort-SDR: nWMXgYPXj9My0dJwx11mPIKRe2pSzWz6O3nUVEtHmwd7YXnITNPMVp+01mOZjGN5zhcXbH+IdK m4NVW5MyTKxZspeJpQdq/5lcWtTCTrtHWknfnsfGCvolyx2j0ZqjEnJPHzs6IqRD93mSDPBKaJ W3wnvvvnGzwMhFNe3tC3vpLamIMSeTnweXnIJe6DaIylSDsi76tjZmEcCIggRMz2kCpsmYogzT umSo039ixODhCfl7GjDCN2dVBtWEhKpEVTPbeeTLYiBLVoeQNEC7m5EzM08Q+jnw67MjY23eAu xTo= 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:50:15 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:19 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Subject: [dm-devel] [PATCH v6 16/20] dm-crypt: check if adding pages to clone bio fails X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com Check if adding pages to clone bio fails and if it does retry with reclaim. This mirrors the behaviour of page allocation in crypt_alloc_buffer(). This way we can mark bio_add_pages as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/dm-crypt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 8b47b913ee83..0dd231e61757 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1693,7 +1693,10 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned int size) len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size; - bio_add_page(clone, page, len, 0); + if (!bio_add_page(clone, page, len, 0)) { + WARN_ONCE(1, "Adding page to bio failed\n"); + return NULL; + } remaining_size -= len; } From patchwork Tue May 30 15:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260522 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F286AC7EE2F for ; Tue, 30 May 2023 15:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461957; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9dHo1aIlUECmlg/N8FjOeZJV4FtxQuqD4lo1lNj0gTI=; b=F1UiNSp4k04riFO9MqCN2Zd35WEFdWd7EYWLVUg63GWrud9zEePeiMAhfhvIXwHAKlCnbC 6OkhRsbJspMH+DmWlBJ3spnYeRiKfBfO2S+CW2F+LC8v3vBLfsubpHvu1ttOZHHX0xyOBn bBCBRjbCxYregJEy3LZg6FzutMVejcg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-ObXf7UzkPwmUh6LNCzoS3A-1; Tue, 30 May 2023 11:52:33 -0400 X-MC-Unique: ObXf7UzkPwmUh6LNCzoS3A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C9E88117B4; Tue, 30 May 2023 15:52:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BB1C40C6EC4; Tue, 30 May 2023 15:52:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E987A194E12B; Tue, 30 May 2023 15:51:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BEA76193F504 for ; Tue, 30 May 2023 15:50:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 29430400DFF; Tue, 30 May 2023 15:50:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 212FD492B00 for ; Tue, 30 May 2023 15:50:27 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 00E7C3823A06 for ; Tue, 30 May 2023 15:50:27 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-Gj6Wt562PvWrjjsJ7Lf_cA-7; Tue, 30 May 2023 11:50:22 -0400 X-MC-Unique: Gj6Wt562PvWrjjsJ7Lf_cA-7 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986059" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:21 +0800 IronPort-SDR: DrFX43yeyP6kijsxh94acEueFn46xbmBJ2ANEZaNSKFxw3qs0XDkN0xgw8YlIYm7anwhAUBZrn xmNTW7CawN465xQwwm6XtSuAiBLQFpUXUj7sgb8jNzYPAuvdJTjjdo2HTx0qbOUYd1XZYJRRA4 g8bImzBhHTP4MOkjVhcFnwSKvPrX/Krk3LqMMRlCIIobbn7P41Ou1UdgADBOBInhTxmSx7bhxA olCqJcgCX67/RYSIaBcsi6h8NlIkjW6uTdOExgBaWf0Qx7cqX4+ZTr02eYVcRHxnJCqSb1aT9U NVU= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:14 -0700 IronPort-SDR: eRxexFOpgVAiI/6qc3M2HlLMqG5hyprbnE2P5xkzi3wCU7bzC6rmbI3U41KClPzQrimk3nomV8 vOG7AELmgo3HFPJEeyzLWnnwIz34HEVY8liiQQjfWPND8wASjp6PauRIZ4LoQjvCc69Za4Fbl6 m+vZp4/ReRXC7hP9oNIBNf52TfQ/tdnag2K72W9yus3jFs/hvE58IgRrdFN52PYehAVf60iVrp tQueGHSyM+3hE4aPseYmzkNOHWMUssVoGCGrDEwV68pXp9pAvW+foUD6P2gQQwUQv2prEnyRo8 O5Y= 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:50:18 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:20 -0700 Message-Id: <7b1df30b0db4cd34a3c9d66c9c126dccaf2eb52f.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Subject: [dm-devel] [PATCH v6 17/20] block: mark bio_add_page as __must_check X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, Song Liu , dm-devel@redhat.com, Christoph Hellwig , Andreas Gruenbacher , Damien Le Moal , Matthew Wilcox , cluster-devel@redhat.com, Chaitanya Kulkarni , Mike Snitzer , Ming Lei , linux-raid@vger.kernel.org, Bob Peterson , Mikulas Patocka , linux-block@vger.kernel.org, Damien Le Moal , gouhao@uniontech.com, linux-mm@kvack.org, Johannes Thumshirn , linux-fsdevel@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com Now that all users of bio_add_page check for the return value, mark bio_add_page as __must_check. Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index b3e7529ff55e..5d5b081ee062 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -465,7 +465,7 @@ extern void bio_uninit(struct bio *); void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); -int bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); +int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); From patchwork Tue May 30 15:49:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260525 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCA11C77B7A for ; Tue, 30 May 2023 15:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461966; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HzijvhLwFSKUXmpMLT5Y7ZRWa94UuoW8Jn29XduYCz0=; b=UMCL/eBZHKbTyDBShIbJLnsLGei/XmXP6nyDBc8PjsxgvYVLXFCyPrL1n0Y+kY2bmeWqku E11jqMUvHFN5rcmfs75RNP1agSxO+PsqhcK8UCC+Y04YT/0R1MzUEyJ6u4ZgHsjGLqHp1q NrGV/L7lNTZwW5n2IY+gQAroqLwvV9A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-47-UX4SJ00mN0y3KhxV4YNKKg-1; Tue, 30 May 2023 11:52:42 -0400 X-MC-Unique: UX4SJ00mN0y3KhxV4YNKKg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 30D3A858F1D; Tue, 30 May 2023 15:52:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2002C40C6EC4; Tue, 30 May 2023 15:52:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8B028194F27F; Tue, 30 May 2023 15:51:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BC90219451F6 for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BBBA01121331; Tue, 30 May 2023 15:50:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4623112132C for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D2E3101B046 for ; Tue, 30 May 2023 15:50:30 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-bOWqzN8KMmmSIThWlmqY9Q-8; Tue, 30 May 2023 11:50:26 -0400 X-MC-Unique: bOWqzN8KMmmSIThWlmqY9Q-8 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986064" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:25 +0800 IronPort-SDR: IvmE9gob1z4R7yfY7cDAuYJNuGfNdR+MzKAlW6btM9ZXwzsM+r465yd580PbbL/URTv1hxnd+W NeoLl9HyXaV1EmGYr4p/3Ra35gJUagoxKC4749gqk+qYwplURTLhXWpSgGVYLFckAHL4Cno68/ pW6ZVQSbE/aoXPx3nmvG5rHyTxXCSSDh2Lm3V3yw9s6RXtI5romnf15kXnktsBSBVYwpKPNxl6 pCbZgyesUAVqmOPTae0dFey7Y0GygeWaH8omAGJ/TUYv84zUP7q2mjwos5fb7DiCKd1t/PH/pj lv4= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:19 -0700 IronPort-SDR: ZseWV5fWdzcZGsBvaK1MnzJbe6LJ/RDHXZo6rvQuZIvPrGhH7sOBfNMut82zppqTmYnoXKTB7z QrMk0hDekgJdL7i7w/cfcGZBQUO8WxGw7qvwaCfyj9g9v8vpCBL79fSHs9c7ocbmkyi+tKeTnl 5yWwIot/krgGKEZrPU2K+W7DW94upy4aq9B0nKyn95xRamrF3GJ6KUciaCyMyK5wqC2s2vs9RF va9UVub6OltLs9qszN3A4HrAJxFVHZVWU6ZfU0MHB8DAntksi1VUcnPRTCZpwc76EDliVEcshA NQc= 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:50:21 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:21 -0700 Message-Id: <5a142a7663a4beb2966d82f25708a9f22316117c.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Subject: [dm-devel] [PATCH v6 18/20] block: add __bio_add_folio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-raid@vger.kernel.org, Damien Le Moal , cluster-devel@redhat.com, Chaitanya Kulkarni , Andreas Gruenbacher , Song Liu , Dave Kleikamp , Johannes Thumshirn , gouhao@uniontech.com, Mike Snitzer , jfs-discussion@lists.sourceforge.net, Matthew Wilcox , Ming Lei , linux-block@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Mikulas Patocka , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Bob Peterson Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle) --- block/bio.c | 8 ++++++++ include/linux/bio.h | 1 + 2 files changed, 9 insertions(+) diff --git a/block/bio.c b/block/bio.c index 043944fd46eb..350c653d4a57 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1138,6 +1138,14 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); +void __bio_add_folio(struct bio *bio, struct folio *folio, size_t len, + size_t off) +{ + WARN_ON_ONCE(len > UINT_MAX); + WARN_ON_ONCE(off > UINT_MAX); + __bio_add_page(bio, &folio->page, len, off); +} + /** * bio_add_folio - Attempt to add part of a folio to a bio. * @bio: BIO to add to. diff --git a/include/linux/bio.h b/include/linux/bio.h index 5d5b081ee062..4232a17e6b10 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -473,6 +473,7 @@ int bio_add_zone_append_page(struct bio *bio, struct page *page, unsigned int len, unsigned int offset); void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); +void __bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter); void __bio_release_pages(struct bio *bio, bool mark_dirty); From patchwork Tue May 30 15:49:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260524 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79C09C7EE2C for ; Tue, 30 May 2023 15:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461960; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Y3gX9sTZI2Ym84nReS7JQL1LUhP3zJr58rVhSE0plRQ=; b=IoJRdAMVb64fDk7elc/eCBePc3F6MGhPLe2w8gHhYCkOwxsqfAnTWadrJ3fMDNXskcBrDg KBZAAT5ySG/+FNZAGW4KUbfGd3e2NgrtMhkcPhuL+PKRyzMKWtkH2fXmc+acdzp1Rxw6yC QhHwt+N5Rg799QGTzocwEHIrg7cjELo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-79-tCWVkorJOwe0im8Ui58-oQ-1; Tue, 30 May 2023 11:52:37 -0400 X-MC-Unique: tCWVkorJOwe0im8Ui58-oQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81E9D802E58; Tue, 30 May 2023 15:52:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DC51C154D1; Tue, 30 May 2023 15:52:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4904719451C1; Tue, 30 May 2023 15:51:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B9F8419451F4 for ; Tue, 30 May 2023 15:50:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7464A40CFD48; Tue, 30 May 2023 15:50:32 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39FDF40CFD45 for ; Tue, 30 May 2023 15:50:32 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 19F663C11A23 for ; Tue, 30 May 2023 15:50:32 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-rzxZ_Ck_M7iDU-giQHct3g-9; Tue, 30 May 2023 11:50:28 -0400 X-MC-Unique: rzxZ_Ck_M7iDU-giQHct3g-9 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986068" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:27 +0800 IronPort-SDR: yEytx95CUCEjBfWcIZgFY1Grpat56WA3hZSaCPs2XQlL/xAi9YwC08QDKOs7nHr8/B2bEZtcvH HfhEHxE7B5y7FQWmmDmp5ofDYsXOWj1iC+sjpjNyIttRdzGMYlXrPzc4r19OxCl4kbQEwhYP3J if97/y6mfvKLDYsB/wsXgvGdc4lPi2PpaBrjP8a8UagyV0Uy7nbHQx1DroYRPq0WeVf8IUSriV 45TKerlB/25uCpCy9z7a5kq9LASL2w+ZIQtXo0kwr2e1DDLWDPjHlwF12uAhifZE5c9dotSpE/ H1M= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:20 -0700 IronPort-SDR: vm077LYPjNAgf5XlpecJ/3icJc5CMvd0lv/Avf1qt9Q/GL6TJkcMXRi6IgIjrnSc7COF5QrvoM rybn4aIsk3ovkS/odxyg0sJi8dTutwPKjZDfzTgOQd2shRAOUl0eyZW+AxMzq0gSSpTLt0zblr UlT5/9heJdPYSEr71OD35L2+mnxp5yfUxAvMikvD+47W4RcDny9nyhyoPmkkZUZCDcFsZlAdtd Z+zkSGqfSgcxDW2nlTOB+X8K7FgyMtw8b3N4WfdZtYRGEapJ7oDAz61v2TGB77bpv7441w8fn/ igk= 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:50:24 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:22 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Subject: [dm-devel] [PATCH v6 19/20] fs: iomap: use __bio_add_folio where possible X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-raid@vger.kernel.org, Damien Le Moal , cluster-devel@redhat.com, Chaitanya Kulkarni , Andreas Gruenbacher , Song Liu , Dave Kleikamp , Johannes Thumshirn , gouhao@uniontech.com, Mike Snitzer , jfs-discussion@lists.sourceforge.net, Matthew Wilcox , Ming Lei , linux-block@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Mikulas Patocka , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Bob Peterson Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com When the iomap buffered-io code can't add a folio to a bio, it allocates a new bio and adds the folio to that one. This is done using bio_add_folio(), but doesn't check for errors. As adding a folio to a newly created bio can't fail, use the newly introduced __bio_add_folio() function. Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 063133ec77f4..42c5fc0ad329 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -312,7 +312,7 @@ static loff_t iomap_readpage_iter(const struct iomap_iter *iter, ctx->bio->bi_opf |= REQ_RAHEAD; ctx->bio->bi_iter.bi_sector = sector; ctx->bio->bi_end_io = iomap_read_end_io; - bio_add_folio(ctx->bio, folio, plen, poff); + __bio_add_folio(ctx->bio, folio, plen, poff); } done: @@ -539,7 +539,7 @@ static int iomap_read_folio_sync(loff_t block_start, struct folio *folio, bio_init(&bio, iomap->bdev, &bvec, 1, REQ_OP_READ); bio.bi_iter.bi_sector = iomap_sector(iomap, block_start); - bio_add_folio(&bio, folio, plen, poff); + __bio_add_folio(&bio, folio, plen, poff); return submit_bio_wait(&bio); } @@ -1582,7 +1582,7 @@ iomap_add_to_ioend(struct inode *inode, loff_t pos, struct folio *folio, if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) { wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio); - bio_add_folio(wpc->ioend->io_bio, folio, len, poff); + __bio_add_folio(wpc->ioend->io_bio, folio, len, poff); } if (iop) From patchwork Tue May 30 15:49:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260521 X-Patchwork-Delegate: snitzer@redhat.com 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55E0BC77B73 for ; Tue, 30 May 2023 15:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685461955; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=E0qjVSGtmAIinjvkz8Fv9xV0cP570Zj1dmCX2tj5jII=; b=KkYu3GLTmsQoGlU8tQXHoA8p2zaVXKM6DxOm9jw1hvlDx8Pmq1xGCDNqtm0sHpNuaXowSK 3tuf93GtVAg9toD68DH0JOlfVNzIUZumhmi00AovY6ErBcfDAcSxWMD3AJ//TD2eXloMkJ /PdN0Wc6cv8CtDpgrOIh6NPJrk61wKU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-uWdFqbICPTOsrfmhWmLD5w-1; Tue, 30 May 2023 11:52:34 -0400 X-MC-Unique: uWdFqbICPTOsrfmhWmLD5w-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E286801182; Tue, 30 May 2023 15:52:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AFFD492B0A; Tue, 30 May 2023 15:52:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C1B0119452D3; Tue, 30 May 2023 15:51:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BC43519451F5 for ; Tue, 30 May 2023 15:50:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B7503112132C; Tue, 30 May 2023 15:50:35 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AFBDB1121333 for ; Tue, 30 May 2023 15:50:35 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96CFF1022F1B for ; Tue, 30 May 2023 15:50:35 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-Dd2J_OiWN5WF-iabPaKCew-1; Tue, 30 May 2023 11:50:31 -0400 X-MC-Unique: Dd2J_OiWN5WF-iabPaKCew-1 X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="231986074" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:50:30 +0800 IronPort-SDR: KYQjAqkO78K4/5NXb+QcGBaiK7d/6F9yL1ubCD+il0ixFwD1KaLFFfTlBSWkteFhoGFktl/iJi /bC+1kO4wV8DSK+/rmdT2ue5AL/ZJC50xQkJ3VJfpE1ckpNs/6tnXRlHN/zjCLJCMzYgBJkOKr QZfDJBHUmAsIr05j+SZ3qCclesw0IAgALQobdGlnJqzyXMP64CgOdEejkKdeycSCfwZNud0DWP /fj9B7kMdof60BZ5/7WderrH9xtdgDmqaTV8C/xgYA/ibxCSpwTeX2o9eXxcvSUiiOwHIVzFqo qlc= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 08:05:23 -0700 IronPort-SDR: bSqBFzv7rrWvPvkE4gwhOHj9e0jpcVXnuD/Kq3xELlTSi+Nq3cUl8HGoaL0rUxB1OR25AAJdei TIPhTBMTndkhO2YNy8PxBhVVLv4Kla8ZXnfIi5I7M3fxa3gTd8oOlhRXj2aVcnNgmc/rxQ3lh0 pt68H/iNv5aYOaAvAaRNX6IexlshH2MNcr7cPmRVBzj+I1Z64b2NARfsMPI8qXzvdg6WEXxV+l Bxa2dMoJnICTi4jECIHCBYec6Uvp0PaRuTsjD5YAUZHSr6x9Mm/SzMBT9zXRe7WaHmXxtQTl7o Jr8= 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:50:27 -0700 From: Johannes Thumshirn To: Jens Axboe Date: Tue, 30 May 2023 08:49:23 -0700 Message-Id: <3d45098a7640897cbace54713efe10d88b74c160.1685461490.git.johannes.thumshirn@wdc.com> In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Subject: [dm-devel] [PATCH v6 20/20] block: mark bio_add_folio as __must_check X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-raid@vger.kernel.org, Damien Le Moal , cluster-devel@redhat.com, Chaitanya Kulkarni , Andreas Gruenbacher , Song Liu , Dave Kleikamp , Johannes Thumshirn , gouhao@uniontech.com, Mike Snitzer , jfs-discussion@lists.sourceforge.net, Matthew Wilcox , Ming Lei , linux-block@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Mikulas Patocka , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Bob Peterson Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: wdc.com Now that all callers of bio_add_folio() check the return value, mark it as __must_check. Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle) --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 4232a17e6b10..fef9f3085a02 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -466,7 +466,7 @@ void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); int __must_check bio_add_page(struct bio *, struct page *, unsigned len, unsigned off); -bool bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); +bool __must_check bio_add_folio(struct bio *, struct folio *, size_t len, size_t off); extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); int bio_add_zone_append_page(struct bio *bio, struct page *page,