Message ID | 20230328051957.1161316-11-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/11] btrfs: add function to create and return an ordered extent | expand |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 042018271baa37..a791faabb2ec87 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2622,6 +2622,14 @@ int btrfs_extract_ordered_extent(struct btrfs_bio *bbio, ret = btrfs_split_ordered_extent(ordered, len); if (ret) return ret; + + /* + * Don't split the extent_map for nocow extents, as we're writing + * into a pre-existing one. + */ + if (test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) + return 0; + return split_extent_map(inode, bbio->file_offset, ordered_len, len); }