Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2751716imj; Mon, 11 Feb 2019 07:58:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9FvXlp+8fYnUJBY7PRtpc0QGT64R1aRumqW3eOqNHeZNwVvyTEI1OXu2TkFjifnOnzRCR X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr37345319plp.247.1549900712955; Mon, 11 Feb 2019 07:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900712; cv=none; d=google.com; s=arc-20160816; b=aOCJq361dDEfPQSTvPDy4xaIVTgVG4+gcjt20/sl4lNzcV+WfBy+b0JoEpy1/BEd4O RHz8wcAQ/VXn+sWnuEoKAvXKG6EMsfaIqJeA7lwxteS87d2xQprHCv8eilIUduW8OSeU 7e52lrHe5dUrXO1d6tgSY/NVPsXiF6FMnKoZ2JdJYzJKINBrDP4++v7H049VmRUJ7wb+ 2oAkX+CrrB5orw9Ou6J5HAoOFXYlR9JyxHvpU5rQGyuwTD7vp4CmyRp0rde8vYgVhs/Z Af9+stW47yGtQJlRr3XSiy8XPFeix2twxn3hwym5TpD4xzWMIfHw0GTsJGLRO0zr7Mlg An5w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MzqJMvAtjySX0U/qYC9IyeRxHfqC4VN2F3AYeGglows=; b=zQ77U9v0x26E4/7FO6DZv4wTVNhj39n/CgG4UD0UasWLfjWPbnBUsLhplemD0D7JXW sinJy9UU4O8e/+JYQHfJed5k6L5Oc1Cmeth/sTVsHzVv029XrkRKDrUFweKLr+x93g+D n18hREsbnnazIohcCS8bIf5F9b0CLKw2mVaSick8FK6flHOrRpDFBB99O+huXHYyZuGR PtYBDPgUFewzVAkfu8BQhCA9x0vlc0Z6QwzjXlRn9r+VEzwQoxKxP3+NorUfYl7Gxg19 waUz10vKqCmTnrK6CezM5etWvGAk/0TiG1XeXjkNbWF022/KNvl5hH7kyr+THhtdkHL6 sYBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ao18J2MV; 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 98si11129597pla.320.2019.02.11.07.58.16; Mon, 11 Feb 2019 07:58:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ao18J2MV; 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 S1730711AbfBKOdr (ORCPT + 99 others); Mon, 11 Feb 2019 09:33:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:41556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730689AbfBKOdm (ORCPT ); Mon, 11 Feb 2019 09:33:42 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 4F29C21855; Mon, 11 Feb 2019 14:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895621; bh=gEhwqgC+G2CNUoKzKepKpe3E8avKGv4LOBXQuzWLMLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ao18J2MV9G3mCpO0K3HRmxl709GQQUmq9GIdQ0fjr6xAAQhZ7VM/qvPEN+uCKcRbX JtjFuY73fw0/t+93WQEDSYk/DQYfRGPGvChlLxDVA2vYYmOHOhNNFUoKBNrZXNm5cH SQfCEnQxPAJcmPLvnIR5DHUzblSEzuLnPwsduUws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Junxiao Bi , Changwei Ge , Yiwen Jiang , Joel Becker , Joseph Qi , Jun Piao , Mark Fasheh , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.20 266/352] ocfs2: dont clear bh uptodate for block read Date: Mon, 11 Feb 2019 15:18:13 +0100 Message-Id: <20190211141903.943022204@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 70306d9dce75abde855cefaf32b3f71eed8602a3 ] For sync io read in ocfs2_read_blocks_sync(), first clear bh uptodate flag and submit the io, second wait io done, last check whether bh uptodate, if not return io error. If two sync io for the same bh were issued, it could be the first io done and set uptodate flag, but just before check that flag, the second io came in and cleared uptodate, then ocfs2_read_blocks_sync() for the first io will return IO error. Indeed it's not necessary to clear uptodate flag, as the io end handler end_buffer_read_sync() will set or clear it based on io succeed or failed. The following message was found from a nfs server but the underlying storage returned no error. [4106438.567376] (nfsd,7146,3):ocfs2_get_suballoc_slot_bit:2780 ERROR: read block 1238823695 failed -5 [4106438.567569] (nfsd,7146,3):ocfs2_get_suballoc_slot_bit:2812 ERROR: status = -5 [4106438.567611] (nfsd,7146,3):ocfs2_test_inode_bit:2894 ERROR: get alloc slot and bit failed -5 [4106438.567643] (nfsd,7146,3):ocfs2_test_inode_bit:2932 ERROR: status = -5 [4106438.567675] (nfsd,7146,3):ocfs2_get_dentry:94 ERROR: test inode bit failed -5 Same issue in non sync read ocfs2_read_blocks(), fixed it as well. Link: http://lkml.kernel.org/r/20181121020023.3034-4-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Changwei Ge Reviewed-by: Yiwen Jiang Cc: Joel Becker Cc: Joseph Qi Cc: Jun Piao Cc: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/ocfs2/buffer_head_io.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index 4ebbd57cbf84..f9b84f7a3e4b 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c @@ -161,7 +161,6 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, #endif } - clear_buffer_uptodate(bh); get_bh(bh); /* for end_buffer_read_sync() */ bh->b_end_io = end_buffer_read_sync; submit_bh(REQ_OP_READ, 0, bh); @@ -341,7 +340,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr, continue; } - clear_buffer_uptodate(bh); get_bh(bh); /* for end_buffer_read_sync() */ if (validate) set_buffer_needs_validate(bh); -- 2.19.1