Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1172114imn; Sat, 30 Jul 2022 18:46:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s6fqT+yJeUK6mWscbfHs57VmGg5ZseqQcw6G0lRqCmbtf+PLxEpyLG5XL6NiHoYRzReMZS X-Received: by 2002:a17:906:8cb0:b0:72f:367e:9986 with SMTP id qr48-20020a1709068cb000b0072f367e9986mr7512418ejc.80.1659231995961; Sat, 30 Jul 2022 18:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659231995; cv=none; d=google.com; s=arc-20160816; b=I/f5+ZGe/Ysx4/dJ5hNE2kyA510zcsCK5hqjNmTYu0lB3AakInTa8IQ17XvgY/o9Er yZYiB2BWbeif8JXPSEhHucWwP5BlPKGjlaJDQBXEKMbC0SW3NR1uxCuWlrzAOnkfBxFo tcuWlwgjcnL/s5mmVn5PeBTUu/Mh9YNEfyiSrJTmiVNnkGLfsud7FuL8R7Q80mOGQ1nS CTBaR5w1ak5QBHlFvnlXdR6rKe7E5K09kuK0imoA1xc+DrsU/7SGdFJSh4A+mdKe0TQd Xblga97BKUe9PNR1hVJug5t9+xp1za+wWpx73VHAoS9KfOXztsYap7kL+eNtWaFD4P3f zM8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qGj47q4U4eWFtFInEPXN82v0q9c9JAnOMKZy8uCAcr4=; b=xyug/5nwy4E/nGjJerZ8OLqHVpjqZ+M/xfkkzwsgipp5InyGjRLkN/xLFAVbTmnmcd O8H4McPYot4jidkg/FfK3R8vErcvkOqN+dBum0Kpc4L2rNgxVT1TUNmlx+JJ3XVEd27O Gw6Tk+MUoqnXqKxBqFg2Fwf1VVfwq7+5RzG6gDZfDh+rx5mhntk9cr0qW6fljtm9biOz e7DtXiMRjS1wC+uPcIKW2AUBy93xqIaRxD5ONcz56TyWFJFJvVnhNM5dvLbTk6lxg4Cd SRADzD9W8wzo9Qn4gxO3ZOMr6YSLnJlMmMz8m1juBcFLeGQysxPMNCTq/RnNEA7KnYqf mE7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gqzl88ia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a17090695c200b0072f1d74b76bsi6062661ejy.595.2022.07.30.18.45.51; Sat, 30 Jul 2022 18:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gqzl88ia; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231156AbiGaBWX (ORCPT + 99 others); Sat, 30 Jul 2022 21:22:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiGaBWV (ORCPT ); Sat, 30 Jul 2022 21:22:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D6113E1B for ; Sat, 30 Jul 2022 18:22:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F309360FE5 for ; Sun, 31 Jul 2022 01:22:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32D43C433C1; Sun, 31 Jul 2022 01:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659230539; bh=+JDFzr0rIHbOOzwsVagV8xXUPfCyfziwvLXSfsBNeR0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gqzl88ia55Ui5VHLB6miDo0pdctIC5Q8hh2HKpECT/grdBP0+22WCMvIoxEDR+nDt Wvq72HAVzcJa7/0aKQDVAyKDKLiL9XlvwntvQn/Aw+9KV/+a6ORsOTki7HOB28I/FC wgL7YZMb+beK21aEKyE6bAYyXv0z/VkafPIM/5YeWqomRQHhOlWwYIWr0nB1UToa+o XVI0xe8oieflGXlH+edthBmUepMJrRkftJTi3MqGNbm5tC4R3Xzh9NzvYzjchvnJiS XyblyC1FdMXHYechJn9CToWTApwdpBZTTzaLkKHi1dEuAZRw0KpY0qOiJtwjRdiJoY 1+brv9oTWs57A== Date: Sat, 30 Jul 2022 18:22:17 -0700 From: Jaegeuk Kim To: Eunhee Rho Cc: "chao@kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v0] f2fs: allow direct read for zoned device Message-ID: References: <20220729002517epcms2p35eed262c3349287436c1848ab350c2d4@epcms2p3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220729002517epcms2p35eed262c3349287436c1848ab350c2d4@epcms2p3> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/29, Eunhee Rho wrote: > For zoned devices, f2fs forbids direct IO and forces buffered IO > to serialize write IOs. However, the constraint does not apply to > read IOs. > > Signed-off-by: Eunhee Rho > --- > fs/f2fs/f2fs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index d0f428aef34b..f69731f17402 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -4471,7 +4471,7 @@ static inline bool f2fs_force_buffered_io(struct inode *inode, > * for blkzoned device, fallback direct IO to buffered IO, so > * all IOs can be serialized by log-structured write. > */ > - if (f2fs_sb_has_blkzoned(sbi)) > + if (f2fs_sb_has_blkzoned(sbi) && (rw == WRITE)) > return true; Actually we don't need to check the device type, but rely on the filesystem allocation policy like the below lfs mode. Can we remove this line simply? > if (f2fs_lfs_mode(sbi) && (rw == WRITE)) { > if (block_unaligned_IO(inode, iocb, iter)) > -- > 2.25.1