Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6305567 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: run delayed directory updates during log replay



While we are resolving directory modifications in the
tree log, we are triggering delayed metadata updates to
the filesystem btrees.

This commit forces the delayed updates to run so the
replay code can find any modifications done.  It stops
us from crashing because the directory deleltion replay
expects items to be removed immediately from the tree.

Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
cc: stable@kernel.org
parent 7fd1a3f7
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -690,6 +690,8 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
	kfree(name);
	kfree(name);


	iput(inode);
	iput(inode);

	btrfs_run_delayed_items(trans, root);
	return ret;
	return ret;
}
}


@@ -895,6 +897,7 @@ again:
				ret = btrfs_unlink_inode(trans, root, dir,
				ret = btrfs_unlink_inode(trans, root, dir,
							 inode, victim_name,
							 inode, victim_name,
							 victim_name_len);
							 victim_name_len);
				btrfs_run_delayed_items(trans, root);
			}
			}
			kfree(victim_name);
			kfree(victim_name);
			ptr = (unsigned long)(victim_ref + 1) + victim_name_len;
			ptr = (unsigned long)(victim_ref + 1) + victim_name_len;
@@ -1475,6 +1478,9 @@ again:
			ret = btrfs_unlink_inode(trans, root, dir, inode,
			ret = btrfs_unlink_inode(trans, root, dir, inode,
						 name, name_len);
						 name, name_len);
			BUG_ON(ret);
			BUG_ON(ret);

			btrfs_run_delayed_items(trans, root);

			kfree(name);
			kfree(name);
			iput(inode);
			iput(inode);