From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 40B873D44BE for ; Thu, 22 Jan 2026 23:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769123408; cv=none; b=BoO2j0OW/5b1fgvYJwucO1cEizdS7ZEwrpSzosxEYGdrmHFJ5eztTOVILYXmNYpTMdDRcTnRjLkMFbO8slcJgLaZn7s0g+zW26PzCbxUI15lFLxu/X7MqMviHOI1W2BU8/PpF+++o1K4d1LfrdCwPO/LVRE2VVYllxFF5hVNLDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769123408; c=relaxed/simple; bh=MuVfXGFqvN4b9rtKnsw7f7k0jXBoLGLHcxbyWCpsDG0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hBw0sPVR6vk0g57pmVjr0OlcyR5LfXMeJfkuIPb8aYzGlxUeI0RRHbZAfWETQziirMpW+OGEqddJjBHHH0qrscocL+kI8/KHOy11LROm4/3kROXp4WZezKdg8CIddIY/tlaq4p5rgFp4oX+31IjwIM6s9yCWn++Hfv388EK2ZKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N771VZ06; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N771VZ06" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C8C5C116C6; Thu, 22 Jan 2026 23:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769123407; bh=MuVfXGFqvN4b9rtKnsw7f7k0jXBoLGLHcxbyWCpsDG0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N771VZ06ckyaVD5smskptolM6rLPMvk7CGaed3+ghoj6uMTd4oujKTL009NTnKB5/ SSnKxkGYQFtSn5aglULD60jmYlaIzuXL9HfTGWNuaG6sThXQQjePJ7PnYw6ME/MwxZ 7A1TYQ3WnLOOGadL5Mf8HaAVoqmQ3n+1VTCWmzkiid5q5akwsLFwgSvhzSUV/srRNj 2f1A+TXLe2oBY4XjRAWuLvnJPkptaicpdN9OcSTMoEC30XVVb5uEfRWztdSKuMspD2 ftnDPKJoI2fC+t+wNW09+oeO6/XFTkByBpooTQJBzhY+j7KBAnF/WS+eVChpUStiuX etmyhW8rKBD+A== Date: Thu, 22 Jan 2026 23:10:05 +0000 From: Jaegeuk Kim To: Nanzhe Zhao Cc: Chao Yu , Barry Song <21cnbao@gmail.com>, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to prevent clearing immutable for large folio supported inode Message-ID: References: <20260109024716.12047-1-chao@kernel.org> <2cdd4281-7e37-4dd0-91b1-1ab16ef772aa@kernel.org> <8c13ca69-a08a-41c7-bbef-0a79a5f44f93@kernel.org> <83419982-77ba-4dac-880e-bf59669a006f@126.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <83419982-77ba-4dac-880e-bf59669a006f@126.com> On 01/22, Nanzhe Zhao wrote: > Hi all: > > 在 2026/1/9 16:44, Chao Yu via Linux-f2fs-devel 写道: > > > w/ above locks, it seems there is still a race condition as below: > > > > f2fs_fileattr_set                read > >  - f2fs_setflags_common > >   - truncate_pagecache > >                         - f2fs_read_data_large_folio > >                         : read large folios > >   - mapping_set_folio_order_range > > > > Thanks, > > I noticed that the comment for `mapping_set_folio_order_range()` says: > > > "Context: This should not be called while the inode is active as it is non-atomic." > > I'm not sure whether cases like f2fs_fileattr_set falls into the inode > active case. > > > > > > > > > > If clearing immutable is indeed rare, we may leave this as is, since > > > writes are not supported until the page cache is fully dropped. > > > Eventually, we will support large folios on non-immutable files. > > > > > > Thanks > > > Barry > > Also, I couldn’t find any API in `include/linux/pagemap.h` that can > atomically set the > folio order range. However, I think dynamically setting large folio order > while an inode > is active is a reasonable requirement. In my non immutable file large folio > write work, I need to enable large folio support for a file when it is > converted from an inline file to a non-inline file. The lack of an atomic > API seems to be a blocker for moving large folio write forward. > Any idea on that? Yes, I was hitting some issues when I convert the mapping while inode is alive. So, for now, we should set it in f2fs_iget() only. > > Thanks, > Nanzhe Zhao >