Skip to contentSkip to conversation

ext4: protect quota acquisition against filesystem freezing

PATCH In review Ye Bin 4 participants 9 messages Nov 25

Subsystems (3)
lore
Share & tools
lore

Ye Bin

author
#0 lore raw

v2 cover ext4: protect quota acquisition against filesystem freezing

From: Ye Bin <[email protected]>

This series fixes quota operations running against a frozen filesystem, and the resulting freeze protection for ext4's dquot acquisition.

Patch 1 makes Q_XGETQUOTA/Q_XGETNEXTQUOTA consistent with Q_GETQUOTA and Q_GETNEXTQUOTA and forbids them on a frozen filesystem. These commands may end up in ->acquire_dquot() when the queried dquot is not cached yet, and thus may write to the filesystem, just like Q_GETQUOTA/Q_GETNEXTQUOTA which commit ccf370e43e08 ("quota: Forbid Q_GETQUOTA and Q_GETNEXTQUOTA for frozen filesystem") already handles. They were historically treated as read-only because they come from XFS, where quota is always coherent, but generic quota now routes them through dquot_get_dqblk()/ dquot_get_next_dqblk() and dqget(). Running them on a frozen filesystem makes ext4 start a transaction on it and warn. As suggested by Jan, they are now handled exactly like the generic commands, including taking write access, so a Q_XGETQUOTA on a read-only mount will report -EROFS; proper read-only querying can be added later if somebody actually needs it.

Patch 2 protects ext4_acquire_dquot() itself. A writable open reaches the filesystem's ->open() callback without superblock freeze protection, so ext4_file_open() -> dquot_file_open() -> dquot_initialize() can acquire a dquot and start a transaction after the filesystem has been frozen. Take sb_start_intwrite() around ext4_acquire_dquot() when no transaction is already running; running transactions are already protected against freezing.

Patch 2 relies on the preceding patch 1. Taking freeze protection in ext4_acquire_dquot() while holding s_umount, as the Q_XGETQUOTA and Q_XGETNEXTQUOTA paths do, would deadlock against thaw_super(), which needs s_umount exclusively to release the SB_FREEZE_FS protection. Patch 1 forbids those commands on a frozen filesystem and thus makes the new protection in patch 2 safe. Both patches must be applied together.

Ye Bin (2):
quota: Forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA for frozen filesystem
ext4: protect ext4_acquire_dquot against freezing

 fs/ext4/super.c  | 20 +++++++++++++++++++-
 fs/quota/quota.c |  9 ++++-----
 2 files changed, 23 insertions(+), 6 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/2 quota: Forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA for frozen filesystem

From: Ye Bin <[email protected]>

Commit ccf370e43e08 (quota: Forbid Q_GETQUOTA and Q_GETNEXTQUOTA for frozen filesystem) forbade Q_GETQUOTA and Q_GETNEXTQUOTA on a frozen filesystem because ext4_acquire_dquot() prepares for allocating space for a new quota structure and OCFS2 needs to update the on-disk structure use count when a new cluster node loads quota information from disk. The same applies to Q_XGETQUOTA and Q_XGETNEXTQUOTA: userspace treats them as read-only commands, but if the queried dquot is not cached yet, ->get_dqblk()/->get_nextdqblk() call dqget() -> ->acquire_dquot(), which may write to the filesystem.

Until now this only made ext4 warn about starting a transaction on a frozen filesystem. Now that ext4_acquire_dquot() also takes sb_start_intwrite() to protect against freezing, it turns into a
deadlock: the query holds s_umount for reading and blocks on the SB_FREEZE_FS freeze protection, which thaw_super() can only release after taking s_umount exclusively.

So forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA on a frozen filesystem as well by moving them out of the read-only set in quotactl_cmd_write(), just like Q_GETQUOTA and Q_GETNEXTQUOTA. This also makes quotactl_fd() take write access for them, so a query on a read-only mount now fails with -EROFS; that is the same behavior the generic quota commands already have. If someone needs read-only querying on a frozen or read-only filesystem, proper read-only dquot lookup can be implemented separately.

