All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] nfs_flock: fail the test if lock/unlock ops fail
@ 2022-01-12 16:19 Nikita Yushchenko via ltp
  2022-01-12 16:19 ` [LTP] [PATCH] nfs_lib.sh: run exportfs at "server side" in LTP_NETNS case Nikita Yushchenko via ltp
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Nikita Yushchenko via ltp @ 2022-01-12 16:19 UTC (permalink / raw)
  To: ltp; +Cc: Nikita Yushchenko

Since nfs_flock is testing locking operations, ignoring errors returned
from those operations is nonsense.

Signed-off-by: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
---
 testcases/network/nfs/nfslock01/nfs_flock.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/testcases/network/nfs/nfslock01/nfs_flock.c b/testcases/network/nfs/nfslock01/nfs_flock.c
index a7673c751..a13ddd251 100644
--- a/testcases/network/nfs/nfslock01/nfs_flock.c
+++ b/testcases/network/nfs/nfslock01/nfs_flock.c
@@ -63,16 +63,20 @@ int main(int argc, char **argv)
 				continue;
 		}
 
-		if (writeb_lock(fd, offset, SEEK_SET, BYTES) < 0)
-			printf("failed in writeb_lock, Errno = %d", errno);
+		if (writeb_lock(fd, offset, SEEK_SET, BYTES) < 0) {
+			printf("failed in writeb_lock, Errno = %d\n", errno);
+			exit(1);
+		}
 
 		lseek(fd, offset, SEEK_SET);
 
 		/* write to the test file */
 		write(fd, buf, BYTES);
 
-		if (unb_lock(fd, offset, SEEK_SET, BYTES) < 0)
-			printf("failed in unb_lock, Errno = %d", errno);
+		if (unb_lock(fd, offset, SEEK_SET, BYTES) < 0) {
+			printf("failed in unb_lock, Errno = %d\n", errno);
+			exit(1);
+		}
 	}
 	exit(0);
 }
-- 
2.30.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2023-04-29 19:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 16:19 [LTP] [PATCH] nfs_flock: fail the test if lock/unlock ops fail Nikita Yushchenko via ltp
2022-01-12 16:19 ` [LTP] [PATCH] nfs_lib.sh: run exportfs at "server side" in LTP_NETNS case Nikita Yushchenko via ltp
2022-01-13 15:50   ` Petr Vorel
2022-01-13 16:27     ` Nikita Yushchenko via ltp
2022-01-14 20:23       ` Petr Vorel
2022-01-14 21:29         ` Nikita Yushchenko via ltp
2022-01-13 17:21 ` [LTP] [PATCH] nfs_flock: fail the test if lock/unlock ops fail Petr Vorel
2022-01-14  9:31 ` Martin Doucha
2022-01-14 20:03   ` Petr Vorel
2023-04-29 19:28     ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.