lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 15 Jul 2012 21:03:42 +0800
From:	Wang Sheng-Hui <>
To:	Allison Henderson <>,
	Lukas Czerner <>,
	"Theodore Ts'o" <>,
Subject: Question about extents.c/ext4_ext_punch_hole

Dear all,

I'm reading the code of extents.c, and confused by the function "ext4_ext_punch_hole".

In my understanding, if we want to punch hole for the range (loff_t offset, loff_t length),
then we finally will get one hole block-size aligned, right?

[code in ext4_ext_punch_hole]
	first_block = (offset + sb->s_blocksize - 1) >>
	stop_block = (offset + length) >> EXT4_BLOCK_SIZE_BITS(sb);

>From the code, we'll get one hole range contained in the range [offset, length+offset-1].

For example, we set the block size to 1K, and we specify the range [offset:1000, offset:2000].
Then we'll get first_block:1,stop_block:2, with some head/tail range ignored.
     1000      1024       2048        2999
     offset                        offset+length-1
'==='means punched hole here.

Please correct me if I'm wrong.

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists