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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2017 10:16:11 +0000 (11:16 +0100)
commit 69ae5e4459e43e56f03d0987e865fbac2b05af2a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ioctl.c

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