Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp219353imm; Fri, 21 Sep 2018 22:27:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV61WpAh3wJSnZMiIXm8FknBRlbuaMfaD+jOlZxJcudu0aTU34cikNfYLSdIJ9WD4VQ6HvQc8 X-Received: by 2002:a17:902:b945:: with SMTP id h5-v6mr952453pls.248.1537594074807; Fri, 21 Sep 2018 22:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537594074; cv=none; d=google.com; s=arc-20160816; b=V4k0r3K3msZavA1HsI7olGSwAP1XgxDjlWuhv9LF1m+u1UY5W2IvwvzMWpybK17SiT FaSiMzsO4Pqi3omcwB/fN51SZtH3Xl8P/faMBH6uw5hD0F8na/UCJkNgBDeRmu4OhhqB RSMKzD+aB+lJ+phlnvIHlLRXPVglKyx9hXnepSuCh4ahMrO/4ii8ZZOj4XLqlJeWq3xS d5TeGHOu6HS7CxGL/9qfy9uk/1ENo5+Q1yekFQ40RNRx7YF+Bo/vPozxXvsmMIN4rU7q RLPCvQ3v0exo3H6+PClClb8FEPG3tnyjQVyAIUqr/yVb2L9wTmVBgt3k9yuu5sgkGKrJ 9OTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=dr8VTGkAyN7FlQcMHih1/chM8k3XbPCX6slXr6hwUO4=; b=rHlWoDxJ4qbjrLAdv4qfLXO6n1D1Ocz6Dlzfi8O37HQZVyYSWGuHouQFiqgVnZ8Ehh u20kDV66L8fBHSb1DueYIsMVynQRDDdG4JS7WxbKTmdOahArTLF1Fy9t207PlVUX98OJ XDAk5xjVgTMYlnNW8Cv00CtDfgSEaXUtXTOGjt4sqst+3XwhOcYSm2yudjkGdWydey4M /3qCWrU8QJ33vvQEc1m8eUsFB06gwQz9Rx4No+SKr/cjHi1VlgTv9qI2U5/pHLHFOS5V 4XP+wrmdUWIpTt2IPazsBhuJsefXCtaqpHdb+Z8D+9JqwSUwyGmkJfprtbXMARJQvuiD vsiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9-v6si27683559plb.107.2018.09.21.22.27.39; Fri, 21 Sep 2018 22:27:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726223AbeIVLTY (ORCPT + 99 others); Sat, 22 Sep 2018 07:19:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbeIVLTY (ORCPT ); Sat, 22 Sep 2018 07:19:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E4B7308AA0E; Sat, 22 Sep 2018 05:27:11 +0000 (UTC) Received: from rh (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95FF980C3; Sat, 22 Sep 2018 05:27:07 +0000 (UTC) Received: from [::1] (helo=rh) by rh with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1g3aRZ-0004w1-Mc; Sat, 22 Sep 2018 15:27:01 +1000 Date: Sat, 22 Sep 2018 15:26:59 +1000 From: Dave Chinner To: Ben Hutchings Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, Christoph Hellwig , Wen Xu , Carlos Maiolino , "Darrick J. Wong" Subject: Re: [PATCH 3.16 52/63] xfs: validate cached inodes are free when allocated Message-ID: <20180922052659.GC19103@rh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 22 Sep 2018 05:27:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 22, 2018 at 01:15:42AM +0100, Ben Hutchings wrote: > 3.16.58-rc1 review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Dave Chinner > > commit afca6c5b2595fc44383919fba740c194b0b76aff upstream. > > A recent fuzzed filesystem image cached random dcache corruption > when the reproducer was run. This often showed up as panics in > lookup_slow() on a null inode->i_ops pointer when doing pathwalks. ..... > [bwh: Backported to 3.16: > - Look up mode in XFS inode, not VFS inode > - Use positive error codes, and EIO instead of EFSCORRUPTED] Again, why EIO? And .... > Signed-off-by: Ben Hutchings > --- > fs/xfs/xfs_icache.c | 73 +++++++++++++++++++++++++++++---------------- > 1 file changed, 48 insertions(+), 25 deletions(-) > > --- a/fs/xfs/xfs_icache.c > +++ b/fs/xfs/xfs_icache.c > @@ -133,6 +133,46 @@ xfs_inode_free( > } > > /* > + * If we are allocating a new inode, then check what was returned is > + * actually a free, empty inode. If we are not allocating an inode, > + * then check we didn't find a free inode. > + * > + * Returns: > + * 0 if the inode free state matches the lookup context > + * ENOENT if the inode is free and we are not allocating > + * EFSCORRUPTED if there is any state mismatch at all You changed the code but not the comment. Cheers, Dave. -- Dave Chinner dchinner@redhat.com