Di, regarding your question in http://review.whamcloud.com/10274
Is it easy to add more flags here? Since I need a flag to indicate the directory is orphan, so no one can create sub-directory or file under this orphan anymore.
right now we store this flag in memory of mdd object, but then it would not be transferred to remote target. (see LU-7579)
So the orphan has to be marked as a permanent flag in OSD layer, then osp_attr_get() can retrieve this flag, and aware of the orphan status. Please add comments in LU-7579.
These flags are direct mapping a from the EXT4_*_FL inode flags, so it is a bit tricky to add new values here, since most of them are checked by e2fsck.
There is one flag - EXT4_IMAGIC_FL which means that the inode is disconnected and does not have a parent, but it also needs a superblock feature flag to be set to be valid.
It is also possible to prevent new files to be created in a directory by setting the nlink count = 0, I think, and adding it to add the orphan inode list. However, that is pretty ldiskfs-specific.
What about a "compat" flag in the LMA? Is that sent to the remote MDT? That would at least be consistent with ZFS and ldiskfs.
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/18024/
Subject:
LU-7579osd: move ORPHAN/DEAD flag to OSDProject: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 098fb363c3902f67b29ddfa864b452d0a8460ad2