Skip to contentSkip to conversation

syscalls/xattr: avoid creating whiteout device

PATCH New Eryu Guan 2 participants 2 messages Dec 17, 2015

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH 1/1 syscalls/xattr: avoid creating whiteout device

Do the same as in commit 3337c31d3577 ("syscalls: avoid creating whiteout device in tests"), because overlayfs refuses to create whiteout device.

---

I missed [sg]etxattr02.c in commit 3337c31d3577. After searching around all the tests I confirmed that [sg]etxattr02.c are the last two places to create whiteout device.

 testcases/kernel/syscalls/getxattr/getxattr02.c | 4 +++-
 testcases/kernel/syscalls/setxattr/setxattr02.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/getxattr/getxattr02.c +3 -1
index 1e991cf..8c5be0f 100644
@@ -118,6 +118,7 @@ int main(int argc, char *argv[])
 static void setup(void)
 {
 	int fd;
+	dev_t dev;
 
 	tst_require_root();
 
@@ -139,7 +140,8 @@ static void setup(void)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create FIFO(%s) failed",
 			 FIFO);
 
-	if (mknod(CHR, S_IFCHR | 0777, 0) == -1)
+	dev = makedev(1, 3);
+	if (mknod(CHR, S_IFCHR | 0777, dev) == -1)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create char special(%s)"
 			 " failed", CHR);
 
testcases/kernel/syscalls/setxattr/setxattr02.c +3 -1
index 169a9d6..0ae0b3f 100644
@@ -178,6 +178,7 @@ int main(int argc, char *argv[])
 static void setup(void)
 {
 	int fd;
+	dev_t dev;
 
 	tst_require_root();
 
@@ -213,7 +214,8 @@ static void setup(void)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create FIFO(%s) failed",
 			 FIFO);
 
-	if (mknod(CHR, S_IFCHR | 0777, 0) == -1)
+	dev = makedev(1, 3);
+	if (mknod(CHR, S_IFCHR | 0777, dev) == -1)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create char special(%s)"
 			 " failed", CHR);
 
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 syscalls/xattr: avoid creating whiteout device

----- Original Message -----

Quoted 10 lines

From: "Eryu Guan" <[email protected]>
To: [email protected]
Sent: Thursday, 17 December, 2015 2:52:34 PM
Subject: [LTP] [PATCH] syscalls/xattr: avoid creating whiteout device

Do the same as in commit 3337c31d3577 ("syscalls: avoid creating whiteout device in tests"), because overlayfs refuses to create whiteout device.

Thanks for the follow-up, pushed.

Regards,
Jan

Quoted 64 lines

---

I missed [sg]etxattr02.c in commit 3337c31d3577. After searching around all the
tests I confirmed that [sg]etxattr02.c are the last two places to create whiteout device.

 testcases/kernel/syscalls/getxattr/getxattr02.c | 4 +++-
 testcases/kernel/syscalls/setxattr/setxattr02.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/getxattr/getxattr02.c +3 -1
index 1e991cf..8c5be0f 100644
@@ -118,6 +118,7 @@ int main(int argc, char *argv[])
 static void setup(void)
 {
 	int fd;
+	dev_t dev;
 
 	tst_require_root();
 
@@ -139,7 +140,8 @@ static void setup(void)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create FIFO(%s) failed",
 			 FIFO);
 
-	if (mknod(CHR, S_IFCHR | 0777, 0) == -1)
+	dev = makedev(1, 3);
+	if (mknod(CHR, S_IFCHR | 0777, dev) == -1)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create char special(%s)"
 			 " failed", CHR);
 
testcases/kernel/syscalls/setxattr/setxattr02.c +3 -2
index 169a9d6..0ae0b3f 100644
@@ -178,6 +178,7 @@ int main(int argc, char *argv[])
 static void setup(void)
 {
 	int fd;
+	dev_t dev;
 
 	tst_require_root();
 
@@ -213,7 +214,8 @@ static void setup(void)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create FIFO(%s) failed",
 			 FIFO);
 
-	if (mknod(CHR, S_IFCHR | 0777, 0) == -1)
+	dev = makedev(1, 3);
+	if (mknod(CHR, S_IFCHR | 0777, dev) == -1)
 		tst_brkm(TBROK | TERRNO, cleanup, "Create char special(%s)"
 			 " failed", CHR);
 
--

2.5.0

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