From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.169 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795980342; b=owcc2mjUbRYii/EwtsJzasVjl+qZhrzmW0mZ4VC7LNfo/YFSPFX/GKhV/prIgH81RV2a kCoRIV1MnZEqgduIbth2j7tLhpLY1yw4d1tDSHoUks0Uv1W1CDbnx3Ntt8b+wbMKzkB1W JybfD4IXS36fLnq5g6fKoBhubwS5V+Z+oFyQi5/cGzZwIy4xj6LZ76pe/xtnHJ4XnfitW ypfeDMItT9ELlLcU83EGegYoQ/3Kq6LmUcFcd+NVRJEzYi/zuXyPL/onZmZ2IiV4Pf6uq qdwcmPQvArGq1YLQdcg0AepUnlmJulhKIVT598/+5iFxXIQiQqYdFihJ9Q5+aJO/pvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795980342; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:In-Reply-To:References:Message-ID:MIME-Version:Content-Type: Content-Disposition:User-Agent; bh=Q/F62fXMsrZIKbRoMzo4/Misajalfe2N6EwF9EjAXmo=; b=xVNI2HGzEGqC5xfs0nNv1NhYq7uN+EcU0IXtgIBNfq8pZlbtFHw4XissB91pqylLPPzT nkr6LPoYo4wWGetGlfAVdpzQisMJsqPCzkj0vl1bDLFpl5j7pi72sEab1Qrbsp8RF5f9a lRLK40WXvwdYIc2XhpKBXPjjyMRizgMzpGbi8tawir2qDbpOcQjRJ+j9SKX7AYSw9EouC IYPmQG5AmOOZjUo+OgPW9r6PByorv+iVsO3uGR5KArwPx4huPOKl9ShSt7U1HtAxhwYu4 aqwV2lGIy92CTzJlS3IdXFCW1XGq5PuW4yihS82tTBSkWwwgwQS8fsRYeN0r4VsGmZA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=C6lYwzRV; arc=none smtp.remote-ip=209.85.128.169 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B48A2606A6BB for ; Sun, 29 Nov 2026 19:25:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B48A2606A6BB Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=C6lYwzRV Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-8b4dd5cb4f6so68077447b3.2 for ; Sun, 29 Nov 2026 11:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1795980341; x=1796585141; darn=vger.kernel.org; h=user-agent:content-disposition:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Q/F62fXMsrZIKbRoMzo4/Misajalfe2N6EwF9EjAXmo=; b=C6lYwzRVXTFLMsTMhYnBCCMQrN1ngTRT1R5NsZFhZCqZG2SQXTCCMejaiYuwyMo1uU Hb0rwOY1+De7GIKKtxT++AlrsQC0eFmN06c8KZL3r55lQrnJzPXi0qWsjjeh3zy75YtP mJ6wbdfs1hweKoO0wfyilIFYVrFbuEgB4IXUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795980341; x=1796585141; h=user-agent:content-disposition:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Q/F62fXMsrZIKbRoMzo4/Misajalfe2N6EwF9EjAXmo=; b=gleSGwhj4fLnC91ziQMUPa3DrIqWczHNc4LOueFT9YtBx5IXewugKsgl4qItcM4jJC mx9BWix4reM48aAZiDOFmp3bmWJy9xgprZPyAJUc+FAitexcUkpnZ5rFHjk8GyrVWWrv CvefRtNk32bnP0YJT2L5AMT63JF+nGjOX6A9Si5DXGtvPjAEKors9wxOxMOefmqNEYBH mU8QQVy605YeDks7UKs+UNNaZzEE0ZBMLzntEzlIHhnjQukn2Tc0I9wKyf6AdFJ6YxPo Ed1EgtinUdjHV/KWe7drllStX9TxecOtGXewyq4CGlHizXxQAii8kOvL/0LYWinWYipX JBiw== X-Gm-Message-State: APuU4Z8DKea14qYf5B4R/DWFIf5AvRGkp7GqfqIjWm5vzZpxG3YPdr1P uhBVY2Vf7MmkIheE7/KL6OBfpi21h1VId0bw2MKRwREbHRf7qq/wBUtj+sgXQ6K4O8GiWZUTG9a JcMb0EaTUsLLN9ySVUg== X-Gm-Gg: AZFdTZfs9euuL3nFqTMCbp4fk+gnW5ddkDV6760LOZBvKrx2kjS42tf8C5g1/k0hcPo AMbk9duML1mtBIs72AMYrMNr9WOgKtmraP+aN8TLvQtDkYmXrFzEKTMvj9muZmOiSTM5lHbJ7JU Qd9rqhswiO0wXZzhqmvVROv4YnC20dOdSecVuvZh/V5mSp2s3DA9QXXeTjnInY1zAtON2SYdX5g xmruA4Y2qNsV9Mp5s/xl/1tjSIqIZ7tF9shTMNrWZBwVgBdE6Q0h5ZIuIul2b4WAv/mQ9Ca1SNj QPpP3vQ4YiR1tZIGkzif+vhKI/zrm2ZwC+DgRGmBgrGD87BkfUUImcNorQ59g97kj877FCR/KMa qYjaJUVuLOfZDeuehy3zh9wPoF9MhYoIOv5NYlT7NH36ODRveA6YUJ8pfqBPZXVLSegiyvDq1LG reHML0lid1HP8k3bzyCCy5maFXXk0Tj8cSn1b6Uo9BEn4Pl2zafiLsCPvxZYur2wpZQMBt/qMTg mWS0aOp0i5Q40crEzleG7kX/BjnBvAy5zfZ2Byl7EuFZ/1cGnL+huyppNr3twUhzCH/7PfVq0n1 jmzSMW/iOx0LoE2mkOYDJ7f72tEU8Y1RJxCMC5E8iW3w+Uyj6RxWxRcXF5Z/ToXzAfNtm4+O+JJ PuuDicQuQgKNaTK9WCq3fWtFfEg2PamwzYi6qKWtI+rR8O5p5LaXdvIfUoVltE/YaKf4WeiJ56y awPUCh5eu9nz3pjUsSA6dy62XC/Cz26FI9nGzr9xiFphX51AXJxiMIyQuG4kNcM8Rcxt+ufx5Ck 1NV+9KtCBA1zExRHalrZVY= X-Received: by 2002:a05:690c:6b81:b0:8b4:c71b:e4e5 with SMTP id 00721157ae682-8b52047231bmr141096947b3.25.1795980340735; Sun, 29 Nov 2026 11:25:40 -0800 (PST) Received: from [172.20.0.2] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b52033c2d4sm118519497b3.36.2026.11.29.11.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 11:25:40 -0800 (PST) Date: Sun, 29 Nov 2026 11:25:39 -0800 From: Chris Down To: sashiko-reviews@lists.linux.dev Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , "Martin K. Petersen" , "James E.J. Bottomley" Subject: Re: [PATCH v2 4/5] scsi: sd: Fix WRITE SAME(10) count truncation when the mode changes In-Reply-To: References: Message-ID: X-Mailing-List: linux-scsi@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 User-Agent: Mutt/2.4.3 (cc9e3943) (2026-10-09) sashiko-bot@kernel.org writes: >Can calling set_capacity_and_notify() in the grown path after >queue_limits_commit_update() unlocks q->limits_lock race with a >concurrent sd_revalidate_disk() or update the capacity after a failed >limits commit? Yes, that race is there. The disk has to shrink back while the first revalidate is still running, and the first one then has to be held up between dropping the lock and setting the capacity for as long as the second one takes. I only hit it with a sleep added there, but it does leave a disk with more than 2^32 blocks in writesame_10 mode until the next revalidate, and a discard to the new blocks is sent with its LBA truncated again. In v3 I'll set a grown capacity under the limits lock, so that it's always the one the current modes were picked for. >In addition, because err is checked after set_capacity_and_notify(), a >failed queue_limits_commit_update() still publishes the new capacity while >leaving the old queue limits in place and skipping >sd_zbc_revalidate_zones(). That isn't new. sd_revalidate_disk() already called set_capacity_and_notify() before the commit and only looked at err afterwards, so I'll leave that as it is in this series. Chris