From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8081529405 for ; Wed, 19 Aug 2026 01:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787104030; cv=none; b=iYRkQV/2IdFyLdXGMq5JkE/UhjPIQp9J9+eBDz56thkkIrjE2QPfdy0wL9z55Y3qgB6QpxF+eCSPAboBBn50XqZ2WTbwF4fv4Hv/4DupZyXx0cWHAPZJGjiQ9WeQ0X4mw5qXsLNapoXyOh11YClkBgHAgvnceTY8xRYSK1XeJ8s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787104030; c=relaxed/simple; bh=ZwT42f7vIxT9CsIvf4ZfCj3BxW7WyIf1YHF+ZXWYjrM=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=pYK73bhgvggmO6maShymGbUya3FrB+ePrqxAKYEMwlovV+tyv1vaW/euPCbeej/KJfCmb6BySGinrCZ1s9G5L+ykN0eqsGL6VPSYVFqBc2O5G54W5+JIHf5LXfUTFofkAi8uGLX4kAdLdRnyqXDPRUrQAUND/jeU6IbHKVgbC3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hgyO5vL7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hgyO5vL7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F07671F000E9; Wed, 19 Aug 2026 01:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787104029; bh=qoQwe2sWJ0MbRaZViAD/nPZTyI4dpqFu3NiN2Dfommo=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=hgyO5vL78VktH1YqCIX6i9q2EYBTyZtVi2RDnzd8+kFcAqwNLJt1tb1hFMO0Io2Oi ASxrdfSL6fQ20VnwO1/AB9nHEKOiTtTzPNE1vT7KXWro5jwSHajqdCaK3TNXtBstu5 /4zsvonEFoRPzEjAruGj02rsdbgf+bbWopaDJVtrUNcNyKDD2CxV7Zk1rwcqgROqRt U020kGYd1U3nH8oBdCzY/0UOEX1keJgykX7Q/DADONOWROEpw6cUlRsyBHuOlNCPWZ s24TIBKvT4vt3LcNsymho6CnpveFKVdCR0/3denWZkgGUaktMWmdV0X02rw6YsUutD KMevdVXED/i5g== Message-ID: Date: Wed, 19 Aug 2026 09:47:06 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, jaegeuk@kernel.org, hans.holmberg@wdc.com, yonggil.song@samsung.com, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: fix O_DIRECT cleanup range for append writes To: =?UTF-8?B?7KCV7ISx7J6s?= References: <20260814105234.31620-1-jsjlee1020@gmail.com> <2a3d8702-f7fd-4013-8181-d9fd68b6aa18@kernel.org> Content-Language: en-US From: Chao Yu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 8/18/26 20:23, 정성재 wrote: >> If generic_write_checks() can adjust writing position or amount of bytes >> to write, shouldn't we access iocb->ki_pos and iov_iter_count(from) after >> generic_write_checks()? > > Yes, agreed. generic_write_checks() can adjust both iocb->ki_pos and > the iterator count. > > I noticed that the pinned file overwrite check uses pos and count > saved before f2fs_write_checks(). I plan to keep the check in > f2fs_file_write_iter(), but move it after f2fs_write_checks() and use > the adjusted iocb->ki_pos and iov_iter_count(from). Yeah, I think it's the correct way. > > This also keeps the change local to f2fs_file_write_iter(), where other > checks are already performed after f2fs_write_checks(). > > For the buffered cleanup, as in my original patch, I plan to save the > adjusted write position after f2fs_write_checks() and use it for > f2fs_flush_buffered_write(). > > Does this approach look reasonable to you? It make sense, please go ahead. :) Thanks, > > Thanks, > Seongjae