summaryrefslogtreecommitdiff
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-13 06:42:54 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-13 06:42:54 +0100
commitb37333c8657cfece16b2fb0ba3fef2cb481a0a19 (patch)
tree9b7da4fb461d74f6c5fd02b872a695af30cad324 /fs/btrfs/send.c
parente7cd121cbf1bec05e50335f82d4aa7d8fa700538 (diff)
parent5bc55a333a2f7316b58edc7573e8e893f7acb532 (diff)
Merge 6.13-rc7 into staging next
We need the gpib changes in here as well to build on top of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r--fs/btrfs/send.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 7254279c3cc92..498c843232536 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -5280,6 +5280,7 @@ static int put_file_data(struct send_ctx *sctx, u64 offset, u32 len)
unsigned cur_len = min_t(unsigned, len,
PAGE_SIZE - pg_offset);
+again:
folio = filemap_lock_folio(mapping, index);
if (IS_ERR(folio)) {
page_cache_sync_readahead(mapping,
@@ -5312,6 +5313,11 @@ static int put_file_data(struct send_ctx *sctx, u64 offset, u32 len)
ret = -EIO;
break;
}
+ if (folio->mapping != mapping) {
+ folio_unlock(folio);
+ folio_put(folio);
+ goto again;
+ }
}
memcpy_from_folio(sctx->send_buf + sctx->send_size, folio,