Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1098948lqj; Mon, 3 Jun 2024 10:03:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXO2VO3gm/uDBo4nwLcPAWK6fMXB/1P9Z/ycRVJKQHX/N9ZtRE0lNDRnuXcgXqgFSLt526ZThsLR2a6YrZoUIIvAAOtj12v9ZPQpFq0Mg== X-Google-Smtp-Source: AGHT+IGL/dXTyOi05mmXRRBqAfs9Vd2A9bDTNKVERcOkBDNC6ysirZEf6W0IvE0efNd4IAyHJ8iD X-Received: by 2002:a05:620a:458c:b0:793:c50:b338 with SMTP id af79cd13be357-794f5c9486fmr1217800185a.37.1717434209889; Mon, 03 Jun 2024 10:03:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717434209; cv=pass; d=google.com; s=arc-20160816; b=C5OcUP1BmhVCNLq5dDPKbrmxriGetlwyOei0ECAG+ehdyf1Y+SJS5h/fl8GCADxcJr zoqLLHIcAh+Ym0RpFDkAczYn6ogg5CDuKRk2g5xeHVlTUZbiKc+vwYBcFs1HzT/kTH06 YwXXt0vtSM6momLL7WHYXULKxfyMpUyyuXUzoiiVvpQbDJ+0jMkRMbppOZwoOjHhIbzG dlBQHNOz1je5fDnNQKtStpcAushQVkjZ+BWuAhn/wHTKtEbAs0rwCNiRmsUrhxMJclJi QFdaQzzl77tNsT+LzzWxrUBN9jkOZ8nzaa9QoT5026diI1X61PeewKI4pmtiMWmkx8Z4 zoDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=szTW+lKyFEYkP8WzkuWnoEbkPGfA8Q5XnLEea5tZdt0=; fh=mGGm0ACmE1mOjyjpKGSP/S7nNgrLGOVKRaaF8f2e9do=; b=qCSQZmYYpp5M9gGicrf2Mf+mLEDyRof5C25lsQ5YQwiN+MbgcD1S5QYbXkNz8OVs+o H7iwI8RrGqRCIYaUoMuvih0E3LVEx5omKOrbUoieCHaWvfipUczerLJXxjClmATiAVsC NuUX+4y5qx1CizcXPQBHCDX1XLEl2O4E9uDoR78uOLcv1Av9lZdr+j5oih4Gqbeyv8wF LYDWFrlc2/H5GmHAlaSuNKJzZLaM8RuvrnTiR1x8QJAAX6ZIMIfVSMm/aEtRWZzUuVKX lp/70Bha1uAC46Q+LrIcOkxs4WSLay2osV1tmM3WS6eCxgs9zCiwLIqnUcjGkaDC8ebW aV2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=kWjEhXWY; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-199478-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199478-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f32c28acsi881729885a.736.2024.06.03.10.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 10:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199478-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=kWjEhXWY; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-199478-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199478-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8F0041C21ECD for ; Mon, 3 Jun 2024 17:03:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 675DE1369BC; Mon, 3 Jun 2024 17:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="kWjEhXWY" Received: from 009.lax.mailroute.net (009.lax.mailroute.net [199.89.1.12]) (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 3318F1304B1; Mon, 3 Jun 2024 17:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434202; cv=none; b=eoSXqPNudZxzrAudHGiABZ8LToddifRjzIJ7nxYpFQTPJ+8ivDkq5H7/z/F9gUYo++LbzZcHi4E564G7v+E+1lTU7D3ZK7upNtV8tYERA3Mwv3xiMxQP0sNlBUK2VqINBtAU29Qfp/tFb3/QgdubPW8mOsXYlv3ZN9Wl31b2VYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434202; c=relaxed/simple; bh=NdEWlc5LadRjjSgK7Y5Tx6FHrF4eTCDLDBNTBsZ5ACg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OWFBRDjQ7gtqJOFG81E57UseBk3/V8aolijPh6GLPeXGrqOe9pmrXLUFQtNdHF+S70gfbK69l85EWvgK9FdwZ3Jr81leIOjcANAuYv5IGB3By+DeNflQuiXu4FjgROW4FR5CsKklMu6DG9egccyEZq2E8Wqnh30HSUb3YScPum4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=kWjEhXWY; arc=none smtp.client-ip=199.89.1.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 009.lax.mailroute.net (Postfix) with ESMTP id 4VtKmm4zlnzlgMVc; Mon, 3 Jun 2024 17:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1717434198; x=1720026199; bh=szTW+lKyFEYkP8WzkuWnoEbk PGfA8Q5XnLEea5tZdt0=; b=kWjEhXWYSSJk090al3eaFSa9Ewr5sX87IluLwzcu +6SD7gWwDI+CQRO+4Hm1Xpd071Thd1hx4JHzeo/OWtxxXkXNvlZKeaprFqc8JzAV OZs/Z7ktWBCJXoaU7bjNYji7WM/nKQoSk93zllHcG9ffnxniyFUqqTpt0bMUE6Qp h312oUdCec4QSLft4ZzYs+zHIIE+BSGL4P9vlmi8C9Ws61YKfnsHByhJOHcZ729v X4kC/5PCWcOr2HR1rR9ZrhPfovCwoj8l9IvaMFd9gaGkd8l/Tjd9BnZH5et5bG+p ORk1PQOs/XimhqCv/rL3pN9MVAzao5H9+IDH8V6gblT6sQ== X-Virus-Scanned: by MailRoute Received: from 009.lax.mailroute.net ([127.0.0.1]) by localhost (009.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id Gq-q_G1KSLzU; Mon, 3 Jun 2024 17:03:18 +0000 (UTC) Received: from [192.168.50.14] (c-73-231-117-72.hsd1.ca.comcast.net [73.231.117.72]) (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) (Authenticated sender: bvanassche@acm.org) by 009.lax.mailroute.net (Postfix) with ESMTPSA id 4VtKmj2lnrzlgMVV; Mon, 3 Jun 2024 17:03:17 +0000 (UTC) Message-ID: <66a8c62b-9202-4de8-8789-1f724a5ce5f8@acm.org> Date: Mon, 3 Jun 2024 10:03:14 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] null_blk: fix validation of block size To: Damien Le Moal , John Garry , Andreas Hindborg , Jens Axboe Cc: Andreas Hindborg , Keith Busch , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240601202351.691952-1-nmi@metaspace.dk> <9d68c7c1-b1e6-4f42-8d4b-8c986ab688b5@kernel.org> Content-Language: en-US From: Bart Van Assche In-Reply-To: <9d68c7c1-b1e6-4f42-8d4b-8c986ab688b5@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/2/24 16:59, Damien Le Moal wrote: > On 6/2/24 19:57, John Garry wrote: >> On 01/06/2024 21:23, Andreas Hindborg wrote: >>> From: Andreas Hindborg >>> >>> Block size should be between 512 >>> and 4096 >> >> Or PAGE_SIZE? > > PAGE_SIZE can be larger than 4096. But most drives are 512 or 4096 LBA-sized. null_blk is not a physical device. Hence, why not to use blk_validate_block_size() here? Thanks, Bart.