public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: fix nr of args in open calls
@ 2008-10-25 18:45 Eric Sandeen
  2008-10-25 20:17 ` Christoph Hellwig
  2008-10-26  3:45 ` [PATCH V2] " Eric Sandeen
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Sandeen @ 2008-10-25 18:45 UTC (permalink / raw)
  To: xfs-oss

Fix a few problematic open calls which strict checking catches;
in most cases just missing a mode with O_CREAT.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

Index: xfstests/ltp/iogen.c
===================================================================
--- xfstests.orig/ltp/iogen.c
+++ xfstests/ltp/iogen.c
@@ -1060,7 +1060,11 @@ int 	nbytes;
 
     Oflags |= O_CREAT | O_WRONLY;
 
+#ifdef CRAY
     if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
+#else
+    if ((fd = open(path, Oflags, 0666)) == -1) {
+#endif
 	fprintf(stderr, "iogen%s:  Could not create/open file %s: %s (%d)\n",
 		TagName, path, SYSERR, errno);
 	return -1;
Index: xfstests/src/multi_open_unlink.c
===================================================================
--- xfstests.orig/src/multi_open_unlink.c
+++ xfstests/src/multi_open_unlink.c
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
 			return 1;
 		}
 
-		fd = open(path, O_RDWR|O_CREAT|O_EXCL);
+		fd = open(path, O_RDWR|O_CREAT|O_EXCL, 0666);
 		if (fd == -1) {
 			fprintf(stderr, "%s: failed to create \"%s\": %s\n", prog, path, strerror(errno));
 			return 1;
Index: xfstests/src/enospc_unlink.c
===================================================================
--- xfstests.orig/src/enospc_unlink.c
+++ xfstests/src/enospc_unlink.c
@@ -40,7 +40,7 @@ int main(int argc, char **argv)
 	memset(ptr, 0xffffffff, sz);
 
 	for (i = 0; i < count; i++) {
-		fd = open(argv[1], O_CREAT|O_WRONLY);
+		fd = open(argv[1], O_CREAT|O_WRONLY, 0666);
 		if (fd < 0) {
 			perror(argv[1]);
 			exit(1);
Index: xfstests/src/dmiperf.c
===================================================================
--- xfstests.orig/src/dmiperf.c
+++ xfstests/src/dmiperf.c
@@ -203,7 +203,7 @@ mkfile(char *name, char *attr)
 	ssize_t		wrote, wsize;
 	off64_t		bytes = fsize;
 
-	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT)) < 0) {
+	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT, 0666)) < 0) {
 		perror("open");
 		exit(1);
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: fix nr of args in open calls
  2008-10-25 18:45 [PATCH] xfstests: fix nr of args in open calls Eric Sandeen
@ 2008-10-25 20:17 ` Christoph Hellwig
  2008-10-25 20:19   ` Eric Sandeen
  2008-10-26  3:45 ` [PATCH V2] " Eric Sandeen
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2008-10-25 20:17 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Sat, Oct 25, 2008 at 01:45:53PM -0500, Eric Sandeen wrote:
> --- xfstests.orig/ltp/iogen.c
> +++ xfstests/ltp/iogen.c
> @@ -1060,7 +1060,11 @@ int 	nbytes;
>  
>      Oflags |= O_CREAT | O_WRONLY;
>  
> +#ifdef CRAY
>      if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
> +#else
> +    if ((fd = open(path, Oflags, 0666)) == -1) {
> +#endif

Do we really need that ifdef cray here?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: fix nr of args in open calls
  2008-10-25 20:17 ` Christoph Hellwig
@ 2008-10-25 20:19   ` Eric Sandeen
  2008-10-25 20:22     ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2008-10-25 20:19 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs-oss

Christoph Hellwig wrote:
> On Sat, Oct 25, 2008 at 01:45:53PM -0500, Eric Sandeen wrote:
>> --- xfstests.orig/ltp/iogen.c
>> +++ xfstests/ltp/iogen.c
>> @@ -1060,7 +1060,11 @@ int 	nbytes;
>>  
>>      Oflags |= O_CREAT | O_WRONLY;
>>  
>> +#ifdef CRAY
>>      if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
>> +#else
>> +    if ((fd = open(path, Oflags, 0666)) == -1) {
>> +#endif
> 
> Do we really need that ifdef cray here?

Not sure; Ocbits etc are set under the same #ifdef, xfsqa runs on irix,
and I'm not sure what all gets set on that build ...

-Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xfstests: fix nr of args in open calls
  2008-10-25 20:19   ` Eric Sandeen
@ 2008-10-25 20:22     ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2008-10-25 20:22 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs-oss

On Sat, Oct 25, 2008 at 03:19:08PM -0500, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> > On Sat, Oct 25, 2008 at 01:45:53PM -0500, Eric Sandeen wrote:
> >> --- xfstests.orig/ltp/iogen.c
> >> +++ xfstests/ltp/iogen.c
> >> @@ -1060,7 +1060,11 @@ int 	nbytes;
> >>  
> >>      Oflags |= O_CREAT | O_WRONLY;
> >>  
> >> +#ifdef CRAY
> >>      if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
> >> +#else
> >> +    if ((fd = open(path, Oflags, 0666)) == -1) {
> >> +#endif
> > 
> > Do we really need that ifdef cray here?
> 
> Not sure; Ocbits etc are set under the same #ifdef, xfsqa runs on irix,
> and I'm not sure what all gets set on that build ...

#ifdef CRAY is for Unicos, and I don't think xfsqa near it's current
version can run there.  I'd rather see all this striped out, but at
least no new occurances added.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH V2] xfstests: fix nr of args in open calls
  2008-10-25 18:45 [PATCH] xfstests: fix nr of args in open calls Eric Sandeen
  2008-10-25 20:17 ` Christoph Hellwig
@ 2008-10-26  3:45 ` Eric Sandeen
  2008-11-12  9:58   ` Christoph Hellwig
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2008-10-26  3:45 UTC (permalink / raw)
  To: xfs-oss

Fix a few problematic open calls which strict checking catches;
in most cases just missing a mode with O_CREAT.

Removed the #ifdef CRAY instance around one, per hch's request.

Somebody else can remove the rest, when motivated.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

Index: xfstests/ltp/iogen.c
===================================================================
--- xfstests.orig/ltp/iogen.c
+++ xfstests/ltp/iogen.c
@@ -1060,7 +1060,7 @@ int 	nbytes;
 
     Oflags |= O_CREAT | O_WRONLY;
 
-    if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
+    if ((fd = open(path, Oflags, 0666)) == -1) {
 	fprintf(stderr, "iogen%s:  Could not create/open file %s: %s (%d)\n",
 		TagName, path, SYSERR, errno);
 	return -1;
Index: xfstests/src/multi_open_unlink.c
===================================================================
--- xfstests.orig/src/multi_open_unlink.c
+++ xfstests/src/multi_open_unlink.c
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
 			return 1;
 		}
 
-		fd = open(path, O_RDWR|O_CREAT|O_EXCL);
+		fd = open(path, O_RDWR|O_CREAT|O_EXCL, 0666);
 		if (fd == -1) {
 			fprintf(stderr, "%s: failed to create \"%s\": %s\n", prog, path, strerror(errno));
 			return 1;
Index: xfstests/src/enospc_unlink.c
===================================================================
--- xfstests.orig/src/enospc_unlink.c
+++ xfstests/src/enospc_unlink.c
@@ -40,7 +40,7 @@ int main(int argc, char **argv)
 	memset(ptr, 0xffffffff, sz);
 
 	for (i = 0; i < count; i++) {
-		fd = open(argv[1], O_CREAT|O_WRONLY);
+		fd = open(argv[1], O_CREAT|O_WRONLY, 0666);
 		if (fd < 0) {
 			perror(argv[1]);
 			exit(1);
Index: xfstests/src/dmiperf.c
===================================================================
--- xfstests.orig/src/dmiperf.c
+++ xfstests/src/dmiperf.c
@@ -203,7 +203,7 @@ mkfile(char *name, char *attr)
 	ssize_t		wrote, wsize;
 	off64_t		bytes = fsize;
 
-	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT)) < 0) {
+	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT, 0666)) < 0) {
 		perror("open");
 		exit(1);
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] xfstests: fix nr of args in open calls
  2008-10-26  3:45 ` [PATCH V2] " Eric Sandeen
@ 2008-11-12  9:58   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2008-11-12  9:58 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

Folks can we please get this in?  This is breaking the xfstests build on
any modern distro.

On Sat, Oct 25, 2008 at 10:45:59PM -0500, Eric Sandeen wrote:
> Fix a few problematic open calls which strict checking catches;
> in most cases just missing a mode with O_CREAT.
> 
> Removed the #ifdef CRAY instance around one, per hch's request.
> 
> Somebody else can remove the rest, when motivated.
> 
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---
> 
> Index: xfstests/ltp/iogen.c
> ===================================================================
> --- xfstests.orig/ltp/iogen.c
> +++ xfstests/ltp/iogen.c
> @@ -1060,7 +1060,7 @@ int 	nbytes;
>  
>      Oflags |= O_CREAT | O_WRONLY;
>  
> -    if ((fd = open(path, Oflags, 0666, Ocbits, Ocblks)) == -1) {
> +    if ((fd = open(path, Oflags, 0666)) == -1) {
>  	fprintf(stderr, "iogen%s:  Could not create/open file %s: %s (%d)\n",
>  		TagName, path, SYSERR, errno);
>  	return -1;
> Index: xfstests/src/multi_open_unlink.c
> ===================================================================
> --- xfstests.orig/src/multi_open_unlink.c
> +++ xfstests/src/multi_open_unlink.c
> @@ -92,7 +92,7 @@ main(int argc, char *argv[])
>  			return 1;
>  		}
>  
> -		fd = open(path, O_RDWR|O_CREAT|O_EXCL);
> +		fd = open(path, O_RDWR|O_CREAT|O_EXCL, 0666);
>  		if (fd == -1) {
>  			fprintf(stderr, "%s: failed to create \"%s\": %s\n", prog, path, strerror(errno));
>  			return 1;
> Index: xfstests/src/enospc_unlink.c
> ===================================================================
> --- xfstests.orig/src/enospc_unlink.c
> +++ xfstests/src/enospc_unlink.c
> @@ -40,7 +40,7 @@ int main(int argc, char **argv)
>  	memset(ptr, 0xffffffff, sz);
>  
>  	for (i = 0; i < count; i++) {
> -		fd = open(argv[1], O_CREAT|O_WRONLY);
> +		fd = open(argv[1], O_CREAT|O_WRONLY, 0666);
>  		if (fd < 0) {
>  			perror(argv[1]);
>  			exit(1);
> Index: xfstests/src/dmiperf.c
> ===================================================================
> --- xfstests.orig/src/dmiperf.c
> +++ xfstests/src/dmiperf.c
> @@ -203,7 +203,7 @@ mkfile(char *name, char *attr)
>  	ssize_t		wrote, wsize;
>  	off64_t		bytes = fsize;
>  
> -	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT)) < 0) {
> +	if ((fd = open(name, O_WRONLY | O_CREAT | O_EXCL | O_DIRECT, 0666)) < 0) {
>  		perror("open");
>  		exit(1);
>  	}
> 
> 
---end quoted text---

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-12  9:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-25 18:45 [PATCH] xfstests: fix nr of args in open calls Eric Sandeen
2008-10-25 20:17 ` Christoph Hellwig
2008-10-25 20:19   ` Eric Sandeen
2008-10-25 20:22     ` Christoph Hellwig
2008-10-26  3:45 ` [PATCH V2] " Eric Sandeen
2008-11-12  9:58   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox