[Gluster-devel] Lazy umount emulation

Emmanuel Dreyfus manu at netbsd.org
Sat Sep 20 14:25:59 UTC 2014


Hello

In http://review.gluster.com/8649 I attempt to emulate lazy umount on
systems that lacks this Linux-only feature. I do this by spawning a
thread that periodically attempt to umount and then rmdir the mount
point.

That works nicely for some scenario (it lets NetBSD pass
tests/basic/pump.t), but fail in others (tests/basic/quota.t) where a
process calls lazy umount and exits before it unmount actually happens.
In that case, the umount thread is terminated with the process and I am
screwed.

I see two solutions:

1) ask glusterd to do it. 
I could reuse glusterd_handle_umount() and add a rmdir option in the
dict, but there may be a security problem:  glusterd_handle_umount()
checks that the requested path is within mountbroker-root, and it may be
a bad idea to accept umount/rmdir for random paths

2) spawn an independant process.
I could write a external program in contrib that does the job, on lazy
umount request, just fork and execute it. Since the external program
runs with the privilege of whoever calls it, there is no security issue.

I imagine something like this:
umount-lazy -p path -d dev [-r]
(dev is the dev_t of the mount point, useful to detect umount was done,
-r is for rmdir)

What is the preferred way?


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu at netbsd.org


More information about the Gluster-devel mailing list