From: Andreas Gruenbacher <agruenba@redhat.com>
To: gfs2@lists.linux.dev
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
syzbot+cb79de2cc8b76fbf474f@syzkaller.appspotmail.com
Subject: [PATCH] gfs2: No quotas for meta inodes
Date: Thu, 27 Aug 2026 11:06:37 +0200 [thread overview]
Message-ID: <20260827090637.676820-1-agruenba@redhat.com> (raw)
Inodes on the meta filesystem (mount -o meta) can never have quotas, so skip
them entirely in the quota code. This avoids allocating ip->i_qadata
unnecessarily.
Without this fix, unlinking meta inodes like "statfs" on the meta filesystem
will result in a NULL pointer dereference at unmount time:
gfs2_evict_inode() -> gfs2_dinode_dealloc() -> gfs2_quota_hold()
-> qdsb_get() -> slot_get() -> find_first_zero_bit(sd_quota_bitmap)
Unlinking inodes on the meta filesystem isn't a useful operation, but it still
shouldn't cause the kernel to misbehave.
Reported-by: syzbot+cb79de2cc8b76fbf474f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=cb79de2cc8b76fbf474f
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/quota.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index b62431724eea..dbfc21693dd5 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -562,6 +562,8 @@ int gfs2_qa_get(struct gfs2_inode *ip)
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
return 0;
+ if (ip->i_diskflags & GFS2_DIF_SYSTEM)
+ return 0;
spin_lock(&inode->i_lock);
if (ip->i_qadata == NULL) {
@@ -605,7 +607,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
return 0;
error = gfs2_qa_get(ip);
- if (error)
+ if (error || !ip->i_qadata)
return error;
qd = ip->i_qadata->qa_qd;
--
2.55.0
reply other threads:[~2026-08-27 9:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260827090637.676820-1-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=syzbot+cb79de2cc8b76fbf474f@syzkaller.appspotmail.com \
/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