Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp400883pxb; Fri, 16 Apr 2021 08:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9hPyC5NJ9iViLcWnaSR3h26FSj+6ekENR1HQ7H7pAPPuNtxR0hSG/vF2l1akDZfXV+7kX X-Received: by 2002:a17:90a:650c:: with SMTP id i12mr10632391pjj.204.1618586521984; Fri, 16 Apr 2021 08:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618586521; cv=none; d=google.com; s=arc-20160816; b=imEpRSVNxD5osjGgQtHicU6vnFESbadDJB1+zje24IiGPatkJ0Xrui6dOS/3OWLagt mEu7RZ8J97X+rIDl5TPkWnMzf8L8KaGR1uqI8jsxpr9zNDjeoqOWiuEYuH2PAU5Pf+Kr BJ2+UuG6c7JLAgV9hXxJ1vbJukJ2DuqYf/Wulf7g1Y0/q+npXs8+R3McbUm+5GFwKDUK PjPHjedFhrZFAsjdCvlRB2uaKl8SpKQEJShUUXv7gd6bGwgoOUKlVmVcfRTohyl3ZpZX 2My/utv6OZ9GsAd+it8d8QcWwg4Kk1PQ9Ziyrrg6WUjnAp2VEWY8AsDC1YirUokYkClp 2IWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=rf9Pc8+FVAKPlNR8aLYNEkW8m2UqHulQNz4NRbcGFHY=; b=mKk3e3uoO5ZvjjvC9MHEB3wy7CNrAz9TAgRsDLDiZywf9zVCTN1gK1N2p/H+kFtvIX GOimt2gW4U6+SaHAd6t71nbux7spFIziBpA5wxoo+iiWw6FZXQOBzSySuW6p8G4b7yNK C3QdYAHJynlDOVeirXQe8SEbYotd5LeCx5l2jy+pb9i3IrEFdzYMxHswVAvN/OU8dx9G csw41HnL2BegTlkhYZIrn5Ko403CRizWz3EYZ3xwiV5I5Lbp/SAt+HuMAzXbndPBnq4i LfjI9dVxHYb0Xas1D8Mn4mQf3oE92sSYdBqqzHodP94CjdGidiqCPjDm2yuGmnFeYyC/ y1dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si6262651pfu.130.2021.04.16.08.21.49; Fri, 16 Apr 2021 08:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343570AbhDPPTY (ORCPT + 99 others); Fri, 16 Apr 2021 11:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343523AbhDPPSr (ORCPT ); Fri, 16 Apr 2021 11:18:47 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE3B6C06175F; Fri, 16 Apr 2021 08:18:21 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id CDA9292009C; Fri, 16 Apr 2021 17:18:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id C92F592009B; Fri, 16 Apr 2021 17:18:20 +0200 (CEST) Date: Fri, 16 Apr 2021 17:18:20 +0200 (CEST) From: "Maciej W. Rozycki" To: Nix cc: Khalid Aziz , "James E.J. Bottomley" , "Martin K. Petersen" , Christoph Hellwig , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] scsi: Set allocation length to 255 for ATA Information VPD page In-Reply-To: <878s5joh2d.fsf@esperi.org.uk> Message-ID: References: <878s5joh2d.fsf@esperi.org.uk> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Apr 2021, Nix wrote: > > Set the allocation length to 255 for the ATA Information VPD page > > requested in the WRITE SAME handler, so as not to limit information > > examined by `scsi_get_vpd_page' in the supported vital product data > > pages unnecessarily. > > > > Originally it was thought that Areca hardware may have issues with a > > valid allocation length supplied for a VPD inquiry, however older SCSI > > standard revisions[1] consider 255 the maximum length allowed and what > > Aaaah. That explains a lot! (Not that I can remember what SCSI standard > rev that Areca firmware claimed to implement. I know I never updated the > firmware, so it's going to be something no newer than mid-2009 and > probably quite a bit older.) From the original discussion I gather Areca sometimes acts as a pass-through device to actual storage hardware, so it may well have been decided for the firmware to take a conservative approach and interpret the low order byte only. A genuine bug cannot be ruled out either of course, which I why I will appreciate your testing. > > I can see you're still around. Would you therefore please be so kind > > as to verify this change with your Areca hardware if you still have it? > > It's been up in the loft for years, but I'll get it out this weekend and > give it a spin :) this'll let me make sure the disks still spin as well, > which matters for an in-case-of-lightning-strike disaster-recovery > backup box. > > (I just hope this kernel boots on it at all. It's about three years > since I retired it... let's see!) FWIW if all else fails you can try this patch with the original kernel you used with the box. This piece of code hasn't changed, so until I came up with the complete five-part solution proposed here I merely had the original commit reverted as it is so as to allow forward progress. In any case, as per the cover letter, I have upgraded from 2.6.18, much older, and this was the sole show-stopper for the machine, running SMP even, so chances are 5.11+ will work with your system as well. The other plain 486/EISA/ATA box, similarly upgraded (now that I got its faulty odd industrial PSU finally replaced) works just fine with vanilla 5.11. OTOH versions ~3.15 through to ~4.5 I have tried while bisecting this issue mostly failed to even start booting due to what looks like a heisenbug to me (e.g. switching from XZ to gzip for compression would make some, but not all versions/configurations boot occasionally), so YMMV. Overall we're not that bad with keeping stuff working, it's more new use that causes troubles sometimes. > > It looks to me like you were thinking in the right direction with: > > . > > It's the sort of mistake I could see myself making: an easy mistake to > make when so many things in C require buffer size - 1 or you get a > disastrous security hole... And here it's masking, except that with (256 - 1) rather than (512 - 1) as you suggested. Thank you for your input! Maciej