Hi!
> Yes, mounting B is unnecessary and it does not affect the test result.
> The test() function can be simplified to:
>
> static void test(void)
> {
> /* unshares the mount ns */
> if (unshare(CLONE_NEWNS) == -1)
> tst_brkm(TBROK | TERRNO, cleanup, "unshare failed");
> /* makes sure mounts/umounts have no effect on a real system */
> SAFE_MOUNT(cleanup, "none", "/", "none", MS_REC|MS_PRIVATE, NULL);
>
> /* bind mounts DIRA to itself */
> SAFE_MOUNT(cleanup, DIRA, DIRA, "none", MS_BIND, NULL);
> /* makes mount DIRA unbindable */
> SAFE_MOUNT(cleanup, "none", DIRA, "none", MS_UNBINDABLE, NULL);
>
> /* tries to bind mount unbindable DIRA to DIRB which should fail */
> if (mount(DIRA, DIRB, "none", MS_BIND, NULL) == -1) {
> tst_resm(TPASS, "unbindable mount passed");
> } else {
> SAFE_UMOUNT(cleanup, DIRB);
> tst_resm(TFAIL, "unbindable mount faled");
> }
>
> SAFE_UMOUNT(cleanup, DIRA);
> }
I've simplified the test function and updated the test description (in
the comment at the start of the file) and pushed, thanks.
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list