Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp820094imm; Thu, 26 Jul 2018 12:33:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfpvhemdBdtd/ufgxchKybz9FN+pec/HKROAB6SXt6na+UwqiIHp33iDvXoGfrUy4UFGE3C X-Received: by 2002:a62:5dd7:: with SMTP id n84-v6mr3487979pfj.68.1532633633241; Thu, 26 Jul 2018 12:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532633633; cv=none; d=google.com; s=arc-20160816; b=LvpjlZkd2DHQRFbWLeAET2cpp4KaqXM+701UnPltETfhAIynuZ8mCIm2IZJs3O7RGW UFoC2YAb9RFSBuu4ueL4WOsoC7bTJzQ6bBY33+HI747Z4a39PmhUlPixKQaGTtRW4jQG dfiK+T/OOG/Z4aegeRgcKrqEltuYZEtpMAIbq9u2dqzdKgAJL7JnV8qBD1jaSY3BnYbC M0+2XWu3nkK5ZrgOVO3zINPUfeLhsqVyNb8ar8O5wr+uRfTgmlXElGZky18L42S5vsA3 juym4SXjskfaMuo/HIMlBsBWZhUxP8iMekssI3SZon68X99qc3l4tqWVwW9exN9lGLvt UTNQ== 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:dkim-signature:arc-authentication-results; bh=yt4kpoukY38rdIpGr/GPy991LMUHvz5VJETbDc5y/RU=; b=iXAayi15YC+O0k+3HisMNdPxiafCVGJp1WNvuCX6MbJKaF15ovzswK5MFTGsTa/EgT 4JsWRVSw4WGg7pY2jBQCLG/xtnchiMECyl7zzRfSDNNHsO8IaPBmZUCN7+4ZUpO3fU7T J86XxOKtb3Qguqb9ZDSbdzIbXxGgS0meRb4yNg8ANx3348UHOBN8YCcd5/Nb0oyJnFtG HzihkV7dtJwmANWk9viiqHFEy1xLZdrIG5eiUl2QoIgaxyAGqVgDEyTk392OSDI/odZB cgSDXcISZzxZ1P9oqcQ1XPeBSJVGKRFN7vQ7//O42HrVGqhwd+69qn05MYWAoFgh6Kh9 jFMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HpCWFq0O; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si2192280pgx.60.2018.07.26.12.33.38; Thu, 26 Jul 2018 12:33:53 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HpCWFq0O; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731542AbeGZUuW (ORCPT + 99 others); Thu, 26 Jul 2018 16:50:22 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38002 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730452AbeGZUuW (ORCPT ); Thu, 26 Jul 2018 16:50:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yt4kpoukY38rdIpGr/GPy991LMUHvz5VJETbDc5y/RU=; b=HpCWFq0OHMmSVECucmTjEBCun 6iUUZtLOghbbhUN7Pt02eO3xQudojShuL1CM90R3F8kSDugice7zbnKP9USmDci4g3A2Bto77vsKw S84fM91pq7NKKnW4IzUDP8nLsMJQnpYcrj5dkPQSfRmpyx2gJ2B2FIJO1DrY2+xWSGtIqay8a8Zk5 D+OpC3IRdTpSOKjYZXYgI5MoQFSGpuj8Zn9D9G+7uevrgM8tERP49wQdJ5TnTiyzqCDp09ba8gVAf RflE9xNPwH2vANjOwpX9rvTYD7sGRXJTvJvDmx390HvAvQOTCNzLR4FJWmYqnRQi8R2zAYD0hqgtQ thQeDWJKQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1filzX-0002H3-7o; Thu, 26 Jul 2018 19:32:03 +0000 Date: Thu, 26 Jul 2018 12:32:03 -0700 From: Matthew Wilcox To: Hugh Dickins Cc: syzbot , "Kirill A. Shutemov" , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Subject: Re: kernel BUG at mm/shmem.c:LINE! Message-ID: <20180726193203.GA12992@bombadil.infradead.org> References: <20180723140150.GA31843@bombadil.infradead.org> <20180723203628.GA18236@bombadil.infradead.org> <20180723225454.GC18236@bombadil.infradead.org> <20180726143353.GA27612@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 09:40:20AM -0700, Hugh Dickins wrote: > On Thu, 26 Jul 2018, Matthew Wilcox wrote: > > On Wed, Jul 25, 2018 at 11:53:15PM -0700, Hugh Dickins wrote: > > > > and fixing the bug differently ;-) But many thanks for spotting it! > > I thought you might :) The xas_* functions are all _expected_ to behave the same way when passed an XA_STATE containing an error -- do nothing. xas_create_range() behaved that way initially, then I fixed a bug and broke that invariant. Now the test suite checks it so I won't break it again. > > I'll look into the next bug you reported ... > > No need: that idea now works a lot better when I use the initialized > "start", instead of the uninitialized "index". Ugh. xas_create_range() is _supposed_ to return with xas pointing to the first index in the range. I wonder what I messed up. I've had a go at producing a test-case for this and haven't provoked a bug yet. Still, I don't want to keep xas_create_range() around long-term. I want to transition all the places that currently use it to use multi-index entries. So I'm going to put your workaround in and then work on deleting xas_create_range() altogether. Thanks so much for all your work on this!