Commit 3d246949 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull quota and udf fixes from Jan Kara:
 "Two small UDF fixes for better handling of corrupted filesystem and a
  quota fix to fix handling of filesystem freezing"

* tag 'fs_for_v6.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: Verify inode link counts before performing rename
  udf: Skip parent dir link count update if corrupted
  quota: flush quota_release_work upon quota writeback
parents 9141c5d3 6756af92
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -688,6 +688,8 @@ int dquot_writeback_dquots(struct super_block *sb, int type)

	WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount));

	flush_delayed_work(&quota_release_work);

	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
		if (type != -1 && cnt != type)
			continue;
+15 −1
Original line number Diff line number Diff line
@@ -517,7 +517,11 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry)
			 inode->i_nlink);
	clear_nlink(inode);
	inode->i_size = 0;
	if (dir->i_nlink >= 3)
		inode_dec_link_count(dir);
	else
		udf_warn(inode->i_sb, "parent dir link count too low (%u)\n",
			 dir->i_nlink);
	udf_add_fid_counter(dir->i_sb, true, -1);
	inode_set_mtime_to_ts(dir,
			      inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode)));
@@ -787,8 +791,18 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
			retval = -ENOTEMPTY;
			if (!empty_dir(new_inode))
				goto out_oiter;
			retval = -EFSCORRUPTED;
			if (new_inode->i_nlink != 2)
				goto out_oiter;
		}
		retval = -EFSCORRUPTED;
		if (old_dir->i_nlink < 3)
			goto out_oiter;
		is_dir = true;
	} else if (new_inode) {
		retval = -EFSCORRUPTED;
		if (new_inode->i_nlink < 1)
			goto out_oiter;
	}
	if (is_dir && old_dir != new_dir) {
		retval = udf_fiiter_find_entry(old_inode, &dotdot_name,