From: Eric Sandeen Date: Tue, 2 May 2017 16:12:58 +0000 (-0500) Subject: xfs_io: fix statx call for changed UAPI X-Git-Tag: v4.11.0-rc2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b61fdaec935aa642562789d7b7398a188c6d2a59;p=thirdparty%2Fxfsprogs-dev.git xfs_io: fix statx call for changed UAPI Due to a late-breaking change in the statx UAPI in kernel commit 1e2f82d1 statx: Kill fd-with-NULL-path support in favour of AT_EMPTY_PATH we'll need to fix the way we call the syscall in xfs_io. Signed-off-by: Eric Sandeen Reviewed-by: David Howells Signed-off-by: Eric Sandeen --- diff --git a/io/stat.c b/io/stat.c index c5b30756a..783eb2e37 100644 --- a/io/stat.c +++ b/io/stat.c @@ -351,7 +351,7 @@ statx_f( return command_usage(&statx_cmd); memset(&stx, 0xbf, sizeof(stx)); - if (_statx(file->fd, NULL, atflag, mask, &stx) < 0) { + if (_statx(file->fd, "", atflag | AT_EMPTY_PATH, mask, &stx) < 0) { perror("statx"); return 0; } diff --git a/io/statx.h b/io/statx.h index 14361a88d..49daab8cd 100644 --- a/io/statx.h +++ b/io/statx.h @@ -4,6 +4,10 @@ #include #include +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000 +#endif + #ifndef AT_STATX_SYNC_TYPE #define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */ #define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */