Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2462178imu; Sun, 27 Jan 2019 05:41:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ybNxZlT1fSlvpzMkC7pvNq5teGWxCbj/nVzrLFpKVtHvnsPAZepMSC4YQFSwYtt6CLUOK X-Received: by 2002:a63:db02:: with SMTP id e2mr16714978pgg.419.1548596487327; Sun, 27 Jan 2019 05:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548596487; cv=none; d=google.com; s=arc-20160816; b=Au/IEG2m9mo7R8chKYXr41HhKYzufHxvGxGpA4UeX+Lt65Uq0S64MmiJJy2U9zn/40 25DkRYEBHRerHNGdozxogwa7jcNo9edQRSX1oqN+8lvJF7LDnP703yBTTz9ZVMERHt8K W988w+TinpRw0cMKleCApaZ9RRX19vegPVjQVvE5Asa9JFDQVcbINSDJV+Y6ARstNmyS GD0H+jgo1l4ENJxk8oRhNE8z31nNY/FuOpsJibszHZeHCOJUU8UdfW6aShm3FlLVcMIs j4P9Xe6vSiCzEEYpsUTrlfLYmW1WVcQlRnVAJXyZJyQAKZcdgGsi2fy993lOIbk/6z3y 5+EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Toom/0DbgGxU4BEn44B47yxtIad0TM8YuguFY17s0qg=; b=gJD1/7EizduIXc2EyuH2iGX6JaqEfJUoCiH8DuiGuqD4wKMdyIAPvDlYPGtfxfWLr4 YwtBuJRQitNS41Z5HmTu36RW8121Sszpqr/u5bWGRHcN6yOUiUK4b4NUJToliJCPoPkx DEAsQq8fV6Sht3fNoQl4sv9PNXUdmDHrhxuwlY2oTAN0mZRVTh/Aqe284hh0z8YSuv8b avJ/gDnroGo5o+Im3Zumbd998RnGtTqRFt9WINDmx5LZRnm02kMpLhA6cQRrUFioBi84 LK5xNyyUANw35aYANwxcEvZT4uZkqItiD2D9i52yR50+XjparKpvQMxK9xYZAJsjwJTG qHgg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si5455204plk.260.2019.01.27.05.41.12; Sun, 27 Jan 2019 05:41:27 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbfA0Njt (ORCPT + 99 others); Sun, 27 Jan 2019 08:39:49 -0500 Received: from smtprz15.163.net ([106.3.154.248]:52297 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726505AbfA0Njt (ORCPT ); Sun, 27 Jan 2019 08:39:49 -0500 Received: from 172.25.16.148 (unknown [172.25.16.148]) by freemail01.tom.com (Postfix) with ESMTP id 7E8E01C81B98 for ; Sun, 27 Jan 2019 21:15:46 +0800 (CST) Received: from 172.25.16.90 (HELO smtp.tom.com) ([172.25.16.90]) by localhost (TOM SMTP Server) with SMTP ID 279681272 for ; Sun, 27 Jan 2019 21:15:46 +0800 (CST) Received: from antispam1.tom.com (unknown [172.25.16.55]) by freemail01.tom.com (Postfix) with ESMTP id 4D5E51C81B92 for ; Sun, 27 Jan 2019 21:15:46 +0800 (CST) Received: from antispam1.tom.com (antispam1.tom.com [127.0.0.1]) by antispam1.tom.com (Postfix) with ESMTP id 424F6100170D for ; Sun, 27 Jan 2019 21:15:46 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam1.tom.com Received: from antispam1.tom.com ([127.0.0.1]) by antispam1.tom.com (antispam1.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Vfdivqtb8CF for ; Sun, 27 Jan 2019 21:15:45 +0800 (CST) Received: from localhost (unknown [222.209.19.163]) by antispam1.tom.com (Postfix) with ESMTPA id EC1801001582; Sun, 27 Jan 2019 21:15:44 +0800 (CST) From: Liu Xiang To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, liuxiang_1999@126.com, Liu Xiang Subject: [PATCH] fs: Reset fully_mapped more accurately Date: Sun, 27 Jan 2019 21:15:33 +0800 Message-Id: <1548594933-19399-1-git-send-email-liu.xiang6@zte.com.cn> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because get_block() might set the buffer mapped, reset fully_mapped after it is more accurately. Signed-off-by: Liu Xiang --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 52d024b..b2e9167 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2241,7 +2241,6 @@ int block_read_full_page(struct page *page, get_block_t *get_block) if (!buffer_mapped(bh)) { int err = 0; - fully_mapped = 0; if (iblock < lblock) { WARN_ON(bh->b_size != blocksize); err = get_block(inode, iblock, bh, 0); @@ -2249,6 +2248,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block) SetPageError(page); } if (!buffer_mapped(bh)) { + fully_mapped = 0; zero_user(page, i * blocksize, blocksize); if (!err) set_buffer_uptodate(bh); -- 1.9.1