btrfs: make file clone aware of fatal signals
authorWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Thu, 13 Oct 2016 01:23:39 +0000 (09:23 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Oct 2016 16:20:29 +0000 (18:20 +0200)
Indeed this just make the behavior similar to xfs when process has
fatal signals pending, and it'll make fstests/generic/298 happy.

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index af69129..7163457 100644 (file)
@@ -3814,6 +3814,11 @@ process_slot:
                }
                btrfs_release_path(path);
                key.offset = next_key_min_offset;
+
+               if (fatal_signal_pending(current)) {
+                       ret = -EINTR;
+                       goto out;
+               }
        }
        ret = 0;