From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.95.11.211 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796030275; b=0H1fjbqZOv0r8a8RORLY5WxQX8qrvXP0BYUAOl6WXwFK3/YipmHP9W8ss15YCvcPMXAX hN7NeEC1DFXE3mZbDvM0axqvyLu9qVcuNZCUKxi58KVNR5BcZw38CegkqT31zBHgJSQfZ 0RXuljbFclViur7rX0Ahqc7vAdBgkQb/e/MUFrcdNZfOlHxxpbZnsmTutABYchdHnFFUc G5LSik3aEdQdc7rLsYL4DRWKoVCXYSDKvwJ2IqfoVageYpieo6il7vLH0S94zoeRTUrlv ITYzL/5ZwjkHRpLkS9IDFHqaJ6xDALtHBQmgnla58n0nXCmMQTKszp6bueydCRvjJMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796030275; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; bh=s5ReTdQlWdhbGtIrNj4b/mwIZpiA04mF4wjXMKWMmP0=; b=htInu+cHHSb7v6+C8reJSoh8xX0xTFjxVURH94Mqq8Jve93MJD3zIlmFWKLb+a9rriP3 F6NtzvFUYX5zLXzPUpztW+qKvbfXTjkB3+OtaBbXLG2O1ose0bPMoaUqdpoAv04sRC+b/ uB+fGGT/kWaf3JLXFfkMXRc0oxCi7P3BsFGyQ9qJsNivgOQTLcOiIZW3sLlLa8Ifwm0YS X8El+DiNzmNMrviyhOwQXnglAP3ipJM83MeuW/uzEPXFYWKw+rGTVNVbiC3K0nnmU3Xse LSEDXnwZtNn8u4JE7q3ZfjXUoJeYzKngG5fiTy4RS24kX4qFhg9+5aeBQvTvS43UTtA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.remote-ip=213.95.11.211 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A6AB606A33F; Mon, 30 Nov 2026 09:17:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8A6AB606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 7E60968BFE; Mon, 30 Nov 2026 10:17:47 +0100 (CET) Date: Mon, 30 Nov 2026 10:17:46 +0100 From: Christoph Hellwig To: Chris Down Cc: "Martin K. Petersen" , "James E.J. Bottomley" , Christoph Hellwig , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, sashiko-bot@kernel.org, Bart Van Assche Subject: Re: [PATCH v3 2/5] scsi: sd: Fix data corruption in WRITE SAME(10) write zeroes Message-ID: <20261130091746.GB12202@lst.de> References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) I find the subject a bit odd. Something like: sd: don't use WRITE SAME(10) on device requiring 64-bit addressing a bit more useful. The commit log could probably also use a bit trimming from the overly verbose LLM style. > +/* WRITE SAME(10) only has a 32-bit LBA field. */ > +static bool sd_can_use_ws10(struct scsi_disk *sdkp) > +{ > + sector_t max_blocks = (sector_t)U32_MAX + 1; > + > + /* > + * A removable disk without a medium has an sdkp->capacity of zero, > + * but the gendisk keeps its old capacity until the next revalidate. > + */ > + return sdkp->capacity <= max_blocks && > + get_capacity(sdkp->disk) <= > + logical_to_sectors(sdkp->device, max_blocks); > +} The comment seems oddly misplace, as it doesn't seem relevant to any of the conditions. The code change itself looks fine.