From nobody Sun Feb 8 23:04:01 2026 Received: from mail-yx1-f102.google.com (mail-yx1-f102.google.com [74.125.224.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39EC02FF17A for ; Thu, 8 Jan 2026 17:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767892953; cv=none; b=Nm/EFabOOh+/goyW0qnbgJEv+ILrLLLY4VC21fuFjpxKWQWZVK/FD9NbulBtdgy+F4q/TcbJCq0uVu7yp0dENfCzcmrhHadWKSvyuvPZp27UfYjS284AIWGuOBT6ZT7TIkzL+nmNBBgvL4IRQ1X2T7/z5CKph0pHAnQBj3W40ZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767892953; c=relaxed/simple; bh=i4p29NAYQUFaC6TakPUiO6FyaXMSmwrUFhPBK4q5+XY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WOQozlqh5AcYOMGP3vgx9TZ3n4GtZ6cCzKwLDniXphKWdANNUqIfIR51/W77SG8BSeKWj6rHleyYTz9WIqVlPegZbH992Q3ae03yylBKZdaSwZO2ugpybIbkBabKu9sZfPBQFbzr3PNMGPR4kCyO6ZuxlrZopF/peVGNUMzxHRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=eVgl0rGd; arc=none smtp.client-ip=74.125.224.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="eVgl0rGd" Received: by mail-yx1-f102.google.com with SMTP id 956f58d0204a3-644746e3793so501461d50.3 for ; Thu, 08 Jan 2026 09:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767892951; x=1768497751; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jxex0w2xVdLJ5pj+6cE9HhLbWu2So1kRLspmYigE0yw=; b=eVgl0rGd9VsthzbNMoscq8+rAN8Q2gD0jdD9qqPPEJ8hFGXp5W4mq4biznrcLYUB3y ybjSuvg5Ce8RCb00M49kMoX+Ou+43XiEeH7CmzszZZkrnCUvZj/OqTgUf9TzGc4j+RFT M8gdtudPJj3AE+qLg8lDFpkOqKidvG9YU6H+RJKSt6NBWJlHQH+lqP0tjAx57UhKQ3qg c6zsPwPxqqMMWOub4EdTgDsWZVCJBkFxqnqJBK1jrhNctycVxjhG5xPj1EBaW2t5IuTe SAh3nzYmv1/hhQ5hB2Ds7m4mpQPOe2/IL7OO4CFKzLL5s8E0WK5Ebi4xamdPPJ77GXr7 7QHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767892951; x=1768497751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jxex0w2xVdLJ5pj+6cE9HhLbWu2So1kRLspmYigE0yw=; b=eeRQqJ4IPKzh4xc7MuJSu8n5u1qBfm8T/AE5cszhcuVc1DwSbO+dmpUXCp1rSIV1XX fEGQCoUMZlJPAyKgjYaVSN/JM7BEGntVOTDY73wkgg8/SHJ59TavJm/v64FWsbA7p7Fh SRe41T+3r+6lWPTQehGuSFPQ/DMffMbpGpVLOwl2d6HyIk30LlpR85TQn56WMK1pmsd/ veMAC6d4dQyNauRxAcR/gcV8AkKk2ioZFrHSpNOQL58fXWYr/FkQLTYRzlr4bm1PaeOK /FZ4jZgwvxFKNnYzA/DlX5RCjIKqzbSjboXlmWxTmxwHwaKBbCM487Adn/ad5zmfh0Ip cZ1A== X-Forwarded-Encrypted: i=1; AJvYcCVSsi5jvfRQqWa+YfWTjHgDYu+Z/wLyLtKKNOStStAMlDWc84GXA8MpaHrhThWA8c58M6OXG9Et50cYKlU=@vger.kernel.org X-Gm-Message-State: AOJu0YwS7vGkjO/QcPdsCy+FbHxXqPKtEEzOWgeY7xy9GoiUVM6HTMVt tYPmCJCIg1LY3/wyvZHur/TGzm1syaiKZbp6Rs/Eg7vAZsWvCV7odwugX25qWxnIZr9srbXpMVr y4r3nAyelbPy8aAL8R5AicfYU+9OKXJWGgluKFtL1IQVIVtdMc79E X-Gm-Gg: AY/fxX7DbWyX567hdo5R0/dFiBpEBgxLTZ/ngZ3+CB6qkmvkTB7pTg/moaFXMXDVWly y8ekoLgZI+qIqmCnPBvBYdXZZJl2e57h+VVfn9e13VYUkgVfNYMXbzy2ogNpbAbicrtrnz98rAS cM0l1SPHQu9Ybq3xasW8cfknM/NuRnOTh+OwyyNHkpXpAR3kwa1O+T9ZYDPgzjIHsyBslHXCKBZ yyfkSAFU1TAy1yQ+YuEtodUl9ZFMqxuFHVA3G6x6XmBYEoVWDQcfsVFfG94PiMbL/fWMt2w8dW4 g6GTdJBgX7mkEKdqyzTMegujIXzuSi/oeagVZaiHchgHuYqnHVGHfKzI+YkoBXAwjTwHJN/ebO0 fzYPMjb+6hNN3oxASLtOAgSTZ5bg= X-Google-Smtp-Source: AGHT+IHT4rzoi1pIcJ2b2EbFL4SNsnV2Kx5sXAVunV6KAEhZUrhWimnE1b6DVrmZ22bjEufdrqkaea05RYU3 X-Received: by 2002:a05:690c:6608:b0:78f:c943:b2f3 with SMTP id 00721157ae682-790b568e27emr61630227b3.4.1767892951115; Thu, 08 Jan 2026 09:22:31 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 00721157ae682-790aa6a9f37sm6287247b3.17.2026.01.08.09.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jan 2026 09:22:31 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.6.120]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 2966A3406AA; Thu, 8 Jan 2026 10:22:30 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 1E459E42165; Thu, 8 Jan 2026 10:22:30 -0700 (MST) From: Caleb Sander Mateos To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Anuj Gupta , Christoph Hellwig , Caleb Sander Mateos Subject: [PATCH v2 2/3] block: replace gfp_t with bool in bio_integrity_prep() Date: Thu, 8 Jan 2026 10:22:11 -0700 Message-ID: <20260108172212.1402119-3-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260108172212.1402119-1-csander@purestorage.com> References: <20260108172212.1402119-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit ec7f31b2a2d3 ("block: make bio auto-integrity deadlock safe"), the gfp_t gfp variable in bio_integrity_prep() is no longer passed to an allocation function. It's only used to compute the zero_buffer argument to bio_integrity_alloc_buf(). So change the variable to bool zero_buffer to simplify the code. Signed-off-by: Caleb Sander Mateos Reviewed-by: Anuj Gupta Reviewed-by: Christoph Hellwig --- block/bio-integrity-auto.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/block/bio-integrity-auto.c b/block/bio-integrity-auto.c index cff025b06be1..605403b52c90 100644 --- a/block/bio-integrity-auto.c +++ b/block/bio-integrity-auto.c @@ -107,11 +107,11 @@ bool __bio_integrity_endio(struct bio *bio) bool bio_integrity_prep(struct bio *bio) { struct blk_integrity *bi =3D blk_get_integrity(bio->bi_bdev->bd_disk); struct bio_integrity_data *bid; bool set_flags =3D true; - gfp_t gfp =3D GFP_NOIO; + bool zero_buffer =3D false; =20 if (!bi) return true; =20 if (!bio_sectors(bio)) @@ -137,13 +137,14 @@ bool bio_integrity_prep(struct bio *bio) */ if (bi->flags & BLK_INTEGRITY_NOGENERATE) { if (bi_offload_capable(bi)) return true; set_flags =3D false; - gfp |=3D __GFP_ZERO; - } else if (bi->metadata_size > bi->pi_tuple_size) - gfp |=3D __GFP_ZERO; + zero_buffer =3D true; + } else { + zero_buffer =3D bi->metadata_size > bi->pi_tuple_size; + } break; default: return true; } =20 @@ -152,11 +153,11 @@ bool bio_integrity_prep(struct bio *bio) =20 bid =3D mempool_alloc(&bid_pool, GFP_NOIO); bio_integrity_init(bio, &bid->bip, &bid->bvec, 1); bid->bio =3D bio; bid->bip.bip_flags |=3D BIP_BLOCK_INTEGRITY; - bio_integrity_alloc_buf(bio, gfp & __GFP_ZERO); + bio_integrity_alloc_buf(bio, zero_buffer); =20 bip_set_seed(&bid->bip, bio->bi_iter.bi_sector); =20 if (set_flags) { if (bi->csum_type =3D=3D BLK_INTEGRITY_CSUM_IP) --=20 2.45.2