bcachefs: Fix fiemap (again)
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 28 Aug 2019 16:41:45 +0000 (12:41 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:26 +0000 (17:08 -0400)
when iterating over reflink pointers, we use the key we just emitted to
set the iterator position - which means we have to be setting the key's
inode field as well

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs.c

index ffd9b386a14ded08fb5d970d7567afb28ae246b6..0ba498505b076f3280c3133ead66986a12781fa3 100644 (file)
@@ -1249,7 +1249,8 @@ retry:
                                           offset_into_extent),
                                       &cur.k);
                bch2_key_resize(&cur.k.k, sectors);
-               cur.k.k.p.offset = iter->pos.offset + cur.k.k.size;
+               cur.k.k.p = iter->pos;
+               cur.k.k.p.offset += cur.k.k.size;
 
                if (have_extent) {
                        ret = bch2_fill_extent(c, info,