coreutils
[Top][All Lists]
Advanced

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

Re: cp: improve fallback when fiemap is not supported


From: Dominique Martinet
Subject: Re: cp: improve fallback when fiemap is not supported
Date: Mon, 4 Dec 2017 09:37:07 +0100

Pádraig Brady wrote on Sat, Dec 02, 2017 at 04:41:30PM -0800:
> Does upstream tar have this heuristic?

Hm, I had only tried on GNU tar until now.
It looks like neither star nor bsdtar do. Not sure if there is another
upstream tar to test, but this looks like to be a GNU-specific
optimisation.

> We're looking at moving away from fiemap to using SEEK_HOLE/SEEK_DATA.
> Are those supported on your file system?

Unfortunately, it doesn't look like lustre support these yet.
lseek(fd, 0, SEEK_DATA) returns the start of the file and SEEK_HOLE
returns the end of the file e.g. the whole file is considered data.

On a "normal" filesystem, SEEK_HOLE returns the current offset (so 0,
we're in a hole), and SEEK_DATA to return -1 with errno set to ENXIO.
This is appropriate for cp.


> Would they be applicable in this case?

I think they would be, and I might be able to get that fixed more easily
than fiemap.
In this case seek does not fail at all so a workaround such as the one I
suggested would not be possible (unless done earlier, but that's a bit
ugly)... So let's ignore it and I will get lustre fixed.


Thanks for the feedback,
-- 
Dominique Martinet



reply via email to

[Prev in Thread] Current Thread [Next in Thread]