Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4306146ybz; Mon, 20 Apr 2020 20:46:09 -0700 (PDT) X-Google-Smtp-Source: APiQypKps7EWo6ciTgTzatdwuB75pg+kw+bPXWZ6WvFHJlbKjKArJH2CRKNcawkmqk+u6I5xZHGF X-Received: by 2002:a50:bb2a:: with SMTP id y39mr16313689ede.292.1587440769813; Mon, 20 Apr 2020 20:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587440769; cv=none; d=google.com; s=arc-20160816; b=NNMdv9M7CtgBxqcKJQu8fkef76HSpUEcNstBWt8id/5M0/3aJv5fCsuqWMKSqdrMZT +GwCYEOMHxhYGFTbQnRFMlbnKMJ5RWUI60FbfsSrYuvFTOCZJvin+OrVyMSDCVt9n4mC W3ANFZsqfVFngpi8muBw0du688iY1zUZ6XEtjn8pDyyy1DWN+30S/fYivnYXrm5AU93i fi6wR+20Rb/WXgioRyguT0OIy29tuX9W5VB96wP1fU+HDd43M31Wn4HL6aBKMqwpI6qX VJEYTPoVTg6D5czSOB1c7RekN5q584VBy44JdfhbezR9lAT/lOTP0mP1TCf8XzXMb/M6 mc5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6bE0+y+ZYkLPpgKcegUYRiLhYFuXhCj++1JawXFMks8=; b=iWEnt6+XLnC6tvMkvTEhI/XUI4XxdkNi3Vj6M7bxUWjqkmkJsqRPDG9by9DSUbpxFy 3uyPmXLHkz19Fvd8FBWM2qG41adwPwAABfzTzMsN04GBOrJd+VN6m8HIS0eDMLiJdMbi WIncCHf0G3vBBWQIvOlpyT6ByXdEyI96+BjJzGU0a5NJeKKscCpvNjujTiUUn2P0zYM+ LMpR7iVlgK00yu/8/s2fggzhZFiKYt5Ofvn0GvIeiemGGRIN3M3Z0nzEEjY868w2oRhn OrUxYFPOoq4C0yWeKhJOKJAO0XUaXHs6s66cEhbYnrgdv07pw1nUNj0vwDmhbsvnkZDz +gYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h2+sTaQ9; 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 r11si813630edq.390.2020.04.20.20.45.47; Mon, 20 Apr 2020 20:46:09 -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; dkim=pass header.i=@kernel.org header.s=default header.b=h2+sTaQ9; 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 S1728503AbgDUDmE (ORCPT + 99 others); Mon, 20 Apr 2020 23:42:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727900AbgDUDmD (ORCPT ); Mon, 20 Apr 2020 23:42:03 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3978D2071E; Tue, 21 Apr 2020 03:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587440523; bh=pEWs0YVxnwM137MWzOatekWnY7m66tGMYW/Tb3G2/Sg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h2+sTaQ9C92+mNvG74s1lGlASAYFvm1PXnLkL9zCt8kUznsvq6OZI1vH4SpkUM+lh S5E2Vt4nzpvwGQWz5oDtE34stx98odqJca40dB3JNp3NlcioZ+7bc5VxXZYTt8K2tp 2ea4JhE3hUb9NX4Puf8Xqcmcz3P58ZNdCsGWjUGk= Date: Mon, 20 Apr 2020 20:42:02 -0700 From: Andrew Morton To: Xianting Tian Cc: , Subject: Re: [PATCH] mm/filemap.c: clear page error before actual read Message-Id: <20200420204202.96450f776ee42bdc39b191b8@linux-foundation.org> In-Reply-To: <20200303082541.33354-1-tian.xianting@h3c.com> References: <20200303082541.33354-1-tian.xianting@h3c.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Mar 2020 16:25:41 +0800 Xianting Tian wrote: > Mount failure issue happens under the scenario: > Application totally forked dozens of threads to mount the same > number of cramfs images separately in docker, but several mounts > failed with high probability. > Mount failed due to the checking result of the page > (read from the superblock of loop dev) is not uptodate after > wait_on_page_locked(page) returned in function cramfs_read: > wait_on_page_locked(page); > if (!PageUptodate(page)) { > ... > } > > The reason of the checking result of the page not uptodate: > systemd-udevd read the loopX dev before mount, because the status > of loopX is Lo_unbound at this time, so loop_make_request directly > trigger the calling of io_end handler end_buffer_async_read, which > called SetPageError(page). So It caused the page can't be set to > uptodate in function end_buffer_async_read: > if(page_uptodate && !PageError(page)) { > SetPageUptodate(page); > } I'm wondering whether we should instead be invalidating the blockdev's pagecache around the time of the loop binding. But it's hard to say because loop_make_request() hasn't existed for a long time. What kernel version are you working against? Are you able to test a (much) more recent kernel? If so, and if the problem persists, please update your problem description based on the current kernel code so that others can more easily go in and take a look, thanks.