From: dongshengyuan <545258830@qq.com> Date: Mon, 29 Jun 2026 02:20:36 +0000 (+0800) Subject: tmpfiles: propagate clean_item_instance() error in clean_item() X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4393625a1bddded558ab72b53ec58d6f511c7809;p=thirdparty%2Fsystemd.git tmpfiles: propagate clean_item_instance() error in clean_item() The CREATE_DIRECTORY, TRUNCATE_DIRECTORY, CREATE_SUBVOLUME, CREATE_SUBVOLUME_INHERIT_QUOTA, CREATE_SUBVOLUME_NEW_QUOTA and COPY_FILES branches in clean_item() called clean_item_instance() but discarded its return value, always returning 0. If dir_cleanup() fails (e.g. cannot stat a subdirectory), the error is silently swallowed and the caller has no way to detect the failure. The sibling EMPTY_DIRECTORY/IGNORE_PATH branches already propagate the error correctly via glob_item(). Signed-off-by: dongshengyuan --- diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 738f09a9633..620ab9486e1 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -3486,8 +3486,7 @@ static int clean_item(Context *c, Item *i) { case CREATE_SUBVOLUME_INHERIT_QUOTA: case CREATE_SUBVOLUME_NEW_QUOTA: case COPY_FILES: - clean_item_instance(c, i, i->path, CREATION_EXISTING); - return 0; + return clean_item_instance(c, i, i->path, CREATION_EXISTING); case EMPTY_DIRECTORY: case IGNORE_PATH: