Commit 51eda068 authored by Zizhi Wo's avatar Zizhi Wo Committed by Baokun Li
Browse files

cachefiles: Change the mark inactive sequence in erofs ondemand mode

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT



--------------------------------

In the current erofs ondemand loading mode, after erofs is umounted and
object->fd is closed, run the inuse() command and it may reveal that the
corresponding object is still busy. This is because non-busy depends on
the cachefiles_mark_object_inactive() called, but it comes after send
close req.

Fix this issue by moving cachefiles_mark_object_inactive() before send
close request in erofs ondemand mode, as erofs ondemand mode will not set
retired flag, there is no extra impact.

Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
parent a8b9dd5e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -288,6 +288,11 @@ static void cachefiles_drop_object(struct fscache_object *_object)
	ASSERT((atomic_read(&object->usage) & 0xffff0000) != 0x6b6b0000);
#endif

	if (test_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags) &&
	    (volume_new_version(object->fscache.cookie) ||
	     data_new_version(object->fscache.cookie)))
		cachefiles_mark_object_inactive(cache, object, 0);

	cachefiles_ondemand_clean_object(object);

	/* We need to tidy the object up if we did in fact manage to open it.