---
 fs/quota/quota.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
fs/quota/quota.c +4 -5
index 94e6407734c7..1669bb09b9f7 100644
@@ -834,9 +834,10 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
 static int quotactl_cmd_write(int cmd)
 {
 	/*
-	 * We cannot allow Q_GETQUOTA and Q_GETNEXTQUOTA without write access
-	 * as dquot_acquire() may allocate space for new structure and OCFS2
-	 * needs to increment on-disk use count.
+	 * We cannot allow Q_GETQUOTA, Q_GETNEXTQUOTA, Q_XGETQUOTA and
+	 * Q_XGETNEXTQUOTA without write access as dquot_acquire() may allocate
+	 * space for new structure and OCFS2 needs to increment on-disk use
+	 * count.
 	 */
 	switch (cmd) {
 	case Q_GETFMT:
@@ -844,8 +845,6 @@ static int quotactl_cmd_write(int cmd)
 	case Q_SYNC:
 	case Q_XGETQSTAT:
 	case Q_XGETQSTATV:
-	case Q_XGETQUOTA:
-	case Q_XGETNEXTQUOTA:
 	case Q_XQUOTASYNC:
 		return 0;
 	}
Signature · 1 line
2.34.1
reviewer Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] quota: Forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA for frozen filesystem

[added fsdevel to CC since people there might be interested as well, keeping patch intact]

Quoted 27 lines · Ye Bin

From: Ye Bin <[email protected]>

Commit ccf370e43e08 (quota: Forbid Q_GETQUOTA and Q_GETNEXTQUOTA for frozen filesystem) forbade Q_GETQUOTA and Q_GETNEXTQUOTA on a frozen filesystem because ext4_acquire_dquot() prepares for allocating space for a new quota structure and OCFS2 needs to update the on-disk structure use count when a new cluster node loads quota information from disk. The same applies to Q_XGETQUOTA and Q_XGETNEXTQUOTA: userspace treats them as read-only commands, but if the queried dquot is not cached yet, ->get_dqblk()/->get_nextdqblk() call dqget() -> ->acquire_dquot(), which may write to the filesystem.

Until now this only made ext4 warn about starting a transaction on a frozen filesystem. Now that ext4_acquire_dquot() also takes sb_start_intwrite() to protect against freezing, it turns into a
deadlock: the query holds s_umount for reading and blocks on the SB_FREEZE_FS freeze protection, which thaw_super() can only release after taking s_umount exclusively.

So forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA on a frozen filesystem as well by moving them out of the read-only set in quotactl_cmd_write(), just like Q_GETQUOTA and Q_GETNEXTQUOTA. This also makes quotactl_fd() take write access for them, so a query on a read-only mount now fails with -EROFS; that is the same behavior the generic quota commands already have. If someone needs read-only querying on a frozen or read-only filesystem, proper read-only dquot lookup can be implemented separately.

Quoted 2 lines

Looks good. Feel free to add:

Honza

Quoted 34 lines
---
 fs/quota/quota.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
