]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Btrfs: try not to ENOSPC on log replay
authorJosef Bacik <jbacik@fb.com>
Thu, 18 Sep 2014 15:30:44 +0000 (11:30 -0400)
committerJiri Slaby <jslaby@suse.cz>
Fri, 31 Oct 2014 14:11:05 +0000 (15:11 +0100)
commit1125942d412f684b24d7a307888cd9dec99e3779
treed7f3bc5c49ec20c53840cf816c2481eeaf8e0cfb
parent40b69f03d3371e16e66fa5b30f22b6df585399fc
Btrfs: try not to ENOSPC on log replay

commit 1d52c78afbbf80b58299e076a159617d6b42fe3c upstream.

When doing log replay we may have to update inodes, which traditionally goes
through our delayed inode stuff.  This will try to move space over from the
trans handle, but we don't reserve space in our trans handle on replay since we
don't know how much we will need, so instead we try to flush.  But because we
have a trans handle open we won't flush anything, so if we are out of reserve
space we will simply return ENOSPC.  Since we know that if an operation made it
into the log then we definitely had space before the box bought the farm then we
don't need to worry about doing this space reservation.  Use the
fs_info->log_root_recovering flag to skip the delayed inode stuff and update the
item directly.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/btrfs/inode.c