<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Viresh Kumar <<a href="mailto:viresh.kumar@linaro.org" target="_blank">viresh.kumar@linaro.org</a>> wrote:<br></div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail_default" style="font-size:small">....</span><br>
+/*<br>
+ * Copyright (c) 2020 Viresh Kumar <<a href="mailto:viresh.kumar@linaro.org" target="_blank">viresh.kumar@linaro.org</a>><br>
+ *<br>
+ * Description:<br>
+ * Basic fsmount() test.<br>
+ */<br>
+#include "tst_test.h"<br>
+#include "lapi/fsmount.h"<br></blockquote><div><span class="gmail_default" style="font-size:small"><br></span></div><div><span class="gmail_default" style="font-size:small">Adding #</span>include "lapi/fcntl.h"<span class="gmail_default" style="font-size:small"> in case of </span>‘AT_FDCWD’ undeclared<span class="gmail_default" style="font-size:small">. It seems we have to do this for all the tests involves  ‘AT_FDCWD’.</span></div><div><span class="gmail_default"></span><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+static void run(void)<br>
+{<br>
<span class="gmail_default" style="font-size:small">...</span><br>
+<br>
+       TEST(fsmount(fd, 0, 0));<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">As this fsmount01.c is duplicated with zlang@'s patch, I suggest rewriting an enhancement version maybe name fsmount02.c to cover more fsmount attributes. Since it is named basic fsmount() test, it shouldn't only test fsmount(fd, 0, 0), right?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">+#define MOUNT_ATTR_RDONLY      0x00000001 /* Mount read-only */<br>+#define MOUNT_ATTR_NOSUID      0x00000002 /* Ignore suid and sgid bits */<br>+#define MOUNT_ATTR_NODEV       0x00000004 /* Disallow access to device special files */<br>+#define MOUNT_ATTR_NOEXEC      0x00000008 /* Disallow program execution */<br>+#define MOUNT_ATTR__ATIME      0x00000070 /* Setting on how atime should be updated */<br>+#define MOUNT_ATTR_RELATIME    0x00000000 /* - Update atime relative to mtime/ctime. */<br>+#define MOUNT_ATTR_NOATIME     0x00000010 /* - Do not update access times. */<br>+#define MOUNT_ATTR_STRICTATIME 0x00000020 /* - Always perform atime updates */<br>+#define MOUNT_ATTR_NODIRATIME  0x00000080 /* Do not update directory access times */<br></div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+       if (TST_RET == -1)<br>
+               tst_brk(TFAIL | TERRNO, "fsmount() failed");<br>
+<br>
+       fsmfd = TST_RET;<br>
+<br>
+       TEST(move_mount(fsmfd, "", AT_FDCWD, MNTPOINT,<br>
+                       MOVE_MOUNT_F_EMPTY_PATH));<br>
+       SAFE_CLOSE(fsmfd);<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I guess we probably need a way to verify the move_mount() does work. The function ismount() in zlang@'s patch could be extracted into the library as tst_ismount() for all of these tests.</div><div class="gmail_default" style="font-size:small"><a class="gmail_plusreply" id="m_-5960756315931134695plusReplyChip-0" href="mailto:pvorel@suse.cz" target="_blank">@Petr Vorel</a>  WDT?<br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+       if (TST_RET == -1)<br>
+               tst_brk(TBROK | TERRNO, "move_mount() failed");<br>
+<br>
+       SAFE_CLOSE(TST_RET);<br>
+       TEST(umount(MNTPOINT));<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">SAFE_UMOUNT(MNTPOINT);</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+       tst_res(TPASS, "fsmount() passed");<br>
+}<br>
+<br>
+static struct tst_test test = {<br></blockquote><div> </div><div><span class="gmail_default" style="font-size:small">Suggest referring to my previous comments for this part.</span> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+       .min_kver = "5.2",<br>
+       .test_all = run,<br>
+       .setup = setup,<br>
+       .cleanup = cleanup,<br>
+       .needs_root = 1,<br>
+       .needs_tmpdir = 1,<br>
+       .format_device = 1,<br>
+       .mntpoint = MNTPOINT,<br>
+};<br></blockquote><div> </div></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>