Skip to contentSkip to conversation

mount/mount05.c: format the device when necessary

PATCH In review DAN LI 3 participants 4 messages Aug 27, 2013 – Aug 28, 2013

lore
Share & tools
lore

DAN LI

author
#0 lore raw

PATCH v2 1/1 mount/mount05.c: format the device when necessary

Format the device only when "-D device" & "-T type" are specified.

---
 testcases/kernel/syscalls/mount/mount05.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/mount/mount05.c +5 -3
index 4b2a07c..fb5a385 100644
@@ -113,7 +113,6 @@ int main(int argc, char *argv[])
 void setup(void)
 {
 	tst_require_root(NULL);
-	tst_mkfs(NULL, device, fstype, NULL);
 
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
@@ -122,9 +121,12 @@ void setup(void)
 	SAFE_MKDIR(cleanup, mntpoint_src, DIR_MODE);
 	SAFE_MKDIR(cleanup, mntpoint_des, DIR_MODE);
 
-	if (dflag && tflag)
+	if (dflag) {
+		tst_mkfs(NULL, device, fs_type, NULL);
+
 		if (mount(device, mntpoint_src, fs_type, 0, NULL) == -1)
 			tst_brkm(TBROK | TERRNO, cleanup, "mount failed");
+	}
 
 	SAFE_FILE_PRINTF(cleanup, file_src, "TEST FILE");
 
@@ -133,7 +135,7 @@ void setup(void)
 
 void cleanup(void)
 {
-	if (dflag && tflag)
+	if (dflag)
 		if (umount(mntpoint_src) != 0)
 			tst_brkm(TBROK | TTERRNO, NULL, "umount(2) failed");
 
Signature · 12 lines
1.8.1

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · DAN LI

Format the device only when "-D device" & "-T type" are specified.

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to DAN LI

Hi!

Quoted 4 lines

Format the device only when "-D device" & "-T type" are specified.

Acked.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#3 lore raw
In reply to DAN LI
Quoted 3 lines · DAN LI

Format the device only when "-D device" & "-T type" are specified.

Pushed, thank you.

Wanlong Gao

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list