[Gluster-devel] Progress on adding support for SEEK_DATA and SEEK_HOLE

Niels de Vos ndevos at redhat.com
Mon Jul 6 08:18:20 UTC 2015

On Mon, Jul 06, 2015 at 02:46:52AM -0300, J. Christopher Pereira Zimmermann wrote:
> Hi Niels,
> Thanks for bouncing.
> I'm not sure if you are asking how to figure out the hole/data offsets from
> the underlying fs at once, or about the ec communication.
> There is probably no standard way to query the allocation information with
> the hole offsets at once from the fs, so lseeking from hole to hole would
> be the only way.
> I quickly checked ext4's SEEK_HOLE implementation [1] and the holes seem to
> be marked and sought on "ext4_map_blocks" [2].
> There seems to be no standard system call / data structure for getting all
> the hole/data offsets at once.
> Is lseeking hole by hole ok?

Thanks Christopher!

Xavier also responded with details on how EC tracks holes. He is
definitely one of the few that should know ;-)

Only volumes with EC/stripe/sharding/bd xlators are not straight
forward. For the less funky storage methods, lseek() can be used without

I did put a COPR together for Fedora 22 (x86_64) with a patched kernel
and glusterfs packages. If you are eager to test, you can install these
on a disposable environment.

  (NOT TESTED AT ALL! But it compiles...)

Feedback welcome, but dont have too high expectations from those


> [1] :
> https://github.com/torvalds/linux/blob/05a8256c586ab75bcd6b793737b2022a1a98cb1e/fs/ext4/file.c
> [2] :
> https://github.com/torvalds/linux/blob/64e22b86854227b4d13a57fa02f26472bc426812/fs/ext4/ext4.h

More information about the Gluster-devel mailing list