> If you are intrested in the design of aufs, please take a look at these
> documents and let me know your impression or anything including my poor
> English.


FMODE_EXEC and deny_write()
----------------------------------------------------------------------
Generally Unix prevents an executing file from writing its filedata.
In linux it is implemented by deny_write() and allow_write().
When a file is executed by exec() family, open_exec() (and sys_uselib())
they opens the file and calls deny_write(). If the file is aufs's virtual
one, it has no meaning. The file which deny_write() is really necessary
is the file on a branch. But the FMODE_EXEC flag is not passed to
->open() operation. So aufs adopt a dirty trick.

- in order to get FMODE_EXEC, aufs ->lookup() and ->d_revalidate() set
  nd->intent.open.file->private_data to nd->intent.open.flags temporary.
- in aufs ->open(), when FMODE_EXEC is set in file->private_data, it
  calls deny_write() for the file on a branch.
- when the aufs file is released, allow_write() for the file on a branch
  is called.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

Reply via email to