hpc / mpifileutils

File utilities designed for scalability and performance.
https://hpc.github.io/mpifileutils
BSD 3-Clause "New" or "Revised" License
169 stars 68 forks source link

error: ‘struct lov_user_mds_data_v2’ has no member named ‘lmd_st’ with Lustre 2.13 #322

Open kcgthb opened 4 years ago

kcgthb commented 4 years ago

Hi!

I got the following error when trying to compile mpifileutils 0.10 with Lustre 2.13.0:

$ cmake [...] -DENABLE_LUSTRE=ON ..
$ make
Scanning dependencies of target mfu_o
[  1%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_bz2.c.o
[  2%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_bz2_static.c.o
[  4%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_compress_bz2_libcircle.c.o
[  5%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_decompress_bz2_libcircle.c.o
[  7%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist.c.o
[  8%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_chunk.c.o
[ 10%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_copy.c.o
[ 11%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_io.c.o
[ 13%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_chmod.c.o
[ 14%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_create.c.o
[ 16%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_remove.c.o
[ 17%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_sort.c.o
[ 19%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_usrgrp.c.o
[ 20%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_flist_walk.c.o
/dev/shm/mpifileutils-0.10/src/common/mfu_flist_walk.c: In function ‘lustre_mds_stat’:
/dev/shm/mpifileutils-0.10/src/common/mfu_flist_walk.c:157:69: error: ‘struct lov_user_mds_data_v2’ has no member named ‘lmd_st’
         lstat_t* ls = (lstat_t*) & ((struct lov_user_mds_data*) buf)->lmd_st;
                                                                     ^
make[2]: *** [src/common/CMakeFiles/mfu_o.dir/mfu_flist_walk.c.o] Error 1
make[1]: *** [src/common/CMakeFiles/mfu_o.dir/all] Error 2
make: *** [all] Error 2

$ rpm -q lustre-client
lustre-client-2.13.0-1.el7.x86_64
adammoody commented 4 years ago

Thanks for the report, @kcgthb . The intent of this function was to pull the stat info from Lustre rather than a stat() call during a walk. My understanding is that this may provide inaccurate info for some fields like mtime, but it's faster. Having said that, we have the calls that invoke these functions commented out, so we're not using them at all. As a fix to build on this newer version of Lustre, we could drop or comment out these functions.

As a test, can you build successfully if you comment out the code (#if 0 / #endif) from: https://github.com/hpc/mpifileutils/blob/b38043e46605c9c921f0c29150f89f53b030eaa5/src/common/mfu_flist_walk.c#L134 to: https://github.com/hpc/mpifileutils/blob/b38043e46605c9c921f0c29150f89f53b030eaa5/src/common/mfu_flist_walk.c#L295

I'd like to see whether there are other spots where our Lustre support has compile-time issues with that newer version of Lustre. The machine I have access to has an older version of Lustre, so it's hard for me to test.

kcgthb commented 4 years ago

Commenting out the whole block: https://github.com/hpc/mpifileutils/blob/b38043e46605c9c921f0c29150f89f53b030eaa5/src/common/mfu_flist_walk.c#L134-L295 allows compilation to complete successfully, indeed. So no other portions of the code seem to be affected.

adammoody commented 4 years ago

Good to hear. Thanks for checking. I'll push a commit to delete or comment out that section and retag v0.10 before we mark the final release.

adammoody commented 4 years ago

For future reference in case adding this back, the new struct has an lmd_stx field that returns an lstatx_t structure:

https://git.whamcloud.com/?p=fs/lustre-release.git;a=blob_plain;f=lustre/include/uapi/linux/lustre/lustre_user.h;hb=a298f8c1376485512f83472a22dc755f47947e75

The statx operation allows one to chose which fields in the stat struct are actually needed.

For faster stat operations on Lustre, it would be nice to support this feature again someday.