title: Is there a way to wait until root filesystem is mounted?
body: <p>I have a statically linked code(not a module) in kernel that should launch kernel thread <em>after</em> root file system is mounted. The problem is I don't know how to do this without modifying prepare_namespace() kernel function. I thought it's possible to do via initcalls but
  they're executed before kernel takes care about rootfs.
  Does anyone know the best way to do this?</p>
  
  <p><strong>UPDATE [1]:</strong> @BenVoigit suggested the following solution in comments:
  <em>Seems like you should open /proc/mounts and poll_wait on it. See the source for `mounts_poll'</em></p>
  
  <p><strong>UPDATE [2]:</strong> I looked at RSBAC patches, RSBAC modifies prepare_namespace() function to make some actions <em>after</em> filesystem is mounted. It seems to be the easiest way.</p>