+6
−0
+6
−0
+2
−0
+2
−2
Loading
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT -------------------------------- When an erofs file system is mounted with ondemand mode, if the cache root directory bound to cachefiles named rootdir, the resulting directory structure is seen as follows, where different directories corresponded to the objects of different levels: rootdir ____|____ | | cache(obj0) graveyard | domain_dir(obj1) | hash_dir | back_data.img(obj2) In the current logic, if cull is executed on the cache directory, it first determines whether the object corresponding to the directory is the active node of cache. If yes, it cannot be executed. If the fscache_object lookup successfully, it is set to avtive node; and if the lookup fails or the object state machine goes into drop, it is set to inactive. Currently cachefiles_daemon_cull() can execute on any directory or file which have not been called cachefiles_mark_object_active(), and we want to reduce the scope of this function. On the one hand, the user state needs to add relevant constraints; on the other hand, kernel mode also needs modified. This patch adds the restriction of filesystem-level isolation. In addition, the top-level cache dir can be culled directly because obj0 is not added as active_node. This causes the entire cache directory to be renamed graveyard, even though the underlying objects are inuse state, and cannot be resolved by mounting it again. Fix it by marking it as active in cachefiles_daemon_add_cache(). Signed-off-by:Zizhi Wo <wozizhi@huawei.com> Signed-off-by:
Baokun Li <libaokun1@huawei.com>