[PATCH 1/2] btrfs-progs: fix check to catch gaps at the start of the file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When writing my test for the i_size patches, I noticed that I was not
actually failing without my patches as I should have been.  This is
because we assume the first extent we find is the first valid spot, so
we don't actually add a hole entry if there is no extent at offset 0.
Fix this by setting our extent_start and extent_end to 0 so we can
properly catch the corruption.

Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
---
 check/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/check/main.c b/check/main.c
index 4115049a..4ce5a63c 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1553,8 +1553,8 @@ static int process_file_extent(struct btrfs_root *root,
 	rec->found_file_extent = 1;
 
 	if (rec->extent_start == (u64)-1) {
-		rec->extent_start = key->offset;
-		rec->extent_end = key->offset;
+		rec->extent_start = 0;
+		rec->extent_end = 0;
 	}
 
 	if (rec->extent_end > key->offset)
-- 
2.24.1




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux