btrfs: don't return EINTR
authorArne Jansen <sensille@gmx.net>
Wed, 18 Apr 2012 08:27:16 +0000 (10:27 +0200)
committerDavid Sterba <dsterba@suse.cz>
Wed, 18 Apr 2012 17:22:33 +0000 (19:22 +0200)
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>
fs/btrfs/extent-tree.c

index a0bb9dcd3c360438fbb292f79a36d6338d84c8da..84497f8eb043712bbbe4db719377ac1da951a827 100644 (file)
@@ -3771,13 +3771,10 @@ again:
                 */
                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);
        }