From 3d95460eb7b8fcb750dd2bb74f11a757feaa8b8e Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Tue, 8 Jun 2021 23:07:14 -0400 Subject: [PATCH] fiemap: don't force flush so we can see the delalloc shenanigans Like filefrag, fiemap was defaulting to FIEMAP_FLAG_SYNC, and providing no option to turn it off. This prevents observation of delayed allocations, making fiemap less useful. Override the default flag setting so fiemap gets the current (i.e. unflushed) extent map state. Signed-off-by: Zygo Blaxell --- src/fiemap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fiemap.cc b/src/fiemap.cc index 247de39..1618d3b 100644 --- a/src/fiemap.cc +++ b/src/fiemap.cc @@ -23,6 +23,7 @@ main(int argc, char **argv) cout << "File: " << filename << endl; Fd fd = open_or_die(filename, O_RDONLY); Fiemap fm; + fm.fm_flags &= ~(FIEMAP_FLAG_SYNC); fm.m_max_count = 100; if (argc > 2) { fm.fm_start = stoull(argv[2], nullptr, 0); } if (argc > 3) { fm.fm_length = stoull(argv[3], nullptr, 0); }