Skip to content

Commit e07716c

Browse files
committed
ignore FS_IOC_FIEMAP failure with ENOTSUPP
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 Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
1 parent 55f9aa5 commit e07716c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/common/mfu_errors.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ static inline int mfu_errno2rc(int err)
2020
return -1;
2121
}
2222

23+
/* Non-standard error code returned by syscalls or external libs */
24+
/* similar meaning to ENOTSUP */
25+
#define MFU_ERR_ENOTSUPP 524
26+
2327
/* Generic error codes */
2428
#define MFU_ERR 1000
2529
#define MFU_ERR_INVAL_ARG 1001

src/common/mfu_flist_copy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
#include "mfu.h"
5959
#include "mfu_flist_internal.h"
60+
#include "mfu_errors.h"
6061
#include "strmap.h"
6162

6263
#ifdef LUSTRE_SUPPORT
@@ -1933,7 +1934,7 @@ static int mfu_copy_file_fiemap(
19331934
}
19341935

19351936
if (ioctl(mfu_src_file->fd, FS_IOC_FIEMAP, fiemap) < 0) {
1936-
if (errno == ENOTSUP) {
1937+
if (errno == ENOTSUP || errno == MFU_ERR_ENOTSUPP) {
19371938
/* silently ignore */
19381939
} else {
19391940
MFU_LOG(MFU_LOG_ERR, "fiemap ioctl() failed for src '%s' (errno=%d %s)",

0 commit comments

Comments
 (0)