fs/quota/quota.c +4 -5
index 94e6407734c7..1669bb09b9f7 100644
@@ -834,9 +834,10 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
 static int quotactl_cmd_write(int cmd)
 {
 	/*
-	 * We cannot allow Q_GETQUOTA and Q_GETNEXTQUOTA without write access
-	 * as dquot_acquire() may allocate space for new structure and OCFS2
-	 * needs to increment on-disk use count.
+	 * We cannot allow Q_GETQUOTA, Q_GETNEXTQUOTA, Q_XGETQUOTA and
+	 * Q_XGETNEXTQUOTA without write access as dquot_acquire() may allocate
+	 * space for new structure and OCFS2 needs to increment on-disk use
+	 * count.
 	 */
 	switch (cmd) {
 	case Q_GETFMT:
@@ -844,8 +845,6 @@ static int quotactl_cmd_write(int cmd)
 	case Q_SYNC:
 	case Q_XGETQSTAT:
 	case Q_XGETQSTATV:
-	case Q_XGETQUOTA:
-	case Q_XGETNEXTQUOTA:
 	case Q_XQUOTASYNC:
 		return 0;
 	}
Signature · 1 line
2.34.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#3 lore raw

PATCH v2 2/2 ext4: protect ext4_acquire_dquot against freezing

In reply to Ye Bin

From: Ye Bin <[email protected]>

A writable open of a regular file reaches the filesystem's ->open() callback without holding any superblock write (freeze) protection, but ext4_file_open() -> dquot_file_open() -> dquot_initialize() may need to acquire a dquot and write the quota file. If the filesystem reaches SB_FREEZE_COMPLETE in that window, ext4_journal_check_start() hits

	WARN_ON(sb->s_writers.frozen == SB_FREEZE_COMPLETE);

and the open then sleeps in jbd2 until the filesystem is thawed.

Taking freeze protection for every writable open in the VFS would make a plain open(O_WRONLY) on a frozen filesystem block even when it never writes, which is an unacceptable behaviour change. Instead protect the quota acquisition path itself: take sb_start_intwrite() around ext4_acquire_dquot() when no transaction is already running. Running transactions are already protected against freezing and taking sb_start_intwrite() inside one can deadlock.

This protection relies on the preceding quota change ("quota: Forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA for frozen filesystem"). Those commands are treated as read-only and run with s_umount held for reading, but they can still reach ext4_acquire_dquot(). Taking sb_start_intwrite() there would deadlock against thaw_super(), which can only release the SB_FREEZE_FS protection after taking s_umount exclusively. The preceding change forbids those commands on a frozen filesystem, which makes the new protection safe, so both patches have to be applied together.

Fixes 907f4554e252 ("dquot: move dquot initialization responsibility into the filesystem")
---
 fs/ext4/super.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
fs/ext4/super.c +19 -1
index d0415e5948e1..fc63219f5972 100644
@@ -7110,11 +7110,25 @@ static int ext4_acquire_dquot(struct dquot *dquot)
 {
 	int ret, err;
 	handle_t *handle;
+	bool freeze_protected = false;
+
+	/*
+	 * Trying to sb_start_intwrite() in a running transaction
+	 * can result in a deadlock. Further, running transactions
+	 * are already protected from freezing.
+	 */
+	if (!ext4_journal_current_handle()) {
+		sb_start_intwrite(dquot->dq_sb);
+		freeze_protected = true;
+	}
 
 	handle = ext4_journal_start(dquot_to_inode(dquot), EXT4_HT_QUOTA,
 				    EXT4_QUOTA_INIT_BLOCKS(dquot->dq_sb));
-	if (IS_ERR(handle))
+	if (IS_ERR(handle)) {
+		if (freeze_protected)
+			sb_end_intwrite(dquot->dq_sb);
 		return PTR_ERR(handle);
+	}
 	ret = dquot_acquire(dquot);
 	if (ret < 0)
 		ext4_error_err(dquot->dq_sb, -ret,
@@ -7123,6 +7137,10 @@ static int ext4_acquire_dquot(struct dquot *dquot)
 	err = ext4_journal_stop(handle);
 	if (!ret)
 		ret = err;
+
+	if (freeze_protected)
+		sb_end_intwrite(dquot->dq_sb);
+
 	return ret;
 }
 
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v2 2/2] ext4: protect ext4_acquire_dquot against freezing

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] ext4: misplaced sb_end_intwrite() in ext4_write_dquot() instead of acquire - [High] ext4: s_umount…

Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [High] ext4: misplaced sb_end_intwrite() in ext4_write_dquot() instead of acquire
- [High] ext4: s_umount vs SB_FREEZE_FS deadlock in ext4_acquire_dquot() via vfs_ustat()
--

