Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/mfu_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ static inline int mfu_errno2rc(int err)
return -1;
}

/* Non-standard error code returned by syscalls or external libs */
/* Returned by ioctl(FIEMAP) with Lustre 2.15.6, should be 95 ENOTSUP */
#define MFU_ERR_ENOTSUPP 524

/* Generic error codes */
#define MFU_ERR 1000
#define MFU_ERR_INVAL_ARG 1001
Expand Down
6 changes: 4 additions & 2 deletions src/common/mfu_flist_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

#include "mfu.h"
#include "mfu_flist_internal.h"
#include "mfu_errors.h"
#include "strmap.h"

#ifdef LUSTRE_SUPPORT
Expand Down Expand Up @@ -1933,8 +1934,9 @@ static int mfu_copy_file_fiemap(
}

if (ioctl(mfu_src_file->fd, FS_IOC_FIEMAP, fiemap) < 0) {
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

src, errno, strerror(errno));
} else {
MFU_LOG(MFU_LOG_ERR, "fiemap ioctl() failed for src '%s' (errno=%d %s)",
src, errno, strerror(errno));
Expand Down