Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2049073ybl; Tue, 3 Dec 2019 17:28:46 -0800 (PST) X-Google-Smtp-Source: APXvYqywJfn56tb6epQA1Ez0U0I0jhW8d6+lIPU2fgIIcjJtTk6OBQaYwBBkvgqbj9VTezJv0qmq X-Received: by 2002:a9d:178a:: with SMTP id j10mr771092otj.296.1575422926492; Tue, 03 Dec 2019 17:28:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575422926; cv=none; d=google.com; s=arc-20160816; b=mzPlMS6iWDRoWslRUC6KcNLL8oQtHbnMiSZn8J2ub4spdFLQgHL+5Ut+TBuSVGXDQZ Ef08g68bbPJWrF5CdrYsIkxvSUrIwmizDwJWsBeMrb/savoEYJNxtFF7D17o94FSMYvm 1+4AvqavHgN0tgYqByQvfVlebeee9xb26cb7Vq9d5m7HRxPkYUfDTwMRnKbt3XTDOT9d 5efDJLNow68lq4rE0Zw7jXmr+8dhFX6r1KJU6kwUotmLQk3VIU8wvn4Wa066KeIyewyo PPm0fx3o98vXEhhRumMha6l4mk03xhB+6JvG5GOkXce9Pi7jrkCjlBSSE8KzI05x7D88 DT/w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dIC6adU4O8MMU/MusJT5J2S09xXqRL9C9yOLIKjn1CY=; b=V9/IpM7E/qzcEEJPG8khBFU/frIH0QsNeGbqPlxFGTlkz4ZqQKuFoB1MHzuWRccqjl samE6SneQ2mEjjsIAoZyZUJCdwr/cRWSNIJ0KY7OHS8vFWvD6USXsLEeQiehYqZ5qLWS qbu5cWbU3xsnrUBH4gC3t4Yovf/372MW+RhQT3E2jSJEh+ve+HqMrTyHmET2XB0cDK95 7fdqvdMY650F/WrNTcGKEdutb7ZENUMUxGxILlDB7ouGiafTkK+ARoZWSR6NtyBFwEni nARdPJdVeSMK2FR7ET0tVtGcwv6Mz+VhR6tUDUd5560M7A+1M9/yC77aZ+Xnma54nHAH 7w/g== 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 d25si2213787otc.157.2019.12.03.17.28.33; Tue, 03 Dec 2019 17:28:46 -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 S1726319AbfLDB1w (ORCPT + 99 others); Tue, 3 Dec 2019 20:27:52 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7193 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726060AbfLDB1w (ORCPT ); Tue, 3 Dec 2019 20:27:52 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 056399E0601D957A6116; Wed, 4 Dec 2019 09:27:47 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.207) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 4 Dec 2019 09:27:44 +0800 Subject: Re: [PATCH v2] f2fs: Fix direct IO handling To: Jaegeuk Kim , Damien Le Moal CC: , , , Javier Gonzalez , Shinichiro Kawasaki References: <20191126075719.1046485-1-damien.lemoal@wdc.com> <20191126234428.GB20652@jaegeuk-macbookpro.roam.corp.google.com> <20191203173308.GA41093@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: <4eb6db72-8667-7306-e989-36b5d79289d0@huawei.com> Date: Wed, 4 Dec 2019 09:27:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20191203173308.GA41093@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/4 1:33, Jaegeuk Kim wrote: > Thank you for checking the patch. > I found some regressions in xfstests, so want to follow the Damien's one > like below. > > Thanks, > > === >>From 9df6f09e3a09ed804aba4b56ff7cd9524c002e69 Mon Sep 17 00:00:00 2001 > From: Jaegeuk Kim > Date: Tue, 26 Nov 2019 15:01:42 -0800 > Subject: [PATCH] f2fs: preallocate DIO blocks when forcing buffered_io > > The previous preallocation and DIO decision like below. > > allow_outplace_dio !allow_outplace_dio > f2fs_force_buffered_io (*) No_Prealloc / Buffered_IO Prealloc / Buffered_IO > !f2fs_force_buffered_io No_Prealloc / DIO Prealloc / DIO > > But, Javier reported Case (*) where zoned device bypassed preallocation but > fell back to buffered writes in f2fs_direct_IO(), resulting in stale data > being read. > > In order to fix the issue, actually we need to preallocate blocks whenever > we fall back to buffered IO like this. No change is made in the other cases. > > allow_outplace_dio !allow_outplace_dio > f2fs_force_buffered_io (*) Prealloc / Buffered_IO Prealloc / Buffered_IO > !f2fs_force_buffered_io No_Prealloc / DIO Prealloc / DIO > > Reported-and-tested-by: Javier Gonzalez > Signed-off-by: Damien Le Moal > Tested-by: Shin'ichiro Kawasaki > Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,