Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3637047imu; Mon, 28 Jan 2019 08:13:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN6qaioErdDoostIuDgU7e0wa5f9OftkpZZxWAQszm2awn7zJTcT6bDuZy9w9jMqwFp9TPVY X-Received: by 2002:a62:1709:: with SMTP id 9mr22196955pfx.249.1548691992975; Mon, 28 Jan 2019 08:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691992; cv=none; d=google.com; s=arc-20160816; b=pxyR9B1z7QsHsVNtrhqSyuBAKIcgpToxxN/juXH2koIXUSHY1EWmrroK3fYQHqk+TV ihCyF4GqWSvPwFVZa++Fnz9hsKbOlKxIkEX/TR4imqplI5P0XktQLpq82zRR1bu9u9nr K40mLDSgfzpOpxS5/Xpbw3f1V165dDroXd+FAEq1ykeyiylzcLuLib+9dYJjsRfHPNW/ C/19EuZvAJ37XjQ0t0pM6/Ru8lFoqTvJF67Pa7QOehcHhjOzjpANBf1ZaoaAiM9vL4NA VGylG+erTNIXNArAaRiQJpJ/hG7QadTccG5XGJAyzJhIvPC2CGwsfMUFA7shBCl7AcEH YVUA== 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:date:subject:cc:to:from :dkim-signature; bh=D7+4fpujSizjU4NCfHGXhAkRExXkThQsVIFxDzEO6u4=; b=AT9AqDLbHsOsKDA3YbTc3uczwZef+mcubKBATOzpZsVMsG2H80nQdSA4tdl126R2rf w4IiCOwQ+7v6iKdSgWEznPNMDOwqAykmYLrIsU9UVIRFwZHtuEdSEFXqLnXjFAcvB6JH ZOb8sTPxJ09spory1eEUhC57MQ112qH0kT7kZEQjDW19p6f+Zi+wL9f45VRI5ztkckpM ywpOeNRmiN6IBuhDLv/jWsd49QB8f2xg0Bf3IARvO96lqv8/LDKwd06NtZ7hSKgkKSfM euC8QuFY933l69EiLGJYa1m4u3kvSGKHnnrYNkMcYonETyyO4L38A7oTK0rkQRP7de7n e+Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I7e4l+yX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u137si767555pfc.133.2019.01.28.08.12.56; Mon, 28 Jan 2019 08:13:12 -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=I7e4l+yX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732874AbfA1QKs (ORCPT + 99 others); Mon, 28 Jan 2019 11:10:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:37140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731666AbfA1QKs (ORCPT ); Mon, 28 Jan 2019 11:10:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4DD202171F; Mon, 28 Jan 2019 16:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691846; bh=y95Y1KI/N6rLEgcyNmQg1RV/Fg270A1Ccq0dvxxyCGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7e4l+yXfF49U2JscNTFxSBdJ2KotDB+DfEgIv7e2GfJUmtVt8RSjXCAgu2bP3jw7 F+mnF8SAetRTW5SjpKOHInx5GOWfu8U304PNwFfp97uSNg3YOXfTdPn7EpyUha7Xnw Jx+rXPQ9yuR94b8EgRRc9lX8QXgu12Teis/hH40Y= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Junxiao Bi , Joel Becker , Joseph Qi , Jun Piao , Mark Fasheh , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 4.19 236/258] ocfs2: don't clear bh uptodate for block read Date: Mon, 28 Jan 2019 10:59:02 -0500 Message-Id: <20190128155924.51521-236-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Junxiao Bi [ 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 1d098c3c00e0..9f8250df99f1 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c @@ -152,7 +152,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); @@ -306,7 +305,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