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  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Jun 2013 15:48:14 +0900
From:	Namjae Jeon <>
To:	Andreas Dilger <>
Cc:	"" <>,
	"" <>,
	"" <>,
	"" <>,
	"" <>,
	"" <>,
	Namjae Jeon <>
Subject: Re: [PATCH 0/3] ext4: introduce two new ioctls

2013/6/24, Andreas Dilger <>:
> On 2013-06-23, at 0:07, Namjae Jeon <> wrote:
>> From: Namjae Jeon <>
>> This patch series introduces 2 new ioctls for ext4.
>> Truncate_block_range ioctl truncates blocks from source file.
Hi. Andreas.
> How is this different from fallocate(FALLOC_FL_PUNCH_HOLE)?  That is already
> in existing kernels, and portable across multiple filesystems.
Dave chinner already answered it.

>> Transfer_block_range ioctl transfers data blocks from source file
>> and append them at the end of destination file.
> There is already a similar ioctl for defragmenting files. Is it possible to
> use that, or does it have different semantics?

For defrag ioctl:
struct move_extent {
        __u32 reserved;         /* should be zero */
        __u32 donor_fd;         /* donor file descriptor */
        __u64 orig_start;       /* logical start offset in block for orig */
        __u64 donor_start;      /* logical start offset in block for donor */
        __u64 len;              /* block length to be moved */
        __u64 moved_len;        /* moved block length */

For this ioctl to work, there are some pre conditions:
1) Contiguous blocks for donor_fd are allocated in user space using fallocate.
2) orig_start and donor_start should be same.

The fundamental difference between these 2 ioctls is that in defrag
ioctl data is copied, (page by page?) from the extents of source file
to the newly allocated extents of donor file. However, in transfer
block range ioctl the extents are transfered from the source file and
appended at the end of donor file. There is only metadata movement.

>> This ioctl truncates a range of data blocks from file.
>> It is useful to remove easily and quickly the garbage data
>> at the middle of file.
>> e.g. we have a movie file and there is long advertisement in movie file.
>> user want to remove only advertisement range.
> While this works in theory, there is very little chance that the movie data
> will align exactly to filesystem block boundaries.
> Cheers, Andreas
>> 1) Movie file (8GB), There is the adverisement of 500MB size.
>> ____________________________________________________________________
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