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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C579BC64E90 for ; Thu, 26 Nov 2020 17:01:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 748D02145D for ; Thu, 26 Nov 2020 17:01:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 748D02145D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ED0AD6B0074; Thu, 26 Nov 2020 12:01:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E7E296B0075; Thu, 26 Nov 2020 12:01:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1F116B0078; Thu, 26 Nov 2020 12:01:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0083.hostedemail.com [216.40.44.83]) by kanga.kvack.org (Postfix) with ESMTP id B931D6B0074 for ; Thu, 26 Nov 2020 12:01:32 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7EBF4180AD804 for ; Thu, 26 Nov 2020 17:01:32 +0000 (UTC) X-FDA: 77527185624.14.shoe64_200300a27381 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 0C1891822987B for ; Thu, 26 Nov 2020 17:01:32 +0000 (UTC) X-HE-Tag: shoe64_200300a27381 X-Filterd-Recvd-Size: 4187 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Nov 2020 17:01:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A8F99ACC4; Thu, 26 Nov 2020 17:01:29 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7DBAB1E10D0; Thu, 26 Nov 2020 18:01:29 +0100 (CET) Date: Thu, 26 Nov 2020 18:01:29 +0100 From: Jan Kara To: Christoph Hellwig Cc: Jens Axboe , Tejun Heo , Josef Bacik , Coly Li , Mike Snitzer , Greg Kroah-Hartman , Jan Kara , Johannes Thumshirn , dm-devel@redhat.com, Jan Kara , linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 34/44] block: move make_it_fail to struct block_device Message-ID: <20201126170129.GT422@quack2.suse.cz> References: <20201126130422.92945-1-hch@lst.de> <20201126130422.92945-35-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126130422.92945-35-hch@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu 26-11-20 14:04:12, Christoph Hellwig wrote: > Move the make_it_fail flag to struct block_device an turn it into a bool > in preparation of killing struct hd_struct. > > Signed-off-by: Christoph Hellwig Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > block/blk-core.c | 3 ++- > block/genhd.c | 4 ++-- > include/linux/blk_types.h | 3 +++ > include/linux/genhd.h | 3 --- > 4 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 9a3793d5ce38d4..9121390be97a76 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -668,7 +668,8 @@ __setup("fail_make_request=", setup_fail_make_request); > > static bool should_fail_request(struct hd_struct *part, unsigned int bytes) > { > - return part->make_it_fail && should_fail(&fail_make_request, bytes); > + return part->bdev->bd_make_it_fail && > + should_fail(&fail_make_request, bytes); > } > > static int __init fail_make_request_debugfs(void) > diff --git a/block/genhd.c b/block/genhd.c > index a964e7532fedd5..0371558ccde14c 100644 > --- a/block/genhd.c > +++ b/block/genhd.c > @@ -1284,7 +1284,7 @@ ssize_t part_fail_show(struct device *dev, > { > struct hd_struct *p = dev_to_part(dev); > > - return sprintf(buf, "%d\n", p->make_it_fail); > + return sprintf(buf, "%d\n", p->bdev->bd_make_it_fail); > } > > ssize_t part_fail_store(struct device *dev, > @@ -1295,7 +1295,7 @@ ssize_t part_fail_store(struct device *dev, > int i; > > if (count > 0 && sscanf(buf, "%d", &i) > 0) > - p->make_it_fail = (i == 0) ? 0 : 1; > + p->pdev->bd_make_it_fail = (i == 0) ? 0 : 1; > > return count; > } > diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h > index c0591e52d7d7ce..b237f1e4081405 100644 > --- a/include/linux/blk_types.h > +++ b/include/linux/blk_types.h > @@ -52,6 +52,9 @@ struct block_device { > struct super_block *bd_fsfreeze_sb; > > struct partition_meta_info *bd_meta_info; > +#ifdef CONFIG_FAIL_MAKE_REQUEST > + bool bd_make_it_fail; > +#endif > } __randomize_layout; > > #define bdev_whole(_bdev) \ > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > index b4a5c05593b99c..349cf6403ccddc 100644 > --- a/include/linux/genhd.h > +++ b/include/linux/genhd.h > @@ -56,9 +56,6 @@ struct hd_struct { > struct block_device *bdev; > struct device __dev; > int policy, partno; > -#ifdef CONFIG_FAIL_MAKE_REQUEST > - int make_it_fail; > -#endif > struct rcu_work rcu_work; > }; > > -- > 2.29.2 > -- Jan Kara SUSE Labs, CR