Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp935009iob; Fri, 13 May 2022 17:02:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgMI65jfkdNPlqnqsIV5NdFncQEIHcRKNYuW0SZ5Sjt9rcqaNecU/VAT7WOXu0DbnLdCnq X-Received: by 2002:a5d:5966:0:b0:20a:e810:5e9d with SMTP id e38-20020a5d5966000000b0020ae8105e9dmr5660587wri.240.1652486541488; Fri, 13 May 2022 17:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652486541; cv=none; d=google.com; s=arc-20160816; b=Iiss88HPtv7R+c+H3qaiSJFChowIoXdeLlcqSmfdEV/WImbjsZkiJqWksfAVrrvpxq Olm7tfvCVGs8eBWkOo/wIsqzjJjqS9J0IuOi+k5P1apHyrPyDep5bA7xDAj6igcQzjN5 0yoG3Ib3mEKrozDr1YdPLGVqE5EzG9tR+dk3uGjMG0QaUJUgdLFdYE2m88gW/DBPOytC 7iSOMgqUWDkPANw4vgRtuGHYoWJCZNazak8f6X6CaaQzf05vTDjpelg2NEJF4ysBSIUZ fh1zqbmokYrRjLDjhWN9GNV6CGXXI7ytMB7nHqCyJczRRzuqg7/kjpNmRLvUjD5kjI7V naiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=rBpy7E6Cj14l1+8iikhXSjL2fyVnnZWfiDoCBen76O0=; b=dVv0d7UA/GRqHW4FiW+7A1RDqNyYPvU3WigGmHaRIEOH8Wobl5dHAbMDJMJPDCFcwX ZKlMYLANNNQyCpgpd8ba4Oi8IL8M2FT65qfdT+TVLIhmWEKBsfKTdqWg8r81HIMOEUoZ GPVqgmnaYcHBTUT1xQ3cVJr+049Zaqn8ML3OznZv5U3FqRzyX/pqQTtaWvH/45T0Q8kS QgeSt/go3BxTffSBDOU+1PFvNes+CI3BFFnr/0+z8lQr/wyam0gF/3Jl94lZ/QLopW3/ Q1UpjMUJfZ/VMnKoHAMSr2cDlp9wmRM8/Zs6+SmUSlzJJUm0VO9q7zmHNXbqli3jFXZe r35A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linux-foundation.org header.s=korg header.b=z9kjB3Cu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i65-20020a1c3b44000000b0038c77be9c90si3553037wma.88.2022.05.13.17.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@linux-foundation.org header.s=korg header.b=z9kjB3Cu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5174D1F68D5; Fri, 13 May 2022 16:04:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359755AbiEMAm6 (ORCPT + 99 others); Thu, 12 May 2022 20:42:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbiEMAmu (ORCPT ); Thu, 12 May 2022 20:42:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA57606CF for ; Thu, 12 May 2022 17:42:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 07EAB6205A for ; Fri, 13 May 2022 00:42:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2DE7C385B8; Fri, 13 May 2022 00:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652402568; bh=n+YkgIXMbs5r/IrOg8NDKPb5pr+3M20tWFLhucxHzTw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=z9kjB3CuAN5ZwzDK7nRXCRFIMR2e3iFFqvaypZxsQnn2tBmW32umPWUIIWJIu7Ekt CzfUdZ0WXvcuwPdWqFBWhpVpY+gWfwUQe33y2QAZ9ifDzMDi/lKXfVIWoyq/vMIQEY 6v0CLYJ10ftLPxn14WLZs2y6JwdM0aY3rGgbSnp8= Date: Thu, 12 May 2022 17:42:47 -0700 From: Andrew Morton To: Miaohe Lin Cc: HORIGUCHI =?ISO-8859-1?Q?NAOYA?= (=?UTF-8?Q?=E5=A0=80=E5=8F=A3_?= =?UTF-8?Q?=E7=9B=B4=E4=B9=9F?=) , "willy@infradead.org" , "vbabka@suse.cz" , "dhowells@redhat.com" , "neilb@suse.de" , "david@redhat.com" , "apopple@nvidia.com" , "surenb@google.com" , "minchan@kernel.org" , "peterx@redhat.com" , "sfr@canb.auug.org.au" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/3] mm/swapfile: unuse_pte can map random data if swap read fails Message-Id: <20220512174247.c4e178334879fb6b10134c2c@linux-foundation.org> In-Reply-To: <2a95aebe-3a00-4699-12d4-fc5d934dde2c@huawei.com> References: <20220424091105.48374-1-linmiaohe@huawei.com> <20220424091105.48374-2-linmiaohe@huawei.com> <20220510061712.GA162496@hori.linux.bs1.fc.nec.co.jp> <2a95aebe-3a00-4699-12d4-fc5d934dde2c@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 May 2022 14:58:05 +0800 Miaohe Lin wrote: > >> Signed-off-by: Miaohe Lin > >> Acked-by: David Hildenbrand > > > > When I reproduced the issue (generated read error with dm-dust), I saw > > infinite loop in the while loop in shmem_unuse_inode() (and this happens > > even with this patch). I confirmed that shmem_swapin_page() returns -EIO, > > but shmem_unuse_swap_entries() does not return the error to the callers, > > so the while loop in shmem_unuse_inode() seems not break. > > > > Many thanks for your report! I didn't test the shmem case because I saw -EIO > is returned. So I just focus on the normal page case. Sorry about it. :( > > > So maybe you need more code around shmem_unuse_inode() to handle the error? > > I will try to reproduce it and come up a fixup patch asap! And if you like, you > can kindly solve this issue too. ;) Seems that this patch didn't cause the infinite loop, so as far as I can tell it is good to be merged up. But the problem it solves isn't urgent and fixing that infinite loop might impact this change so I think I'll drop this version.