From: Chao Yu <chao@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: chao@kernel.org, Daeho Jeong <daehojeong@google.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: convert inline quota files when turning quota on
Date: Fri, 9 Oct 2026 16:55:08 +0800 [thread overview]
Message-ID: <296d69c0-b284-4186-a71d-9754df409690@kernel.org> (raw)
In-Reply-To: <20261004170456.4104287-1-daeho43@gmail.com>
On 10/5/26 01:04, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> With a block size larger than 4KB, the inline data area is large enough
> to hold a freshly created quota file (quotacheck writes 6KB), so
> aquota.user/aquota.group stay inline after quotaon. f2fs does not
> expect quota files to be inline, and this causes two problems:
>
> 1. Quota file corruption. f2fs_write_single_data_page() sends quota
> inodes straight to f2fs_do_write_data_page(), which sees NULL_ADDR
> for index 0, treats the folio as truncated and drops it. Updates to
> the quota file are lost once the folio is reclaimed, so the quota
> tree reads stale data: chown/chgrp fail with EIO and quota entries
> of users disappear. For example, the kernel log shows:
>
> find_free_dqentry: Data block full but it shouldn't
> qtree_write_dquot: Error -5 occurred while creating quota
>
> 2. Deadlock. Writing a quota file past MAX_INLINE_DATA converts it from
> f2fs_write_begin() under f2fs_lock_op(). dquot_transfer() is called
> from f2fs_setattr() with f2fs_lock_op() already held, so chown/chgrp
> take cp_rwsem for read twice and hang, together with the checkpoint
> and every other writer, once a checkpoint waits for cp_rwsem in
> between (seen with generic/232).
>
> Quota files only grow and there are at most MAXQUOTAS of them, so there
> is no point in keeping them inline. Convert them in f2fs_quota_on() and
> after dquot_quota_on_mount(), which keeps every block size on the same
> path as 4KB blocks, where quota files never fit inline. Quota sysfiles
> are created by mkfs with real blocks and are not affected.
>
Cc: stable@kernel.org
> Fixes: d7e9a9037de2 ("f2fs: Support Block Size == Page Size")
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
prev parent reply other threads:[~2026-10-09 8:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 17:04 Daeho Jeong
2026-10-09 8:55 ` Chao Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=296d69c0-b284-4186-a71d-9754df409690@kernel.org \
--to=chao@kernel.org \
--cc=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kernel-team@android.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®