From patchwork Wed Jul 13 05:53:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12920440 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 aib29ajc244.phx1.oracleemaildelivery.com (aib29ajc244.phx1.oracleemaildelivery.com [192.29.103.244]) (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 F41B9C433EF for ; Sun, 17 Jul 2022 06:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=QculGYWjgrA0oD1D86VJ57Tc5VfpO5FG+56h28mys9g=; b=h+rfPugmHjguDcSad0qc/dTbn45zPVa1EDYNZ3gJye81n1p536lWVqz3wFbgj3/AUTK+RVTxH0pH /5OMK0QyupypLQS9Z4smjPk0vDpKXuYNWIwdwoRSAYMEezIZm/XQQXNNH+PAQZx+kg8SQqVDnJgw ylVcaApghXx50wU0sj9kP/rK5chtakfl1yZzshcCSNCOk5aFJPaG1wihVm5FAX4F4GG/5t1uP7UY vYxHFyR4yFaRiam25Auj2lEOk/XknaoS4nlBMvhI38ZHeCVWtb7/Q3rwVTZRpELQRYGXGbYAXFDs NItem0shlBlMoDWBGoi2JQ0V8eFKrOTiLmvxZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=QculGYWjgrA0oD1D86VJ57Tc5VfpO5FG+56h28mys9g=; b=RpYfRk63k2wrgqs2d8Bx/uzrWQf7jJ/QDDNdB+mtvsSI58TwZivt+NwqZaBlNpLFWQad1yt7ZneQ acp4Ro9YB5fL4OtaAfD86/3gw4WabDfOEQKuFEHZv9tR/gsE++wxM16TmwfXJIQxV1rTUJD1h5f5 4WqwYzYk1k80lYqB2cRLyhW/qDdO7Kj5KIKDEvAmZf3g6d0Ky35PyIthFGnayeDeEZvmZ6sCYoUP 8tjw+Q7G0+MRFb00/ajfnKRQLmibGv2NQ6u0vOLP4fSYMBOiESXxsGmaim8TVuaNL3kKlxP35y9+ ZbE3pP6Mmzpj4H45cF7QzNkC1R+kQrIYoL6UnA== Received: by omta-ad1-fd1-101-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0RF5008API7JYMD0@omta-ad1-fd1-101-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Sun, 17 Jul 2022 06:04:31 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Y2m5n2ywVdorzEoaFVlEdw3M6b4Binlg2HpluXfaIZg=; b=aY8PUpMOr3XL4OGdcJC3oZLePj U2Fpy5CT1WtNvKl+Uh2jm9+2lBXEu/Jso/1cholqbux8jzHP3uQ/4/wImvAQ3GuR2SrEuZ/gSB7He 57CgDQLolbdY00Dzuwwr2vNEIgrxp2tIoBknZFSKaduvhaGj1E1fBPc/THzPcVj1eroIl7hMQUprV /QynO1qrDenogR8CfOhS4ukxm0TgzTd0/AGa4IQnrUaIWlT77XHIsNONx0aYZP5hsMoueapQNk0Nw RtbEUPKVuSWup65o3wgXLZUx7fXmOIh7e5sk0ewAprdrhvV1K3tdjHdt7+zkT4HxaLTkBXvHvlDwz OM73TuRg==; To: Jens Axboe Date: Wed, 13 Jul 2022 07:53:09 +0200 Message-id: <20220713055317.1888500-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220713055317.1888500-1-hch@lst.de> References: <20220713055317.1888500-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10406 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=0 bulkscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=754 clxscore=261 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207130023 Cc: linux-block@vger.kernel.org, Theodore Ts'o , Song Liu , linux-raid@vger.kernel.org, =?utf-8?q?Christoph?= =?utf-8?q?_B=C3=B6hmwalder?= , Andreas Dilger , Jan Kara , "Md. Haris Iqbal" , linux-ext4@vger.kernel.org, Jack Wang , ocfs2-devel@oss.oracle.com, drbd-dev@lists.linbit.com Subject: [Ocfs2-devel] [PATCH 1/9] block: stop using bdevname in bdev_write_inode X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: VMqovft5xalv0vgbpf4Efg3pOaNPr_wI X-Proofpoint-ORIG-GUID: VMqovft5xalv0vgbpf4Efg3pOaNPr_wI Reporting-Meta: AAHG2OIcrTOvhs1/r4+57cjR35GE1gTzwJgFiLyXAnTpdbkvXd/NO1Yl0PraHipS SObDWZQNXgjAOipD8eYl3aIe28fKxa1EqE9K52vSruCqAvhYUqIUBQ00lAcmZHci 319rtntHFB4tfr7uH2CTsobObC4TE4u3SASYW2b8DWoowXo/OgxsnbDf3hoQsvAs uLVdPVKOu9JVZ/p3Q+QAZm1DvhorvS6miFKOKLi422GTSBKqto2tx7BkFcm9gKTN U2+9OgTikEIfpr4lWzP3bR8aF6x5g9imt1egJw4Mb5VbyMiAD81/EmJzisRaLlAq 57OYjw9XYicGmvvdfIKmXupLOkUHFNo+/vkDaNV1hNOSoeTYIov3PPuP73MqHXlW XL0UxtfmFbe4EcprGKveVEdgHVvJuMsdcoIyQWy4ZhGW+9O7cLQ8Yz9tyvjG/u9S v7EtNJQJN8lkW/Jk/xfik18h6kmc6FBPdyJ59H23yep9cKheoFoYrlXhlRptd18K KHPC/k9l6L3tSiV9oRa7jhepvIfvyjW6sv3/sAyNqfzX Just use the %pg format specifier instead. Also reformat the printk statement to be more readable. Signed-off-by: Christoph Hellwig --- block/bdev.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/bdev.c b/block/bdev.c index 5fe06c1f2def4..ce05175e71cea 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -54,12 +54,10 @@ static void bdev_write_inode(struct block_device *bdev) while (inode->i_state & I_DIRTY) { spin_unlock(&inode->i_lock); ret = write_inode_now(inode, true); - if (ret) { - char name[BDEVNAME_SIZE]; - pr_warn_ratelimited("VFS: Dirty inode writeback failed " - "for block device %s (err=%d).\n", - bdevname(bdev, name), ret); - } + if (ret) + pr_warn_ratelimited( + "VFS: Dirty inode writeback failed for block device %pg (err=%d).\n", + bdev, ret); spin_lock(&inode->i_lock); } spin_unlock(&inode->i_lock); From patchwork Wed Jul 13 05:53:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12916992 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 aib29ajc252.phx1.oracleemaildelivery.com (aib29ajc252.phx1.oracleemaildelivery.com [192.29.103.252]) (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 48C49C433EF for ; Wed, 13 Jul 2022 17:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=cR/a5UzeZDIatNLV/t+yebmFHXMM38TJpdYix15vBbE=; b=qG5f+IVzhpJ4h7HfQJNpKP+g1uRD7lHJp/4x0HZJyURvrQBvxYdD9onygfOlfkaMPyiu+LsK0EET Qp/mJxCNQt/GNPxKJfiS07rHlj0GLIiEDvDPlkokJpaokottL4xVsppHh9gWtCzApnRS1oK1avRF +8BDNbQ6gXlPxdHrHCJsRdmD52mQT/B+va9cWKP+Mnd7i6wFG0St7K6dA5a+h1WXqF90G7c0Rno/ CLLgpirmI6td9YtnBKXFwuYeRO11oYQA33UI4/BrrAvclLYT1+ISsRmHz1PXFS/VkiE+vZB5lcdA PldapTG5dzLbAanHhWPMygD5ANTMfsQneYfkhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=cR/a5UzeZDIatNLV/t+yebmFHXMM38TJpdYix15vBbE=; b=VX2REjMj6ff1cmm+PlHv8HlHXjzgga2jheK72oUceARfhRt2z88EgudCuwrB5LmuLCE3ShL3HsT+ 6n8OYAUMKkiXj8eWUNWiVHm099RKJsIfCzAQw/P5Gy8rhcS3HqsT6U+VCmBj4FuIKaYs/mc5++Ym 1kZeYLvameyPK/rU+bI58aGWtykgxUvDU0xJdunCeRPo06+ES5Ueff9o/VucjxNdVUeIcRVCSLJF zgw3HeIpT50qR+Xxiznxt8Qdynd5UNlIyi0QFcFx5+ktzKYrIe/Y7f+WWO5lmSn3C/O6sFC+xMZJ cEYaOdB686LiaiuP40ylTiRY8+2hxTOtMGtizw== Received: by omta-ad3-fd1-301-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0REY00F39Y13Q7E0@omta-ad3-fd1-301-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Wed, 13 Jul 2022 17:03:03 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=20fYCpa6V6Ap10mEOQh3cL90/z7nSmsIewaP84vytaE=; b=qh0sF5wn2Ta7HQYLFlY/P/Q9Wi DS2ijefXpSBdkMRpGE9Xk4pb6JYtV2a3YEQtifKPjKehtbR6ZvnECB9ae8ReP2XIadd8BoIMUsgwv 8yjoGchrDeEgcwI9LNlYEKD1U6bj16k1Ha8HxlK5UrRBqbSo7xJEYeen35qZ9zzFDFe/jv2yZwMtS hI1ykmF+ndaa1FvAd0SZcSbb7CcwoVicWCK915yEKaJFEgPS7XM+KzrdcPqjCz9HPCJi3u8Hj+RAr M5AVOo+lJIjwhmLkaBi87rz7EH6i8wgeIjc+GTplUECFn0Diq3CizjrqPhTdnsXn1/eCIGeNWVM4u iXwU2e5Q==; To: Jens Axboe Date: Wed, 13 Jul 2022 07:53:11 +0200 Message-id: <20220713055317.1888500-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220713055317.1888500-1-hch@lst.de> References: <20220713055317.1888500-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10406 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 mlxlogscore=669 clxscore=256 lowpriorityscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 priorityscore=0 adultscore=0 mlxscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207130023 Cc: linux-block@vger.kernel.org, Theodore Ts'o , Song Liu , linux-raid@vger.kernel.org, =?utf-8?q?Christoph?= =?utf-8?q?_B=C3=B6hmwalder?= , Andreas Dilger , Jan Kara , "Md. Haris Iqbal" , linux-ext4@vger.kernel.org, Jack Wang , ocfs2-devel@oss.oracle.com, drbd-dev@lists.linbit.com Subject: [Ocfs2-devel] [PATCH 3/9] drbd: stop using bdevname in drbd_report_io_error X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: ce3xlWezBfoPkZAY0czvoczFa44nk9ks X-Proofpoint-ORIG-GUID: ce3xlWezBfoPkZAY0czvoczFa44nk9ks Reporting-Meta: AAFi3VJI9wI72GOSjmUPwJoFdwdV3ps2EUHTyB9mo5BXfV1Td52x7NnPSjQojmKc agnqmx3KHgIYczBJra2ui2xBHlGE5hzPgD4mi5zQqRRFJncEgSIpRJ1ldq8agghE HB7dkN9Bus60N9EFbYohdZasvDMCfIVwaAd7HQpeRINHfkf+TQlvNw80KLTbi+wR 0xFVLfXu+nz6vys8l6CumkpenM0BgBd6SZAqRslqRf+JItPug9PgNjMHbmeGfIn8 DAMJ36ACG5mRNshbAYHxAJpfqoxy7CJAhnyGq/ODKPFFX/y+HtPSf/GoZuDRMGbV 67FJ0c881bCUenWgibsnfx/QTLe24ko73majjKSNQ9/+hCJdmK8SOyC5DXO/G+7x UOR1kun5b6WwpZapM/HdTBJqHa0GB2mqwa4SWtrXAZmcsm8Cgy+ous4wGRNPc73/ ysls25sUx6X3LtIby5gL0JXP9TjfqkkCyJDu/73u+TdZeNbqRugzGQI2fbk6JnzY 5StrEXDuTtQ+3crh/hqBsEsAAAYYHS9tWYzXI28Mb5A= Just use the %pg format specifier instead. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_req.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index e64bcfba30ef3..6d8dd14458c69 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -523,16 +523,14 @@ static void mod_rq_state(struct drbd_request *req, struct bio_and_error *m, static void drbd_report_io_error(struct drbd_device *device, struct drbd_request *req) { - char b[BDEVNAME_SIZE]; - if (!__ratelimit(&drbd_ratelimit_state)) return; - drbd_warn(device, "local %s IO error sector %llu+%u on %s\n", + drbd_warn(device, "local %s IO error sector %llu+%u on %pg\n", (req->rq_state & RQ_WRITE) ? "WRITE" : "READ", (unsigned long long)req->i.sector, req->i.size >> 9, - bdevname(device->ldev->backing_bdev, b)); + device->ldev->backing_bdev); } /* Helper for HANDED_OVER_TO_NETWORK. From patchwork Wed Jul 13 05:53:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12916889 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 aib29ajc250.phx1.oracleemaildelivery.com (aib29ajc250.phx1.oracleemaildelivery.com [192.29.103.250]) (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 34426C433EF for ; Wed, 13 Jul 2022 15:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=2lGNmgXz+F4/9HJC70DGg4P4Fq/gvFTwB9pF5ni9YJ4=; b=ZZrfekP8nhyyQKD9qIv8mwwmqjMV5b+WmqTlDdnLjm7tJ+LaPqJhDHHl2Vc3YJ+W9mGiBS7Kim6H cR27d4La3avvoBc31YSc8MG0LAf4c3S1tq1NWpzEkXJ+B/Lu+7qd4EHeQh6UN0of9zgEsAQ6IhEM lQehM/S0Dy8Pts0iuIuq4tD9XRIsfXezXn3xGJPajo7s1qhz/E8hjGHEa9f94/By4hTMDp0UmOA8 Z29nyHwmq2zXEOrhgf1H33LjnRh4AsuCzQBH/++0ByCfM6Sn6iN6D07lDv8Rfd1ulpCGBI0Pt3KR sffeL0WacKK72uqXAvun3yxN+UsjQtVGBnrnXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=2lGNmgXz+F4/9HJC70DGg4P4Fq/gvFTwB9pF5ni9YJ4=; b=j+Tq0GbAHd8OSHPzSHYiPcWTdQuASi0kGh3sptQWQF0QJHvdEKwKJ6RMYXAmpRgNfHqmpxinWNLZ 2vkyx7meOyjvMO4tCelIQwORxi5RvExowPXdzPStcP1tAfcSI6WoA6ZFM56O+wH1dTsRTEsgzKd2 wuayw/odUzUch9j0Dldk6QeeRkBp8eZt0HkNXkyNLbMLaRQ+sXqRHDUOICsPCwns+2oU1xYttD88 Zl0yMkeRH8uQAfc1nndKElYUBLoEvwSP0Kq64wB/ek0vFFd5P4y1k/LjK1UFVh2GgJer6ImGb/Y8 c1qi7LhgFV9TPD5eaOzqctnytrVogT7kwUFCIA== Received: by omta-ad2-fd3-201-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0REY00CBDSYPLUE0@omta-ad2-fd3-201-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Wed, 13 Jul 2022 15:13:37 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=oVF8muBFUtxIxMWHnxdNoSfRx8q8DedDPDTnq4wy7CA=; b=MdHLRRAgbOCH6r9SSIyh7sgJY5 T1Gfr+3Gk0ySNEQiUYRfL3WBQhq6b31TOb9e9r39b90ECAT0QBlJKrsFL/omMn+LQXbfMfT4ZL8/H V65/qxfGC1sfiJndzayottsrq2w/DI4ZOHR3UjTWv7gEHh7+ZSqVe7TytGhqbRaStUZC9ZYlALqx7 lVXL8jVVEqleTBzMql1idapQKcnqGoRwgDKZI+aV1ztO2bJXl/4I28HNmt9JW1JAUcheWocyYstB/ nz6ClRZuxPpErxcz3ntiP4NR0F+596gfewyQFWirqW7bk5tF4k37QcqwhAWli8lJB4A4ksPftKtko WsPXawgA==; To: Jens Axboe Date: Wed, 13 Jul 2022 07:53:13 +0200 Message-id: <20220713055317.1888500-6-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220713055317.1888500-1-hch@lst.de> References: <20220713055317.1888500-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10406 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 mlxscore=0 mlxlogscore=789 impostorscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 priorityscore=48 clxscore=262 adultscore=0 spamscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207130024 Cc: linux-block@vger.kernel.org, Theodore Ts'o , Song Liu , linux-raid@vger.kernel.org, =?utf-8?q?Christoph?= =?utf-8?q?_B=C3=B6hmwalder?= , Andreas Dilger , Jan Kara , "Md. Haris Iqbal" , linux-ext4@vger.kernel.org, Jack Wang , ocfs2-devel@oss.oracle.com, drbd-dev@lists.linbit.com Subject: [Ocfs2-devel] [PATCH 5/9] pktcdvd: stop using bdevname in pkt_new_dev X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: fB6EXy8MM5IOOlc1Qsn2hMAv6KtRzp76 X-Proofpoint-ORIG-GUID: fB6EXy8MM5IOOlc1Qsn2hMAv6KtRzp76 Reporting-Meta: AAFSUxiObS6g5VnzfhDeQ/Z6XVJulv+2q1i5iWn/roOpvgehYRWUbd46307KouAe 32iGLqaNAqxnaCWgtnbXRcXzINeN9dCvfMrFxGS3deRiglTMhgSBKquzDMj7oHyo Vrg1yAQsCuOwj2UF6vZl/meN+GsUAmUyLk63+7FZjlONYA2cuO5voSnpkZO9cWgv 37LbL8aeMM9Oqzn0pKT+EhQoL/nu5GieunDkUdnRTcFEYkyX+L9hgLeGMR9auuvo D24yNOPnW7isPkw08deIVpUx78jyAk5dIPCloZHWa8vREF33tk16ZMb7Qdwk1YM+ jNqBD9xKrnZM7uRbUxe2N58OKH/5HCL4F0DfHvP4SDo+LfxCQa0CebodXn6am9bO 4xY78RSHOdmFcjtujkCoYjYHXNh+LlLCEhqlhLHttk7hCO5KIQNSGPhAR5y2lk7S E4ARaF2/XZ/+Ng4CWzMCCHzHo3OjueLgqw0SfDlU5QW1vJ9lfNbEIhPVr4FRhqCJ HViPfq64clF1jUhq6+FAQJd+F6lGav4nzZVOkI/WZQ== Just use the %pg format specifier instead. Signed-off-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a7016ffce9a43..01a15dbd9cde2 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -2519,7 +2519,6 @@ static int pkt_seq_show(struct seq_file *m, void *p) static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) { int i; - char b[BDEVNAME_SIZE]; struct block_device *bdev; struct scsi_device *sdev; @@ -2532,8 +2531,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) if (!pd2) continue; if (pd2->bdev->bd_dev == dev) { - pkt_err(pd, "%s already setup\n", - bdevname(pd2->bdev, b)); + pkt_err(pd, "%pg already setup\n", pd2->bdev); return -EBUSY; } if (pd2->pkt_dev == dev) { @@ -2568,7 +2566,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) } proc_create_single_data(pd->name, 0, pkt_proc, pkt_seq_show, pd); - pkt_dbg(1, pd, "writer mapped to %s\n", bdevname(bdev, b)); + pkt_dbg(1, pd, "writer mapped to %pg\n", bdev); return 0; out_mem: From patchwork Wed Jul 13 05:53:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12918078 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 aib29ajc245.phx1.oracleemaildelivery.com (aib29ajc245.phx1.oracleemaildelivery.com [192.29.103.245]) (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 E8025C43334 for ; Thu, 14 Jul 2022 15:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=uBl+at6Iy6imQ/bIkslkb5t8pkjvCAZJJA5NtfwN2d0=; b=nJ4y+OS6aFT2/Q+h88Hww4VR78ivIlMzFaVN5mpgrrLxSl1urUA6kAU860ExzUpTTyTkAR6R0cf8 J46e6glhzIijXYt0N3qmg4wt1upy0/bNTWb0T0WJ8z7xYvrJQ4ZsSjg01Ks1m3h+JUxDui7ftUe8 PFIUwdSwkn+qCDoH9VEK9/04oL0MrF1Oa24wmXvJ2AbRp1AkbYbxoiL9eyA3T86iPVE0dA3haIG0 MdZbmbGKU6bL2TOZQfvL1Pa/HsTPJU+APdtRnogvSXroIStUIj5w/dGsbiLBjshSHPC688LSzO4W MNxGjmuYcZ0YEV8bX6kL8FHvkdhI2VxCFUkUOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=uBl+at6Iy6imQ/bIkslkb5t8pkjvCAZJJA5NtfwN2d0=; b=G1A89VJRmyGYLl1Z1P+q54r/8/jKJz5uqBbfWDvi4lTNs29Dvox9Z1YK9FCsCnM/fcOh3LA6/Lmp ztcwCtdfuxUJ1glyiQwxmSVBnWxZHXRvRXtn8hFUzpjd/sBT/RryE3MOWFiEeCe90Qmd7i5E8RjS VgP2nyz5aNq5j378YSKqi37vxVjc26oMzt9XpW8lUHhEC4bCgEAlocOt+KR+RAyMNn1U8nZRY7L9 ROPg4qMkcMM+g2Ohbm5V/Ri4iPcGA4G/9ct2IWF5aRfVP0HpihGlyM9kGC14IPMARwhfOGTCm4bh n2uHUhJLiHdKdQy7x5GIXkoIzNWOqMRLopeDOg== Received: by omta-ad1-fd1-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0RF0002GIN9CFD00@omta-ad1-fd1-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 14 Jul 2022 15:05:36 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Y3KJzRLrphaTDn8Wyop5u8huGV0HUKZAMu6CEtRR/Bk=; b=PEJVBI4x3qa0TuZ6BDxyNedRsC 21lm58vzmdgB11esQizXAAiCWwrQFxyGkvNn7RMx/SkFDycJThb61cyZxAaAUGEDdojB4NaeNFknZ wtAhFYALKJ0dT0eAP3uu1+rPEDqqlcqanSiIilvM3eKi/enitEbOctOt05sWF3OrHoeWFiBBdk1Fp oodg1CyjzRY4AARCUaUliopVIt92TUDazeCdMCVgb7x79v0CcqnvoSTIMY1EyAnno/g3PUGExqWRg /AMS9ASCbiyBP8suooRN9mDl3MAHsl+BJZv1Zk09a9FJut6uwN2h9Ia1mrOYimv4J9imOrEocUUAT qXE9OFRA==; To: Jens Axboe Date: Wed, 13 Jul 2022 07:53:15 +0200 Message-id: <20220713055317.1888500-8-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220713055317.1888500-1-hch@lst.de> References: <20220713055317.1888500-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10406 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 bulkscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 impostorscore=0 priorityscore=0 mlxlogscore=999 malwarescore=0 clxscore=256 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207130024 Cc: linux-block@vger.kernel.org, Theodore Ts'o , Song Liu , linux-raid@vger.kernel.org, =?utf-8?q?Christoph?= =?utf-8?q?_B=C3=B6hmwalder?= , Andreas Dilger , Jan Kara , "Md. Haris Iqbal" , linux-ext4@vger.kernel.org, Jack Wang , ocfs2-devel@oss.oracle.com, drbd-dev@lists.linbit.com Subject: [Ocfs2-devel] [PATCH 7/9] ocfs2/cluster: remove the hr_dev_name field from struct o2hb_region X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: wRuLVdy8Vu8vI11ymhLFQiUz97us-aD7 X-Proofpoint-ORIG-GUID: wRuLVdy8Vu8vI11ymhLFQiUz97us-aD7 Reporting-Meta: AAF96d7FwqOPfU3peRtF44vD08EBpGCd2y6P2/YjbqRctvsyrnoOk7bXx/jcr7+8 VqGCNPslBIj6Yn5FEYnl+irfn7av9eISjl1bLhpiaqd2tAmCFMq16a2UbF0tYg31 zrxgOKreO+VxlU3+ZbMmHUvkKhRwysXpVCkejjzJtaZkJSQlj9K9OuJz9x6mBvtb 6TZgQkAJl3iyoWHXcbEkIaCZQIYB3H6SBsOON7gWVTk8DAc+PDEOums/E1Uc/H7i CUx19Gzfq5bZgHu5CVPtcDP+zZ7trV9GaKE0guRoP2ZYtWe+Azx1T9CsG9cFCW98 GHtHN41g3crbw2zZZDxGYzzlC4AqkxjIiBWCeL6ZeYSf69kfhcdUpgD34OBiLphl 9IY0KgvyoQeUtoV5/BNHF59Mp0ogVdDQgfNysNoIvIM69apaVA3v/SyTSoAGLIqP 7dMu+xLvadmGQD2DXt3eTZvCRNZUgXepR8Bgph/5k95QfXEKpb5z34soJsd2vmfc 8oB9TknNgw9dh6fbEDElM3zttcjbY1uZLTRwYrMipzc= Just print the block device name directly using the %pg format specifier. Signed-off-by: Christoph Hellwig --- fs/ocfs2/cluster/heartbeat.c | 64 +++++++++++++++++------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index ea0e70c0fce09..5f83c0c0918c0 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -235,8 +235,6 @@ struct o2hb_region { * (hr_steady_iterations == 0) within hr_unsteady_iterations */ atomic_t hr_unsteady_iterations; - char hr_dev_name[BDEVNAME_SIZE]; - unsigned int hr_timeout_ms; /* randomized as the region goes up and down so that a node @@ -287,8 +285,8 @@ static void o2hb_write_timeout(struct work_struct *work) container_of(work, struct o2hb_region, hr_write_timeout_work.work); - mlog(ML_ERROR, "Heartbeat write timeout to device %s after %u " - "milliseconds\n", reg->hr_dev_name, + mlog(ML_ERROR, "Heartbeat write timeout to device %pg after %u " + "milliseconds\n", reg->hr_bdev, jiffies_to_msecs(jiffies - reg->hr_last_timeout_start)); if (o2hb_global_heartbeat_active()) { @@ -383,9 +381,9 @@ static void o2hb_nego_timeout(struct work_struct *work) if (master_node == o2nm_this_node()) { if (!test_bit(master_node, reg->hr_nego_node_bitmap)) { - printk(KERN_NOTICE "o2hb: node %d hb write hung for %ds on region %s (%s).\n", + printk(KERN_NOTICE "o2hb: node %d hb write hung for %ds on region %s (%pg).\n", o2nm_this_node(), O2HB_NEGO_TIMEOUT_MS/1000, - config_item_name(®->hr_item), reg->hr_dev_name); + config_item_name(®->hr_item), reg->hr_bdev); set_bit(master_node, reg->hr_nego_node_bitmap); } if (memcmp(reg->hr_nego_node_bitmap, live_node_bitmap, @@ -399,8 +397,8 @@ static void o2hb_nego_timeout(struct work_struct *work) return; } - printk(KERN_NOTICE "o2hb: all nodes hb write hung, maybe region %s (%s) is down.\n", - config_item_name(®->hr_item), reg->hr_dev_name); + printk(KERN_NOTICE "o2hb: all nodes hb write hung, maybe region %s (%pg) is down.\n", + config_item_name(®->hr_item), reg->hr_bdev); /* approve negotiate timeout request. */ o2hb_arm_timeout(reg); @@ -419,9 +417,9 @@ static void o2hb_nego_timeout(struct work_struct *work) } } else { /* negotiate timeout with master node. */ - printk(KERN_NOTICE "o2hb: node %d hb write hung for %ds on region %s (%s), negotiate timeout with node %d.\n", + printk(KERN_NOTICE "o2hb: node %d hb write hung for %ds on region %s (%pg), negotiate timeout with node %d.\n", o2nm_this_node(), O2HB_NEGO_TIMEOUT_MS/1000, config_item_name(®->hr_item), - reg->hr_dev_name, master_node); + reg->hr_bdev, master_node); ret = o2hb_send_nego_msg(reg->hr_key, O2HB_NEGO_TIMEOUT_MSG, master_node); if (ret) @@ -437,8 +435,8 @@ static int o2hb_nego_timeout_handler(struct o2net_msg *msg, u32 len, void *data, struct o2hb_nego_msg *nego_msg; nego_msg = (struct o2hb_nego_msg *)msg->buf; - printk(KERN_NOTICE "o2hb: receive negotiate timeout message from node %d on region %s (%s).\n", - nego_msg->node_num, config_item_name(®->hr_item), reg->hr_dev_name); + printk(KERN_NOTICE "o2hb: receive negotiate timeout message from node %d on region %s (%pg).\n", + nego_msg->node_num, config_item_name(®->hr_item), reg->hr_bdev); if (nego_msg->node_num < O2NM_MAX_NODES) set_bit(nego_msg->node_num, reg->hr_nego_node_bitmap); else @@ -452,8 +450,8 @@ static int o2hb_nego_approve_handler(struct o2net_msg *msg, u32 len, void *data, { struct o2hb_region *reg = data; - printk(KERN_NOTICE "o2hb: negotiate timeout approved by master node on region %s (%s).\n", - config_item_name(®->hr_item), reg->hr_dev_name); + printk(KERN_NOTICE "o2hb: negotiate timeout approved by master node on region %s (%pg).\n", + config_item_name(®->hr_item), reg->hr_bdev); o2hb_arm_timeout(reg); return 0; } @@ -689,8 +687,8 @@ static int o2hb_check_own_slot(struct o2hb_region *reg) else errstr = ERRSTR3; - mlog(ML_ERROR, "%s (%s): expected(%u:0x%llx, 0x%llx), " - "ondisk(%u:0x%llx, 0x%llx)\n", errstr, reg->hr_dev_name, + mlog(ML_ERROR, "%s (%pg): expected(%u:0x%llx, 0x%llx), " + "ondisk(%u:0x%llx, 0x%llx)\n", errstr, reg->hr_bdev, slot->ds_node_num, (unsigned long long)slot->ds_last_generation, (unsigned long long)slot->ds_last_time, hb_block->hb_node, (unsigned long long)le64_to_cpu(hb_block->hb_generation), @@ -863,8 +861,8 @@ static void o2hb_set_quorum_device(struct o2hb_region *reg) sizeof(o2hb_live_node_bitmap))) goto unlock; - printk(KERN_NOTICE "o2hb: Region %s (%s) is now a quorum device\n", - config_item_name(®->hr_item), reg->hr_dev_name); + printk(KERN_NOTICE "o2hb: Region %s (%pg) is now a quorum device\n", + config_item_name(®->hr_item), reg->hr_bdev); set_bit(reg->hr_region_num, o2hb_quorum_region_bitmap); @@ -922,8 +920,8 @@ static int o2hb_check_slot(struct o2hb_region *reg, /* The node is live but pushed out a bad crc. We * consider it a transient miss but don't populate any * other values as they may be junk. */ - mlog(ML_ERROR, "Node %d has written a bad crc to %s\n", - slot->ds_node_num, reg->hr_dev_name); + mlog(ML_ERROR, "Node %d has written a bad crc to %pg\n", + slot->ds_node_num, reg->hr_bdev); o2hb_dump_slot(hb_block); slot->ds_equal_samples++; @@ -1002,11 +1000,11 @@ static int o2hb_check_slot(struct o2hb_region *reg, slot_dead_ms = le32_to_cpu(hb_block->hb_dead_ms); if (slot_dead_ms && slot_dead_ms != dead_ms) { /* TODO: Perhaps we can fail the region here. */ - mlog(ML_ERROR, "Node %d on device %s has a dead count " + mlog(ML_ERROR, "Node %d on device %pg has a dead count " "of %u ms, but our count is %u ms.\n" "Please double check your configuration values " "for 'O2CB_HEARTBEAT_THRESHOLD'\n", - slot->ds_node_num, reg->hr_dev_name, slot_dead_ms, + slot->ds_node_num, reg->hr_bdev, slot_dead_ms, dead_ms); } goto out; @@ -1145,8 +1143,8 @@ static int o2hb_do_disk_heartbeat(struct o2hb_region *reg) /* Do not re-arm the write timeout on I/O error - we * can't be sure that the new block ever made it to * disk */ - mlog(ML_ERROR, "Write error %d on device \"%s\"\n", - write_wc.wc_error, reg->hr_dev_name); + mlog(ML_ERROR, "Write error %d on device \"%pg\"\n", + write_wc.wc_error, reg->hr_bdev); ret = write_wc.wc_error; goto bail; } @@ -1170,9 +1168,9 @@ static int o2hb_do_disk_heartbeat(struct o2hb_region *reg) if (atomic_read(®->hr_steady_iterations) != 0) { if (atomic_dec_and_test(®->hr_unsteady_iterations)) { printk(KERN_NOTICE "o2hb: Unable to stabilize " - "heartbeat on region %s (%s)\n", + "heartbeat on region %s (%pg)\n", config_item_name(®->hr_item), - reg->hr_dev_name); + reg->hr_bdev); atomic_set(®->hr_steady_iterations, 0); reg->hr_aborted_start = 1; wake_up(&o2hb_steady_queue); @@ -1494,7 +1492,7 @@ static void o2hb_region_release(struct config_item *item) struct page *page; struct o2hb_region *reg = to_o2hb_region(item); - mlog(ML_HEARTBEAT, "hb region release (%s)\n", reg->hr_dev_name); + mlog(ML_HEARTBEAT, "hb region release (%pg)\n", reg->hr_bdev); kfree(reg->hr_tmp_block); @@ -1641,7 +1639,7 @@ static ssize_t o2hb_region_dev_show(struct config_item *item, char *page) unsigned int ret = 0; if (to_o2hb_region(item)->hr_bdev) - ret = sprintf(page, "%s\n", to_o2hb_region(item)->hr_dev_name); + ret = sprintf(page, "%pg\n", to_o2hb_region(item)->hr_bdev); return ret; } @@ -1798,8 +1796,6 @@ static ssize_t o2hb_region_dev_store(struct config_item *item, goto out2; } - bdevname(reg->hr_bdev, reg->hr_dev_name); - sectsize = bdev_logical_block_size(reg->hr_bdev); if (sectsize != reg->hr_block_bytes) { mlog(ML_ERROR, @@ -1895,8 +1891,8 @@ static ssize_t o2hb_region_dev_store(struct config_item *item, ret = -EIO; if (hb_task && o2hb_global_heartbeat_active()) - printk(KERN_NOTICE "o2hb: Heartbeat started on region %s (%s)\n", - config_item_name(®->hr_item), reg->hr_dev_name); + printk(KERN_NOTICE "o2hb: Heartbeat started on region %s (%pg)\n", + config_item_name(®->hr_item), reg->hr_bdev); out3: if (ret < 0) { @@ -2088,10 +2084,10 @@ static void o2hb_heartbeat_group_drop_item(struct config_group *group, quorum_region = 1; clear_bit(reg->hr_region_num, o2hb_quorum_region_bitmap); spin_unlock(&o2hb_live_lock); - printk(KERN_NOTICE "o2hb: Heartbeat %s on region %s (%s)\n", + printk(KERN_NOTICE "o2hb: Heartbeat %s on region %s (%pg)\n", ((atomic_read(®->hr_steady_iterations) == 0) ? "stopped" : "start aborted"), config_item_name(item), - reg->hr_dev_name); + reg->hr_bdev); } /* From patchwork Wed Jul 13 05:53:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12918079 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 aib29ajc245.phx1.oracleemaildelivery.com (aib29ajc245.phx1.oracleemaildelivery.com [192.29.103.245]) (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 A711DC43334 for ; Thu, 14 Jul 2022 15:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=GRwzQNSKJ2S7hfeXv4sBXOVJ0TcZaPNpquTka6yMTL8=; b=PkQCkmiPqEwL9DxlnKrY/cwrfZRzv/Gn9b7qvfpmOrlS4FdrLpiGgM42UWxD/+PVLXsVUo2t9gtN Kw0nq2ru7hijJJRNHKDGwLs5a5T6pLWEqBBdEYQP5bLN2Tzn3z4eUY0hiGIMg8kNc3qadKjnzEcS Y6vDNGw17lsFrgiG1N+l/56Bw2T5e+PSBbkPNOL96Tq/BOXA81Xl5hLBAvn9qd2jpTMRkxuwxRaV nmFTF4VaCSk/DirQBo2r87A0xouA4PhxUkfg8XljxK04EavX3zdp7DJohd73ppJ9Spx6wHonwkMw nQoHqDHhaYUxYKvce2GQUJpP4LWZqkq6C7wRFg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=GRwzQNSKJ2S7hfeXv4sBXOVJ0TcZaPNpquTka6yMTL8=; b=j7Ei9i2fMWCpQqI67ESBHCZw6MLrRAqXPQGsuAF/yUTeSxUM0q8hCUnjZFn86sx38X53S7IN8eZd jMxVfAPXiV56J4ERFLP1QCcv6Aq+mPmIJEna2zoSmtOf2vN++oGPwLIjik+YdgDzZebbW1ZqJcuK rGtpb41V+Rbgz2/PIXSBzb93OHXWN3XTeV2+r5l7l3p9YAV4vLKls93/XjzjFwkusbWghltsgeqv uc1ef2oMGfLUCQx/O8ZHMcy3PNSQ6hb3SI17GpLJpMMxQBbvjHWsACkb1wmE7Zk+o2uJrdxZLXyS bQ1enDjioCLtyj/FbJN6pybIaxwtEo/73PoGqw== Received: by omta-ad1-fd1-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220603 64bit (built Jun 3 2022)) with ESMTPS id <0RF0002IQN9PFD00@omta-ad1-fd1-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 14 Jul 2022 15:05:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=bjngWu2+fy+EhLHzFfowceaR1j/UA31xrrxHhRbbPPo=; b=eK7l6IZou/+UiLWuRhRJW2kUNF RpfKvThqfwsyR+cMUx8PBvIbgU01gZ0oWI9XpdINo2jgH3dSHI1lEPGQmlTEgoPYTMOYbr16595A3 MFz2oVSMmjvNoyPs1BGlO4XvDNzM48KTWLf3Bq7fJFTwhw+/LCG88jGR8AtzHLYtERIhWYGenwnL/ 6CU15IsolJQgPTYsk278i56pFs5cTzgQETWdjwZTez1Gqm8nU+YCZmIAsZ63Vidzj/Gu7//ryo9h9 9He+NBNWjW6V4elzAZic6h5Ntm+w7m8ATCSfAU2++U3Wc9+GDrzV9dI6n3kVsckgX5IOjbRGaLv3F fjyauc/Q==; To: Jens Axboe Date: Wed, 13 Jul 2022 07:53:16 +0200 Message-id: <20220713055317.1888500-9-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220713055317.1888500-1-hch@lst.de> References: <20220713055317.1888500-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6400 definitions=10406 signatures=596000 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 lowpriorityscore=0 adultscore=0 impostorscore=0 malwarescore=0 priorityscore=30 bulkscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 clxscore=262 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207130024 Cc: linux-block@vger.kernel.org, Theodore Ts'o , Song Liu , linux-raid@vger.kernel.org, =?utf-8?q?Christoph?= =?utf-8?q?_B=C3=B6hmwalder?= , Andreas Dilger , Jan Kara , "Md. Haris Iqbal" , linux-ext4@vger.kernel.org, Jack Wang , ocfs2-devel@oss.oracle.com, drbd-dev@lists.linbit.com Subject: [Ocfs2-devel] [PATCH 8/9] ext4: only initialize mmp_bdevname once X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: ngij6J2mVMO7A1R7FspP0F7WN_VpEMlr X-Proofpoint-ORIG-GUID: ngij6J2mVMO7A1R7FspP0F7WN_VpEMlr Reporting-Meta: AAE92KhnYkrtn1tIl4h/wpNlo0cE+LLXfe7vfpR+76lb0uP/BPvPiYTwXBMv4HFA EzO+kTB+94/Al5N6H4nTVZUHXmgoEbJ4JwlnxL5vHsMepLA587mB9JJ7ryT88Vxp Hswvxx0xBMLvI/JzFLTdPU7zVNOFUqGSQ8QHGLOifCiWogjIoZDDfAcDPx2JC19l yxeh5/3Fbjpoxf4CcTaem6KnkuQ8Ey61PQtcGk+ydvxN0XVtwvCse2gVLvg+kpQQ Gnbm0/ttq8HmMt5y6lPrtiUykemHPHm8vwxE2/4ro67OLZoRSjZ3gvyGqt2xlidi r4xCtj3m8bqpFWrH0RxBcuRmDlbTn3jDRGkCikZ1BRgD+tgmhr8ym6Fsa/zavVOr NNKBJT1lUAruQ0vkcTIvHMURdD11OC/SgkQbUE5VjSYJduxwatG8sjDOFPRTvp0S euRtrNPGBSlAlA7CZ2d8SXVQdRtYuL66YtqXGTxIpRH0G7FtYL/PRPwLD9c9g4nt 8sfVdXUQdMR0XSBaBij8uyZEOWBKkeM2KGl/4uUzoU29 mmp_bdevname is currently both initialized nested inside the kthread_run call in ext4_multi_mount_protect and in the kmmpd thread started by it. Lift the initiaization out of the kthread_run call in ext4_multi_mount_protect, move the BUILD_BUG_ON next to it and remove the duplicate assignment inside of kmmpd. Signed-off-by: Christoph Hellwig --- fs/ext4/mmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 79d05e464c432..b7a850b0070b8 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -150,8 +150,6 @@ static int kmmpd(void *data) mmp_check_interval = max(EXT4_MMP_CHECK_MULT * mmp_update_interval, EXT4_MMP_MIN_CHECK_INTERVAL); mmp->mmp_check_interval = cpu_to_le16(mmp_check_interval); - BUILD_BUG_ON(sizeof(mmp->mmp_bdevname) < BDEVNAME_SIZE); - bdevname(bh->b_bdev, mmp->mmp_bdevname); memcpy(mmp->mmp_nodename, init_utsname()->nodename, sizeof(mmp->mmp_nodename)); @@ -372,13 +370,15 @@ int ext4_multi_mount_protect(struct super_block *sb, EXT4_SB(sb)->s_mmp_bh = bh; + BUILD_BUG_ON(sizeof(mmp->mmp_bdevname) < BDEVNAME_SIZE); + bdevname(bh->b_bdev, mmp->mmp_bdevname); + /* * Start a kernel thread to update the MMP block periodically. */ EXT4_SB(sb)->s_mmp_tsk = kthread_run(kmmpd, sb, "kmmpd-%.*s", (int)sizeof(mmp->mmp_bdevname), - bdevname(bh->b_bdev, - mmp->mmp_bdevname)); + mmp->mmp_bdevname); if (IS_ERR(EXT4_SB(sb)->s_mmp_tsk)) { EXT4_SB(sb)->s_mmp_tsk = NULL; ext4_warning(sb, "Unable to create kmmpd thread for %s.",