commit 365cb575bc6d55af6ebb9f261bcac19d705f99d4
Author: Ye Bin <[email protected]>

ext4: protect ext4_acquire_dquot against freezing

This commit takes sb_start_intwrite() around ext4_acquire_dquot() when no journal transaction is currently active to protect dquot acquisition against filesystem freezing.

Quoted 5 lines
fs/ext4/super.c +0 -0
index 880f664d6c04b..769cae2ae65ff 100644

fs/ext4/super.c static int ext4_write_dquot(struct dquot *dquot) · line 7169

Quoted 9 lines
fs/ext4/super.c +4 -0
@@ -7161,6 +7161,10 @@ static int ext4_write_dquot(struct dquot *dquot)
 	err = ext4_journal_stop(handle);
 	if (!ret)
 		ret = err;
+
+	if (freeze_protected)
+		sb_end_intwrite(dquot->dq_sb);
+
 	return ret;
 }

[Severity: High]
Was this sb_end_intwrite() hunk meant for the end of ext4_acquire_dquot() instead of ext4_write_dquot()? freeze_protected is not declared in ext4_write_dquot(), breaking the build when CONFIG_QUOTA is enabled, and ext4_acquire_dquot() never releases SB_FREEZE_FS after ext4_journal_stop().

Quoted 5 lines
fs/ext4/super.c +1 -0
@@ -7168,11 +7172,25 @@ static int ext4_acquire_dquot(struct dquot *dquot)
 {
 	int ret, err;
 	handle_t *handle;
+	bool freeze_protected = false;

fs/ext4/super.c static int ext4_acquire_dquot(struct dquot *dquot) · line 7185

Quoted 10 lines
fs/ext4/super.c +10 -0
+
+	/*
+	 * Trying to sb_start_intwrite() in a running transaction
+	 * can result in a deadlock. Further, running transactions
+	 * are already protected from freezing.
+	 */
+	if (!ext4_journal_current_handle()) {
+		sb_start_intwrite(dquot->dq_sb);
+		freeze_protected = true;
+	}

[Severity: High]
Can calling sb_start_intwrite() here cause an ABBA deadlock between s_umount and SB_FREEZE_FS when ustat(2) runs on a frozen filesystem?

Unlike Q_XGETQUOTA, vfs_ustat() acquires s_umount for reading via user_get_super(dev, false) without checking whether the filesystem is frozen, then calls statfs_by_dentry(s->s_root, sbuf) -> ext4_statfs(). When the root directory has EXT4_INODE_PROJINHERIT set and project quota limits are enabled, ext4_statfs() calls ext4_statfs_project() -> dqget(). If the root directory's project dquot is not active in cache, dqget() invokes ext4_acquire_dquot() with no running transaction:

CPU0 CPU1
---- ----
down_read(&s->s_umount)

                                  down_write(&sb->s_umount)

sb_start_intwrite(dquot->dq_sb)
sb_freeze_unlock(sb, SB_FREEZE_FS)

*** DEADLOCK ***

CPU0: vfs_ustat() -> ext4_statfs() -> ext4_statfs_project() -> dqget() ->
ext4_acquire_dquot()
CPU1: thaw_super() -> super_lock_excl() -> thaw_super_locked()

Because CPU0 blocks on SB_FREEZE_FS while holding s_umount for reading, thaw_super() cannot acquire s_umount exclusively to unfreeze the filesystem.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

Re: [PATCH v2 2/2] ext4: protect ext4_acquire_dquot against freezing

In reply to Ye Bin
kernel test robot noticed the following build errors:

Hi Ye,

kernel test robot noticed the following build errors:

[auto build test ERROR on tytso-ext4/dev]
[also build test ERROR on linus/master v7.4-rc4]
[cannot apply to brauner-vfs/vfs.all next-20261124]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ye-Bin/quota-Forbid-Q_XGETQUOTA-and-Q_XGETNEXTQUOTA-for-frozen-filesystem/20261125-191054
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
patch link:    https://lore.kernel.org/r/20261125111055.3672233-3-yebin%40huaweicloud.com
patch subject: [PATCH v2 2/2] ext4: protect ext4_acquire_dquot against freezing
config: hexagon-defconfig (https://download.01.org/0day-ci/archive/20261125/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 2012344e5da8e03ea4b8283ecd6fad6e13f09d64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261125/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

>> fs/ext4/super.c:7165:6: error: use of undeclared identifier 'freeze_protected'; did you mean 'freeze_processes'?
    7165 |         if (freeze_protected)
         |             ^~~~~~~~~~~~~~~~
         |             freeze_processes
   include/linux/freezer.h:84:19: note: 'freeze_processes' declared here
      84 | static inline int freeze_processes(void) { return -ENOSYS; }
         |                   ^
>> fs/ext4/super.c:7165:6: warning: address of function 'freeze_processes' will always evaluate to 'true' [-Wpointer-bool-conversion]
    7165 |         if (freeze_protected)
         |         ~~  ^~~~~~~~~~~~~~~~
   fs/ext4/super.c:7165:6: note: prefix with the address-of operator to silence this warning
    7165 |         if (freeze_protected)
         |             ^
         |             &

1 warning and 1 error generated.

vim +7165 fs/ext4/super.c

7144
7145 static int ext4_write_dquot(struct dquot *dquot)
7146 {
7147 int ret, err;
7148 handle_t *handle;
7149 struct inode *inode;
7150
7151 inode = dquot_to_inode(dquot);
7152 handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
7153 EXT4_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
7154 if (IS_ERR(handle))
7155 return PTR_ERR(handle);
7156 ret = dquot_commit(dquot);
7157 if (ret < 0)
7158 ext4_error_err(dquot->dq_sb, -ret,
7159 "Failed to commit dquot type %d",
7160 dquot->dq_id.type);
7161 err = ext4_journal_stop(handle);
7162 if (!ret)
7163 ret = err;
7164

> 7165		if (freeze_protected)

7166 sb_end_intwrite(dquot->dq_sb);
7167
7168 return ret;
7169 }
7170

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reviewer Reviewed-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] ext4: protect ext4_acquire_dquot against freezing

In reply to Ye Bin
Quoted 29 lines · Ye Bin

From: Ye Bin <[email protected]>

A writable open of a regular file reaches the filesystem's ->open() callback without holding any superblock write (freeze) protection, but ext4_file_open() -> dquot_file_open() -> dquot_initialize() may need to acquire a dquot and write the quota file. If the filesystem reaches SB_FREEZE_COMPLETE in that window, ext4_journal_check_start() hits

	WARN_ON(sb->s_writers.frozen == SB_FREEZE_COMPLETE);

and the open then sleeps in jbd2 until the filesystem is thawed.

Taking freeze protection for every writable open in the VFS would make a plain open(O_WRONLY) on a frozen filesystem block even when it never writes, which is an unacceptable behaviour change. Instead protect the quota acquisition path itself: take sb_start_intwrite() around ext4_acquire_dquot() when no transaction is already running. Running transactions are already protected against freezing and taking sb_start_intwrite() inside one can deadlock.

This protection relies on the preceding quota change ("quota: Forbid Q_XGETQUOTA and Q_XGETNEXTQUOTA for frozen filesystem"). Those commands are treated as read-only and run with s_umount held for reading, but they can still reach ext4_acquire_dquot(). Taking sb_start_intwrite() there would deadlock against thaw_super(), which can only release the SB_FREEZE_FS protection after taking s_umount exclusively. The preceding change forbids those commands on a frozen filesystem, which makes the new protection safe, so both patches have to be applied together.

Quoted 3 lines
Fixes 907f4554e252 ("dquot: move dquot initialization responsibility into the filesystem")

Looks good. Feel free to add:

Honza

Quoted 49 lines
---
 fs/ext4/super.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
fs/ext4/super.c +19 -1
index d0415e5948e1..fc63219f5972 100644
@@ -7110,11 +7110,25 @@ static int ext4_acquire_dquot(struct dquot *dquot)
 {
 	int ret, err;
 	handle_t *handle;
+	bool freeze_protected = false;
+
+	/*
+	 * Trying to sb_start_intwrite() in a running transaction
+	 * can result in a deadlock. Further, running transactions
+	 * are already protected from freezing.
+	 */
+	if (!ext4_journal_current_handle()) {
+		sb_start_intwrite(dquot->dq_sb);
+		freeze_protected = true;
+	}
 
 	handle = ext4_journal_start(dquot_to_inode(dquot), EXT4_HT_QUOTA,
 				    EXT4_QUOTA_INIT_BLOCKS(dquot->dq_sb));
-	if (IS_ERR(handle))
+	if (IS_ERR(handle)) {
+		if (freeze_protected)
+			sb_end_intwrite(dquot->dq_sb);
 		return PTR_ERR(handle);
+	}
 	ret = dquot_acquire(dquot);
 	if (ret < 0)
 		ext4_error_err(dquot->dq_sb, -ret,
@@ -7123,6 +7137,10 @@ static int ext4_acquire_dquot(struct dquot *dquot)
 	err = ext4_journal_stop(handle);
 	if (!ret)
 		ret = err;
+
+	if (freeze_protected)
+		sb_end_intwrite(dquot->dq_sb);
+
 	return ret;
 }
 
Signature · 1 line
2.34.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#7 lore raw

Re: [PATCH v2 2/2] ext4: protect ext4_acquire_dquot against freezing

In reply to Ye Bin
kernel test robot noticed the following build errors:

Hi Ye,

kernel test robot noticed the following build errors:

[auto build test ERROR on tytso-ext4/dev]
[also build test ERROR on linus/master v7.4-rc4]
[cannot apply to brauner-vfs/vfs.all next-20261124]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ye-Bin/quota-Forbid-Q_XGETQUOTA-and-Q_XGETNEXTQUOTA-for-frozen-filesystem/20261125-191054
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
patch link:    https://lore.kernel.org/r/20261125111055.3672233-3-yebin%40huaweicloud.com
patch subject: [PATCH v2 2/2] ext4: protect ext4_acquire_dquot against freezing
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20261126/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261126/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

fs/ext4/super.c: In function 'ext4_write_dquot':

>> fs/ext4/super.c:7165:13: error: 'freeze_protected' undeclared (first use in this function); did you mean 'freeze_processes'?
    7165 |         if (freeze_protected)
         |             ^~~~~~~~~~~~~~~~
         |             freeze_processes

fs/ext4/super.c:7165:13: note: each undeclared identifier is reported only once for each function it appears in

vim +7165 fs/ext4/super.c

7144
7145 static int ext4_write_dquot(struct dquot *dquot)
7146 {
7147 int ret, err;
7148 handle_t *handle;
7149 struct inode *inode;
7150
7151 inode = dquot_to_inode(dquot);
7152 handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
7153 EXT4_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
7154 if (IS_ERR(handle))
7155 return PTR_ERR(handle);
7156 ret = dquot_commit(dquot);
7157 if (ret < 0)
7158 ext4_error_err(dquot->dq_sb, -ret,
7159 "Failed to commit dquot type %d",
7160 dquot->dq_id.type);
7161 err = ext4_journal_stop(handle);
7162 if (!ret)
7163 ret = err;
7164

> 7165		if (freeze_protected)

7166 sb_end_intwrite(dquot->dq_sb);
7167
7168 return ret;
7169 }
7170

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#8 lore raw
In reply to Ye Bin
Sashiko has finished reviewing this 2-patch series:

Sashiko has finished reviewing this 2-patch series:

- Patch 1: no issues found.
- Patch 2 ("ext4: protect ext4_acquire_dquot against freezing"): 2 potential issues (2 High)

A detailed review has been sent as a separate reply to patch 2.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]