Whamcloud - gitweb
LU-10934 llite: integrate statx() API with Lustre 74/36674/18
authorQian Yingjin <qian@ddn.com>
Fri, 1 Nov 2019 08:58:26 +0000 (16:58 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 May 2020 05:04:24 +0000 (05:04 +0000)
commit3f7853b31ef6f5a6c2837403910083057728a842
tree59f765b1148a3db39de4ce20e0edff08727a2226
parent8cfd5be8b04bdaaa4a0c794392cc2e6835e103eb
LU-10934 llite: integrate statx() API with Lustre

System call statx() interface can specify a bitmask to fetch
specific attributes from a file (e.g. st_uid, st_gid, st_mode, and
st_btime = file creation time), rather than fetching all of the
normal stat() attributes (such as st_size and st_blocks). It also
has a AT_STATX_DONT_SYNC mode which allows the kernel to return
cached attributes without flushing all of the client data and
fetching an accurate result from the server.
The conditions for adding statx() API for Lustre are mature:
1. statx() is added to Linux 4.11+;
2. glibc supports statx() (glibc 2.28+ -> RHEL 8, Ubuntun 18.10+)
3. The support for stat(1) and ls(1) to use statx(3) to fetch
   only the required attributes has landed to the upstream GNU
   coreutils package.

This patch integrates statx() API with Lustre so that we can take
advantage of the efficiencies available:
- Only fetch MDS attributes if STATX_SIZE, STATX_BLOCKS and
  STATX_MTIME are not requested, and avoid OSS glimpse RPCs
  completely;
- Hook this into statahead to avoid async glimpse locks (AGL) if
  OST information not needed;
- Enhance the MDS RPC interface to return the file creation time
  stored in both ldiskfs and ZFS already, and enable STATX_BTIME;
- Better support with AT_STATX_DONT_SYNC mode. Return the "lazy"
  attributes or cached attributes (even stale) on a client if
  available without any RPCs to servers (MDS and OSS).
- statx (lustre/test/statx): port coreutils ls/stat by using
  statx(3) system call if OS supported it.
- Test scripts. Using statx() to verify btime attribute and the
  advantage described above.

Test-Parameters: clientdistro=el8
Test-Parameters: clientdistro=ubuntu1804
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I8432c9029bad9dea3e1ebc13a0d6978131d9b929
Reviewed-on: https://review.whamcloud.com/36674
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 files changed:
debian/control
debian/control.main
debian/lustre-tests.install
debian/rules
lustre.spec.in
lustre/autoconf/lustre-core.m4
lustre/include/lustre_compat.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dcache.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/llite/pcc.c
lustre/llite/pcc.h
lustre/llite/statahead.c
lustre/tests/Makefile.am
lustre/tests/sanity.sh
lustre/tests/sanityn.sh
lustre/tests/statx.c [new file with mode: 0644]
lustre/tests/test-framework.sh