Skip to content

Conversation

ofaaland
Copy link
Collaborator

Lustre can return ENOTSUPP (524) in response to an FS_IOC_FIEMAP ioctl() call, for a file striped a certain way.

The file can still be copied, fiemap just can't tell us where the holes are.

A brief survey using google searches suggests ENOTSUPP (524) was historically intended for use internal to the kernel or drivers, but has occasionally been returned to users by different software, in ways that have meaning similar to ENOTSUP.

Ignore the error as with ENOTSUP (95) so the file is copied without the use of fiemap.

Fixes #644

@ofaaland ofaaland changed the title ignore FS_IOC_FIEMAP failure with ENOTSUPP DRAFT: ignore FS_IOC_FIEMAP failure with ENOTSUPP Jun 27, 2025
@defaziogiancarlo
Copy link
Collaborator

defaziogiancarlo commented Jun 27, 2025

I don't think ENOTSUPP is defined in the user space headers. It's in https://elixir.bootlin.com/linux/v4.18/source/include/linux/errno.h

@ofaaland
Copy link
Collaborator Author

The patch now builds and silently ignores the error. With the same sparse file and layout as described in #644, the updated code's output is:

$/g/g0/faaland1/projects/mfu-install/bin/dsync --sparse /p/lustre2/faaland1/test/enotsupp/ /p/lustre2/faaland1/test/enotsupp-copy/
...
[2025-06-27T15:23:25] Items: 7
[2025-06-27T15:23:25]   Directories: 1
[2025-06-27T15:23:25]   Files: 6
[2025-06-27T15:23:25]   Links: 0
[2025-06-27T15:23:25] Data: 95.367 GiB (15.895 GiB per file)
[2025-06-27T15:23:25] Creating 1 directories
[2025-06-27T15:23:25] Creating 6 files.
[2025-06-27T15:23:25] Copying data.
[2025-06-27T15:23:35] Copied 3.953 GiB (4%) in 10.020 secs (403.996 MiB/s) 232 secs left ...
[2025-06-27T15:23:45] Copied 7.844 GiB (8%) in 20.026 secs (401.075 MiB/s) 223 secs left ...
...

@ofaaland ofaaland mentioned this pull request Jun 27, 2025
Lustre 2.15.6 can return ENOTSUPP (524) in response to an FS_IOC_FIEMAP
ioctl() call, for a file striped a certain way.  This is a bug, it
should return EOPNOTSUPP (95).

The file can still be copied, fiemap just can't tell us where the holes
are.

A brief survey using google searches suggests ENOTSUPP (524) was
historically intended for use internal to the kernel or drivers, but has
occasionally been returned to users by different software, in ways that
have meaning similar to ENOTSUP.

Ignore the error as with ENOTSUP (95) so the file is copied without the
use of fiemap.

Notify the user that the copied file is not sparse.

Fixes hpc#644

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
@ofaaland
Copy link
Collaborator Author

ofaaland commented Jun 30, 2025

Updated the patch to emit an INFO level message if fiemap ioctl() is not supported. Built and tested on mutt. I have not yet written the patch to use SEEK_HOLE et al.

$~/projects/mfu-install/bin/dsync --sparse /p/lflood/faaland1/test/enotsupp /p/lflood/faaland1/test/enotsupp-copy
...
[2025-06-30T13:57:46] Copying data.
[2025-06-30T13:57:46] Unknown if src is sparse, fiemap not supported. Not reproducing holes in '/p/lflood/faaland1/test/enotsupp/afile'
[2025-06-30T13:57:56] Copied 9.273 GiB (10%) in 10.005 secs (949.092 MiB/s) 93 secs left ...
...

I chose INFO because WARN seemed too severe, given that the file we mention may not be sparse in the first place. This will be very chatty on Lustre 2.15.

if (errno == ENOTSUP) {
/* silently ignore */
if (errno == ENOTSUP || errno == MFU_ERR_ENOTSUPP) {
MFU_LOG(MFU_LOG_INFO, "Destination file not sparse; FIEMAP not supported for src '%s'",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know that the file isn't sparse here? I think a sparse lustre file would return ENOTSUP or MFU_ERR_ENOTSUPP here. Also, this should be talking about the source file, not the destination file.

Copy link
Collaborator Author

@ofaaland ofaaland Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not know whether the source file is sparse or not. Since ioctl() failed, there's no way for us to know (until I write the patch to use SEEK_HOLE).

Also, this should be talking about the source file, not the destination file.

This is tricky. The source is where the ioctl() failed. But the destination is what we're writing, and it will not be sparse (unless, as I discovered, ZFS/Lustre figure it out and sparsify the file own their own).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I miss read the message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ignore ENOTSUPP (524) for fiemap error
3 participants