]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_io: fix statx call for changed UAPI
authorEric Sandeen <sandeen@redhat.com>
Tue, 2 May 2017 16:12:58 +0000 (11:12 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 2 May 2017 16:12:58 +0000 (11:12 -0500)
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 <sandeen@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
io/stat.c
io/statx.h

index c5b30756a7e6d8962a24cf6bf6ad73d525ca858d..783eb2e37af152e5bb6d959f0ec516475e16baf3 100644 (file)
--- 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;
        }
index 14361a88dcf77c323b48a94145b3d5ea96417418..49daab8cd123afee6c9bab752dd8328499b84e77 100644 (file)
@@ -4,6 +4,10 @@
 #include <unistd.h>
 #include <sys/syscall.h>
 
+#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 */