linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.32k stars 1.01k forks source link

mount: Add tests for missing flags: MS_LAZYTIME, MS_NOSYMFOLLOW, #960

Open pevik opened 2 years ago

pevik commented 2 years ago

Mount tests are missing tests for MS_LAZYTIME (since 4.0) and MS_NOSYMFOLLOW (5.10). Also MS_SYNCHRONOUS needs to be rewritten: https://lore.kernel.org/ltp/YvtkAWs7KNbt9vME@yuki/

The only way how to check MS_SYNCHRONOUS would be pulling out the device just after write before page cache had a chance to write out data but not before the disk flushes its caches.

I guess that it may be possible to check this if create a loop device, mount it MS_SYNCHRONOUS, write to a file on the loop device and check that the data has been written to the underlying file. But that would be completely different and quite complex test.

MS_NOSYMFOLLOW should be easy enough, we just need to create a symlink to a file and then attempt to open it. We shouldn't end up with a fd to the symlinked file in that case.

MS_LAZYTIME would be again complicated since that is about deffering timestamps in memory so it would be similar to MS_SYNCHRONOUS in the terms of complexity.