diff --git a/HISTORY b/HISTORY index 888f2d57..961ecfec 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,11 @@ SnapRAID HISTORY ================ +4.1 2013/9 +========== + * If the underline filesystem doesn't support the FIEMAP command, + fallback to use the inode number for sorting files. + 4.0 2013/9 ========== * New 'scrub' command to periodically check the oldest blocks for silent diff --git a/unix.c b/unix.c index 3418c1f0..ba1dfbee 100644 --- a/unix.c +++ b/unix.c @@ -147,6 +147,14 @@ int filephy(const char* path, struct stat* st, uint64_t* physical) fm.fiemap.fm_extent_count = 1; /* we are interested only at the first block */ if (ioctl(f, FS_IOC_FIEMAP, &fm) == -1) { + /* if the underline filesystem doesn't support FS_IOC_FIEMAP */ + /* fallback to use the inode */ + if (errno == ENOTSUP) { + close(f); + *physical = st->st_ino; + return 0; + } + close(f); return -1; }