All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] t_truncate_self: describe self better in error message
@ 2016-10-19  8:52 Amir Goldstein
  2016-10-19  8:52 ` [PATCH 2/3] overlay/013: fix bug in test_upper creation Amir Goldstein
  2016-10-19  8:52 ` [PATCH 3/3] overlay/013: adjust test expectation to kernel v4.8 Amir Goldstein
  0 siblings, 2 replies; 3+ messages in thread
From: Amir Goldstein @ 2016-10-19  8:52 UTC (permalink / raw)
  To: Miklos Szeredi, Eryu Guan, Xiong Zhou; +Cc: linux-unionfs, fstests

Include the name of the program that is trying to trucate itself
to error messages to distinguish between output for different
test cases (e.g. test_lower and test_upper in overlay/013).

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 src/t_truncate_self.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/t_truncate_self.c b/src/t_truncate_self.c
index d14dec3..3f1c8e6 100644
--- a/src/t_truncate_self.c
+++ b/src/t_truncate_self.c
@@ -1,18 +1,21 @@
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
+#include <libgen.h>
 
 int main(int argc, char *argv[])
 {
+	const char *progname = basename(argv[0]);
 	int ret;
 
 	ret = truncate(argv[0], 4096);
 	if (ret != -1) {
-		fprintf(stderr, "truncate(argv[0]) should have failed\n");
+		fprintf(stderr, "truncate(%s) should have failed\n",
+			progname);
 		return 1;
 	}
 	if (errno != ETXTBSY) {
-		perror("truncate(argv[0])");
+		perror(progname);
 		return 1;
 	}
 
-- 
2.7.4

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

* [PATCH 2/3] overlay/013: fix bug in test_upper creation
  2016-10-19  8:52 [PATCH 1/3] t_truncate_self: describe self better in error message Amir Goldstein
@ 2016-10-19  8:52 ` Amir Goldstein
  2016-10-19  8:52 ` [PATCH 3/3] overlay/013: adjust test expectation to kernel v4.8 Amir Goldstein
  1 sibling, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2016-10-19  8:52 UTC (permalink / raw)
  To: Miklos Szeredi, Eryu Guan, Xiong Zhou; +Cc: linux-unionfs, fstests

test_upper file was supposed to be in upper layer,
but it was wrongly created in lower layer.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/013 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/overlay/013 b/tests/overlay/013
index 09f3eb1..e92eeec 100755
--- a/tests/overlay/013
+++ b/tests/overlay/013
@@ -59,7 +59,7 @@ upperdir=$SCRATCH_DEV/$OVERLAY_UPPER_DIR
 mkdir -p $lowerdir
 mkdir -p $upperdir
 cp $here/src/t_truncate_self $lowerdir/test_lower
-cp $here/src/t_truncate_self $lowerdir/test_upper
+cp $here/src/t_truncate_self $upperdir/test_upper
 
 _scratch_mount
 
-- 
2.7.4

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

* [PATCH 3/3] overlay/013: adjust test expectation to kernel v4.8
  2016-10-19  8:52 [PATCH 1/3] t_truncate_self: describe self better in error message Amir Goldstein
  2016-10-19  8:52 ` [PATCH 2/3] overlay/013: fix bug in test_upper creation Amir Goldstein
@ 2016-10-19  8:52 ` Amir Goldstein
  1 sibling, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2016-10-19  8:52 UTC (permalink / raw)
  To: Miklos Szeredi, Eryu Guan, Xiong Zhou; +Cc: linux-unionfs, fstests

Commit 4d0c5ba (vfs: do get_write_access() on upper layer of overlayfs)
that was merged for kernel v4.8 changes the behavior of execve+truncate
in a subtle way.

When file is executed from lower and then truncated, the truncation is
allowed, becasue it only affects the size of the copied up file and does
not affect the VM mapping of the executed lower file.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/overlay/013     | 1 -
 tests/overlay/013.out | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/overlay/013 b/tests/overlay/013
index e92eeec..e99e10a 100755
--- a/tests/overlay/013
+++ b/tests/overlay/013
@@ -69,6 +69,5 @@ $SCRATCH_MNT/test_lower
 $SCRATCH_MNT/test_upper
 
 # success, all done
-echo "Silence is golden"
 status=0
 exit
diff --git a/tests/overlay/013.out b/tests/overlay/013.out
index 3e66423..b2c7cc7 100644
--- a/tests/overlay/013.out
+++ b/tests/overlay/013.out
@@ -1,2 +1,2 @@
 QA output created by 013
-Silence is golden
+truncate(test_lower) should have failed
-- 
2.7.4

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

end of thread, other threads:[~2016-10-19 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19  8:52 [PATCH 1/3] t_truncate_self: describe self better in error message Amir Goldstein
2016-10-19  8:52 ` [PATCH 2/3] overlay/013: fix bug in test_upper creation Amir Goldstein
2016-10-19  8:52 ` [PATCH 3/3] overlay/013: adjust test expectation to kernel v4.8 Amir Goldstein

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.