* [PATCH] xfstests: use native definition of O_DIRECT flag
@ 2013-02-26 21:03 Eric Whitney
2013-02-26 22:57 ` Dave Chinner
2013-03-05 20:09 ` Rich Johnston
0 siblings, 2 replies; 3+ messages in thread
From: Eric Whitney @ 2013-02-26 21:03 UTC (permalink / raw)
To: xfs; +Cc: linux-ext4
The definition of O_DIRECT in src/trunc.c causes xfstest 125 to fail
when run on a Pandaboard. On ARM, the value used (0x040000) is
O_DIRECTORY rather than O_DIRECT as it is on x86. Prefer the platform's
native definition of O_DIRECT supplied by fcntl.h if available. Also,
fix a couple of error messages to properly reflect their context.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
---
src/trunc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/trunc.c b/src/trunc.c
index 7539532..38fb21f 100644
--- a/src/trunc.c
+++ b/src/trunc.c
@@ -26,7 +26,9 @@
#include <stdlib.h>
#include <string.h>
+#ifndef O_DIRECT
#define O_DIRECT 040000
+#endif
#define WAITTIME 60
#define BUFSIZE 4096
@@ -82,7 +84,7 @@ while((c=getopt(argc,argv,"f:"))!=EOF) {
printf("direct write of 1's into file\n");
err = write(fd, buf, BUFSIZE);
- if (err < 0) perror("buffered write failed");
+ if (err < 0) perror("direct write failed");
close(fd);
@@ -96,7 +98,7 @@ while((c=getopt(argc,argv,"f:"))!=EOF) {
printf("buffered write of 2's into file\n");
err = write(fd, buf, BUFSIZE);
- if (err < 0) perror("direct write failed");
+ if (err < 0) perror("buffered write failed");
/* 1 now on disk, but 2 data is buffered */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests: use native definition of O_DIRECT flag
2013-02-26 21:03 [PATCH] xfstests: use native definition of O_DIRECT flag Eric Whitney
@ 2013-02-26 22:57 ` Dave Chinner
2013-03-05 20:09 ` Rich Johnston
1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2013-02-26 22:57 UTC (permalink / raw)
To: Eric Whitney; +Cc: linux-ext4, xfs
On Tue, Feb 26, 2013 at 04:03:22PM -0500, Eric Whitney wrote:
> The definition of O_DIRECT in src/trunc.c causes xfstest 125 to fail
> when run on a Pandaboard. On ARM, the value used (0x040000) is
> O_DIRECTORY rather than O_DIRECT as it is on x86. Prefer the platform's
> native definition of O_DIRECT supplied by fcntl.h if available. Also,
> fix a couple of error messages to properly reflect their context.
>
> Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfstests: use native definition of O_DIRECT flag
2013-02-26 21:03 [PATCH] xfstests: use native definition of O_DIRECT flag Eric Whitney
2013-02-26 22:57 ` Dave Chinner
@ 2013-03-05 20:09 ` Rich Johnston
1 sibling, 0 replies; 3+ messages in thread
From: Rich Johnston @ 2013-03-05 20:09 UTC (permalink / raw)
To: Eric Whitney; +Cc: xfs, linux-ext4
This patch has been committed.
Thanks
--Rich
commit 5825ecd3b99ed8c177895d5e6a830133fed384ea
Author: Eric Whitney <enwlinux@gmail.com>
Date: Tue Feb 26 21:03:22 2013 +0000
xfstests: use native definition of O_DIRECT flag
The definition of O_DIRECT in src/trunc.c causes xfstest 125 to fail
when run on a Pandaboard. On ARM, the value used (0x040000) is
O_DIRECTORY rather than O_DIRECT as it is on x86. Prefer the
platform's
native definition of O_DIRECT supplied by fcntl.h if available. Also,
fix a couple of error messages to properly reflect their context.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-05 20:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-26 21:03 [PATCH] xfstests: use native definition of O_DIRECT flag Eric Whitney
2013-02-26 22:57 ` Dave Chinner
2013-03-05 20:09 ` Rich Johnston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).