Skip to content

Commit

Permalink
btrfs: don't return EINTR
Browse files Browse the repository at this point in the history
It is basically a good thing if we are interruptible when waiting for
free space, but the generality in which it is implemented currently
leads to system calls being interruptible that are not documented this
way. For example git can't handle interrupted unlink(), leading to
corrupt repos under space pressure.
Instead we raise the bar to only be interruptible by SIGKILL.
Thanks to David Sterba for suggesting this.

Signed-off-by: Arne Jansen <sensille@gmx.net>
  • Loading branch information
Arne Jansen authored and David Sterba committed Apr 18, 2012
1 parent 253beeb commit b9688bb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3771,13 +3771,10 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
*/
if (current->journal_info)
return -EAGAIN;
ret = wait_event_interruptible(space_info->wait,
!space_info->flush);
/* Must have been interrupted, return */
if (ret) {
printk(KERN_DEBUG "btrfs: %s returning -EINTR\n", __func__);
ret = wait_event_killable(space_info->wait, !space_info->flush);
/* Must have been killed, return */
if (ret)
return -EINTR;
}

spin_lock(&space_info->lock);
}
Expand Down

0 comments on commit b9688bb

Please sign in to comment.