Skip to content

Commit

Permalink
filerec: fiemap_scan_extent: handle some errors
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Bruyelles <[email protected]>
  • Loading branch information
JackSlateur committed Nov 17, 2023
1 parent 5ed08c3 commit 98c0b8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion filerec.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,17 @@ int fiemap_scan_extent(struct extent *extent)
return ret;

fiemap = do_fiemap(extent->e_file->fd);
if (!fiemap)
if (!fiemap) {
filerec_close(extent->e_file);
return -1;
}

result = get_extent(fiemap, extent->e_loff, NULL);
if (!extent) {
filerec_close(extent->e_file);
return -1;
}

extent->e_poff = result->fe_physical;
filerec_close(extent->e_file);
return ret;
Expand Down

0 comments on commit 98c0b8b

Please sign in to comment.