* [PATCH] xfs_io: fix statx call for changed UAPI
@ 2017-04-26 22:32 Eric Sandeen
2017-04-26 22:36 ` David Howells
2017-05-02 10:03 ` Carlos Maiolino
0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2017-04-26 22:32 UTC (permalink / raw)
To: linux-xfs, David Howells
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>
---
diff --git a/io/stat.c b/io/stat.c
index c5b3075..783eb2e 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 ff08e27..3b5978d 100644
--- a/io/statx.h
+++ b/io/statx.h
@@ -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 */
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xfs_io: fix statx call for changed UAPI
2017-04-26 22:32 [PATCH] xfs_io: fix statx call for changed UAPI Eric Sandeen
@ 2017-04-26 22:36 ` David Howells
2017-05-02 10:03 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2017-04-26 22:36 UTC (permalink / raw)
To: Eric Sandeen; +Cc: dhowells, linux-xfs
Eric Sandeen <sandeen@redhat.com> wrote:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs_io: fix statx call for changed UAPI
2017-04-26 22:32 [PATCH] xfs_io: fix statx call for changed UAPI Eric Sandeen
2017-04-26 22:36 ` David Howells
@ 2017-05-02 10:03 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2017-05-02 10:03 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs, David Howells
On Wed, Apr 26, 2017 at 05:32:36PM -0500, Eric Sandeen wrote:
> 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: Carlos Maiolino <cmaiolino@redhat.com>
>
> diff --git a/io/stat.c b/io/stat.c
> index c5b3075..783eb2e 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 ff08e27..3b5978d 100644
> --- a/io/statx.h
> +++ b/io/statx.h
> @@ -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 */
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Carlos
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-02 10:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 22:32 [PATCH] xfs_io: fix statx call for changed UAPI Eric Sandeen
2017-04-26 22:36 ` David Howells
2017-05-02 10:03 ` Carlos Maiolino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox