diff mbox series

[1/3] btrfs: make buffered write to respect fatal signals

Message ID e4bde7c09f6be81eae71533fba5e06f24885f49d.1731297381.git.wqu@suse.com (mailing list archive)
State New
Headers show
Series btrfs: btrfs_buffered_write() cleanups | expand

Commit Message

Qu Wenruo Nov. 11, 2024, 3:59 a.m. UTC
This is to follow the behavior of generic_perform_write() which checks
the signal after faulting in the pages.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/file.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 10d51c8dd360..a0fa8c36a224 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1142,6 +1142,10 @@  ssize_t btrfs_buffered_write(struct kiocb *iocb, struct iov_iter *i)
 			ret = -EFAULT;
 			break;
 		}
+		if (fatal_signal_pending(current)) {
+			ret = -EINTR;
+			break;
+		}
 
 		only_release_metadata = false;
 		sector_offset = pos & (fs_info->sectorsize - 1);