Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp723602rdb; Tue, 23 Jan 2024 12:54:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsYxm8TznBxIqrbuKzwSnYay3RFaOgOYJuBoX7/b9sIVWa0VB3GX9BJhQXg0hKPRdL2xMn X-Received: by 2002:a17:902:e5ce:b0:1d4:dec9:f163 with SMTP id u14-20020a170902e5ce00b001d4dec9f163mr8495514plf.2.1706043282459; Tue, 23 Jan 2024 12:54:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706043282; cv=pass; d=google.com; s=arc-20160816; b=O364jWy8tUyIp1xxqMVs0EMgrQ+FSN6PxURpzMnBZwZ8hQbasWu/QM3jAZrLhVba3S uvkS9zYplzSMVQeGQkdgRd/K9knqXOnJ5zdE5baOBQjOXgAGM4DMm6S9JlflwAuabrMD zn+62Wvk/oWgr3KKPwNPJxqZXzzulOvN5Ax7q2J8FxMBWLu77Xam2rOQ77/gNMOW+YYW hBMO0Bkf8V/8Ei3C1kDLEoswswWhUlC/Bv2Bwm7mr6cdWg8zGgSed2X4mJOtUOQiCJgr b3M31VXvWx4q/4OxuUSJ8lLnD9J+xuWFBSO0hTBzOUiLEkbO5adkrk1qpQ4e/J/FoRnh LsuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=0XX4UE7LBcIxPzCfE5s5PrNdR9h0h9VUxg0e4qCV+gs=; fh=g4TEmrtWX88WqhOP/U/G24TMXq4NPRfWynUFEp2N4f8=; b=KLDTOeBFWykY9PwY7rK+IqEheilc5zSFZTkUGsRhcxA7lTlwtOIk5YxEqNpdvmAZ93 UiYeilt0qT6N5sc9EilCr1sxzoXJ/zKOpimheHsVDf1oWvfQOrU732a6d6MfP5A3emeb PZc9yWMhWOQNw5g8Tj7xmHKgBs90p5zp2L+qXFHHLRVMR3MCGct8WQ8BVNkyWtKfp6hh A9aRHHTrVjeSMg+z/9npe21aoAXPr4Qp5rsRaYEZpestl1j4jzOq1MVwJiDoeFmkUJgN QIGZDJhGLvkrhbbaw9TxuCUtZt0fHchZ//MvC1eaobZ87c63m6jnqROkQ+3roAt68nQl U78A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JZUMzOIk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-36013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b14-20020a170902d50e00b001d721475ff1si8109094plg.106.2024.01.23.12.54.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 12:54:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JZUMzOIk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-36013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 16EC4B297B8 for ; Tue, 23 Jan 2024 20:19:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E18C85C56; Tue, 23 Jan 2024 20:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JZUMzOIk" 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.subspace.kernel.org (Postfix) with ESMTPS id 5DBBC50276 for ; Tue, 23 Jan 2024 20:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706041132; cv=none; b=PqCUfM6CcHxG7JQOR/PI9gy6N+L2FN05yxnFSMvlCcnzHlxYXTmb86bD7QmGNUhgBvIGtFsUFLZwwnQavSl2OhZS3fX7QE4h2pOs+MKVflcNSWuxsn9J+ou+LvnFIZRxt+PMKoBl2NH9LO0aG8I1SpsHcRbfLJRToBZrtbU8kuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706041132; c=relaxed/simple; bh=eHPdMiedBHLxjR/VrGf90w5dVPBjtNVAkIoW+L8GPQw=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=n3kcQNttQMJGARxyKxI9FRMbbjsObwgdwRfpIhqsTBaLk8g0HMm7hJsqbxTzD0WJQabU235d/U5IwnnsC5/Rf/LoJut68xEFOIFxR34vA9wZjNGPo7FWLVP7g1n1frSzO2XqiLvKADvSMNHY7aBaJZMNXnrklDLCT+MrPHWXLAY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JZUMzOIk; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706041130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0XX4UE7LBcIxPzCfE5s5PrNdR9h0h9VUxg0e4qCV+gs=; b=JZUMzOIk0Kfm0tyRA2WAbgEkKQgVxaKSXJG4JEdPB8LcSf0Np5aPoWVIbJA2uQEHZVcPLN c6Q7Hb51H0oAU78sQ+m02N6mwGAewUNgYlY9EyErknjBz9UdB5zBAiXx1ZKTFHKH3D6s2d +I1N+fR3OUwBVnD3rA5J4vXlHKVDodk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-150-EUy2mcVyOKOCDA3_mOVAAQ-1; Tue, 23 Jan 2024 15:18:47 -0500 X-MC-Unique: EUy2mcVyOKOCDA3_mOVAAQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C176188B5BD; Tue, 23 Jan 2024 20:18:45 +0000 (UTC) Received: from file1-rdu.file-001.prod.rdu2.dc.redhat.com (unknown [10.11.5.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A1AB51D5; Tue, 23 Jan 2024 20:18:45 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id 6180130A79CB; Tue, 23 Jan 2024 20:18:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id 5BF883FB4E; Tue, 23 Jan 2024 21:18:45 +0100 (CET) Date: Tue, 23 Jan 2024 21:18:45 +0100 (CET) From: Mikulas Patocka To: Johannes Thumshirn cc: Damien Le Moal , Naohiro Aota , Mike Snitzer , dm-devel@lists.linux.dev, Chris Mason , Josef Bacik , David Sterba , Jaegeuk Kim , Chao Yu , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , 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)" Subject: Re: [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt In-Reply-To: <20240123-zonefs_nofs-v1-2-cc0b0308ef25@wdc.com> Message-ID: <55226421-ce21-f769-94e0-d42c97e55e7d@redhat.com> References: <20240123-zonefs_nofs-v1-0-cc0b0308ef25@wdc.com> <20240123-zonefs_nofs-v1-2-cc0b0308ef25@wdc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 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 > --- > 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 > >