From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29119C77B62 for ; Wed, 29 Mar 2023 23:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjC2XdI (ORCPT ); Wed, 29 Mar 2023 19:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjC2XdG (ORCPT ); Wed, 29 Mar 2023 19:33:06 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4EA44C13 for ; Wed, 29 Mar 2023 16:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680132784; x=1711668784; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=APb6MZhJtx+BKA0st8ClsB22pp0y9Pqig7XgT6sLxmI=; b=ZdwYSlptuiiQ9m/XPcu72hjT1HkjkyJO6sAuXBEApjrKviKHBfgedsgK HaUq5j0oujVKNMlVFWcVDw1PqQqmqd3ZIvGAsrTLEN3U3G1F309ADcBrc vF9tk40fN7DQK0xck4VRVOlW1/OR4Fm5SL5udmNAQC4oW/wEyuCQ3GDCq oj55G6QyQhRoG5q83qQO8CTbfwOxhvW/NAwF3+LcVIANWs5iFMPQjCN98 e4CxbLwhbIskb8u58cL68zpt6DnHvgSxLvNNLdpJQ7PJAz6T9btCAKxUe DR+BueXsW9o3343724cswkn84FnVkMHdziGXSOhFC3WRN6vsInoYk7Y3Q Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="331273896" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2023 07:33:00 +0800 IronPort-SDR: ueTj3XO/RxQNYx8pxUEWJUR6Wac8klGEn6tiVFLV3w1bnfRwJ4j5cEAxK8kk3QmhENM2Ro/Sj3 /eVoTtRn0X2ptlPdn2g/EGdut+QGMIvHurXSiZhJ40pTbxhGcsii86AVxeEDK8KoGVYDVqRrJT 2T8FXyz4suDVGGbleezz9QqmDs+d9hOXjPpz8zbzISy/uNxQ+1ZtWwUK0fGu9serGxZ6XKkYLX xl/ennIM0rmPLFoAJN3uZLVcIkyYNvR0RzpNxPyvTBQYRxVc35Ij6iphSdGVfUeUz9xKOSyBkV raI= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 15:43:28 -0700 IronPort-SDR: zWZRmTE5kFcVyTvw7airUaizxhnejxpbhypYMA2WP1/2eCMrYn4I/2K8BIt5s7h6lCxSzEt+e2 ImS4IcKj6EVV/sAmcsLr8gO1R7Wi4XjGzJDk09gfQ23M8j/GO26FM3kfJaKV9m4HxYpGbPYGdq CiXhbULyjy7lbJjAL333973rLycvypl88H3NhXeglXF5fktwbtWCIUQduA5VN33X1CKDOMSC4B UgmWngnmYsHFeEGXOhtT+TXFbH5ZmmPGtZvNkqKWoRRJ3qvEmR3j5twaHbtiVyk5u9HwUD7uq+ CxQ= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 16:33:00 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4Pn2sl5d2Nz1RtVv for ; Wed, 29 Mar 2023 16:32:59 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1680132779; x=1682724780; bh=APb6MZhJtx+BKA0st8ClsB22pp0y9Pqig7X gT6sLxmI=; b=EYPDnYeYBXvIPZU4yIKMtwumuioUV+FfuJ8fPXn7WoGbUKa7gK8 7zyK1PX1ztxSUnflTcanHerZGll9o1DObBU+bLHw03SR356wtqMJKa09n0qcvgMS vZWj5aB/mrLRcKD+ZLaMWZavI1BMEp4d64WqsbKtIuhCcLZQRoyst2pdWD8Q3ya+ ByQ8/RWystsxIVYmNeYNkH7soMStSvU7GBy5Z6O0BckSLdQn+7R88KD6YesLFa8q MYecYOCLxyWkIdz2hhL6x1SyTg5ktN5Fm733y5g6M9KOTaT0AtP36cbIMuLZhZ81 iYFb15wzt+oKQjUeF0cNSTKYAFDWutLqRVQ== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kIzlrgfcHGte for ; Wed, 29 Mar 2023 16:32:59 -0700 (PDT) Received: from [10.225.163.116] (unknown [10.225.163.116]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4Pn2sh28h9z1RtVm; Wed, 29 Mar 2023 16:32:56 -0700 (PDT) Message-ID: <93331778-cc12-5d26-34a5-7cd8834a0309@opensource.wdc.com> Date: Thu, 30 Mar 2023 08:32:55 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 07/19] md: raid5: use __bio_add_page to add single page to new bio Content-Language: en-US To: Johannes Thumshirn , Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , David Sterba , linux-btrfs@vger.kernel.org References: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org On 3/30/23 02:05, Johannes Thumshirn wrote: > 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. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research From mboxrd@z Thu Jan 1 00:00:00 1970 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 3FEB8C74A5B for ; Wed, 29 Mar 2023 23:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680132790; 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=wJq2dITZ/wyIzcfGpzc1P8HO6FGC4i7Lxyl1V7N6VAo=; b=DUUPsGOu7B83rqEBerHMmYtisg4wb75gh51TFIHGjhD1eAnDP9Jex4GX4RQkut62zVwovE iievE9R4ZQ6sLPkJRMDDsba5Z59ARwEmDeV0esbMFIYB5P5NbtuzWjZJfHgy4L66ONjMB+ Fr90Q0SrPses7g0Vx1PpHA0FfYNWzWk= 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-588-8BqEJH2eOXe-ceHenyHGzw-1; Wed, 29 Mar 2023 19:33:07 -0400 X-MC-Unique: 8BqEJH2eOXe-ceHenyHGzw-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 5C8F03C0C8B6; Wed, 29 Mar 2023 23:33:05 +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 4B35D18EC2; Wed, 29 Mar 2023 23:33:05 +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 2D600194658C; Wed, 29 Mar 2023 23:33:05 +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 9EA891946587 for ; Wed, 29 Mar 2023 23:33:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 821F6C15BB8; Wed, 29 Mar 2023 23:33: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 79DF3C15BA0 for ; Wed, 29 Mar 2023 23:33:03 +0000 (UTC) Received: from us-smtp-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 5EC6A1C051A7 for ; Wed, 29 Mar 2023 23:33:03 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-262-z7gEWZxIM9GilkMyQRSu9g-1; Wed, 29 Mar 2023 19:33:01 -0400 X-MC-Unique: z7gEWZxIM9GilkMyQRSu9g-1 X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="225113586" 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 Mar 2023 07:33:00 +0800 IronPort-SDR: 837lw6jN7TQ5vUtCQkleLY+NAjJ0v1+97yWM8tLAe0Q1rp4u22LXnjse5OORRqV53JF6qrpqwO aaaHYiTnaoMV13GOxxMOXEqRz9dhgDllae9AuEXCvKfrpAwvwlfAngr8h9zOBY9KnRC8jnzFZ+ /sHKA0Gnlx6GTMuoKUWYT81pD8+u78RW+a+GJSA7+X61ApcOusfS3dNfDk2m89CiyvFL04nKrJ GciJ9PfDp5St9Uke12PCrAsQSVqbtd/+/7Vi3+5NbUrCDNOy5Uw5ip7vaXosRp5rzjxheBqW5J InU= 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; 29 Mar 2023 15:49:08 -0700 IronPort-SDR: Yc4DxG5l7qP3R2VoPHP5WgbUk28vHzPDVcxjcRYxnq/n7kw8Sj78MUL3OMWO1PXqB4qsjFfHKh 7HNdTtVtw1NewTyJ+4xh69SAI4qJp2lnPk+xITvMltWACgOKqjmjZ6ec5HLCvLhWaDdzKuskd5 lm19rm2lpEpcepgloYt8Gfv0NRN/kkl2sc7+IWiftWiNq1dy5TmeuTlz8CUj8Z4bk9YacNBL/m B05LcXD+eeh3uf8FI+dj7z3sB5pUIv3Q3BdPg+lx3B98TgSarMl3KRP+fxJ/4+CowqViKEVdip A7U= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 16:33:00 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4Pn2sl6Zw3z1RtW1 for ; Wed, 29 Mar 2023 16:32:59 -0700 (PDT) X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HBG966bHJ_w3 for ; Wed, 29 Mar 2023 16:32:59 -0700 (PDT) Received: from [10.225.163.116] (unknown [10.225.163.116]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4Pn2sh28h9z1RtVm; Wed, 29 Mar 2023 16:32:56 -0700 (PDT) Message-ID: <93331778-cc12-5d26-34a5-7cd8834a0309@opensource.wdc.com> Date: Thu, 30 Mar 2023 08:32:55 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 To: Johannes Thumshirn , Jens Axboe References: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> 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: Re: [dm-devel] [PATCH 07/19] 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: linux-raid@vger.kernel.org, jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Chaitanya Kulkarni , Andreas Gruenbacher , Song Liu , Dave Kleikamp , Mike Snitzer , Matthew Wilcox , Ming Lei , linux-block@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, David Sterba , linux-fsdevel@vger.kernel.org, Christoph Hellwig , linux-btrfs@vger.kernel.org, Bob Peterson 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: opensource.wdc.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 3/30/23 02:05, Johannes Thumshirn wrote: > 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. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Le Moal Date: Thu, 30 Mar 2023 08:32:55 +0900 Subject: [Cluster-devel] [PATCH 07/19] md: raid5: use __bio_add_page to add single page to new bio In-Reply-To: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> References: <7ba6247aa9f7a7d6f73361386cc7df5395436c33.1680108414.git.johannes.thumshirn@wdc.com> Message-ID: <93331778-cc12-5d26-34a5-7cd8834a0309@opensource.wdc.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 3/30/23 02:05, Johannes Thumshirn wrote: > 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. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal -- Damien Le Moal Western Digital Research