linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	 Mike Snitzer <snitzer@kernel.org>,
	dm-devel@lists.linux.dev,  Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	 David Sterba <dsterba@suse.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,  Chao Yu <chao@kernel.org>,
	Jens Axboe <axboe@kernel.dk>,  Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	 Chaitanya Kulkarni <kch@nvidia.com>,
	linux-fsdevel@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-btrfs@vger.kernel.org,
	 linux-f2fs-devel@lists.sourceforge.net,
	linux-block@vger.kernel.org,  linux-nvme@lists.infradead.org,
	 "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: Re: [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt
Date: Tue, 23 Jan 2024 21:18:45 +0100 (CET)	[thread overview]
Message-ID: <55226421-ce21-f769-94e0-d42c97e55e7d@redhat.com> (raw)
In-Reply-To: <20240123-zonefs_nofs-v1-2-cc0b0308ef25@wdc.com>



On Tue, 23 Jan 2024, Johannes Thumshirn wrote:

> The call to blkdev_zone_mgmt() in dm-zoned is only used to perform a
> ZONE_RESET operation when freeing a zone.
> 
> This is not done in the IO path, so we can use GFP_KERNEL here, as it will
> never recurse back into the driver on reclaim.

Hi

This doesn't seem safe to me. There's a possible call chain dmz_handle_bio 
-> dmz_put_chunk_mapping -> dmz_free_zone -> dmz_reset_zone -> 
blkdev_zone_mgmt -> recursion (via GFP_KERNEL) back into the dm-zoned 
target.

Mikulas

> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  drivers/md/dm-zoned-metadata.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
> index fdfe30f7b697..a39734f0cb7d 100644
> --- a/drivers/md/dm-zoned-metadata.c
> +++ b/drivers/md/dm-zoned-metadata.c
> @@ -1658,7 +1658,7 @@ static int dmz_reset_zone(struct dmz_metadata *zmd, struct dm_zone *zone)
>  
>  		ret = blkdev_zone_mgmt(dev->bdev, REQ_OP_ZONE_RESET,
>  				       dmz_start_sect(zmd, zone),
> -				       zmd->zone_nr_sectors, GFP_NOIO);
> +				       zmd->zone_nr_sectors, GFP_KERNEL);
>  		if (ret) {
>  			dmz_dev_err(dev, "Reset zone %u failed %d",
>  				    zone->id, ret);
> 
> -- 
> 2.43.0
> 
> 


  reply	other threads:[~2024-01-23 20:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  9:43 [PATCH 0/5] block: remove gfp_mask for blkdev_zone_mgmt() Johannes Thumshirn
2024-01-23  9:43 ` [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call Johannes Thumshirn
2024-01-23 20:39   ` Mikulas Patocka
2024-01-23 23:21     ` Dave Chinner
2024-01-23 23:31       ` Damien Le Moal
2024-01-23  9:43 ` [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt Johannes Thumshirn
2024-01-23 20:18   ` Mikulas Patocka [this message]
2024-01-23  9:43 ` [PATCH 3/5] btrfs: zoned: call blkdev_zone_mgmt in nofs scope Johannes Thumshirn
2024-01-23  9:43 ` [PATCH 4/5] f2fs: guard blkdev_zone_mgmt with " Johannes Thumshirn
2024-01-23  9:43 ` [PATCH 5/5] block: remove gfp_flags from blkdev_zone_mgmt Johannes Thumshirn
2024-01-26 22:03   ` kernel test robot
2024-01-27  9:57   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55226421-ce21-f769-94e0-d42c97e55e7d@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=chao@kernel.org \
    --cc=clm@fb.com \
    --cc=dlemoal@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=jaegeuk@kernel.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=josef@toxicpanda.com \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=naohiro.aota@wdc.com \
    --cc=sagi@grimberg.me \
    --cc=snitzer@kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).