Skip to content

Commit

Permalink
daemon: speed up create_mandatory_directories
Browse files Browse the repository at this point in the history
Makes find skip files already owned by 'ceph' user when launching
chown command; chown will unconditionally re-apply the ownership
causing a lot of writes.

It looks like we use this function not only when it is necessary
to create the directories but also when there is existing data into
those, as a safety measure.

Resolves: #1536
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1784047
Signed-off-by: Giulio Fidente <[email protected]>
(cherry picked from commit 625630c)
  • Loading branch information
gfidente authored and dsavineau committed Dec 18, 2019
1 parent a1d3e41 commit 04bf62c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/daemon/common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function create_mandatory_directories {

# Adjust the owner of all those directories
chown "${CHOWN_OPT[@]}" -R ceph. /var/run/ceph/
find -L /var/lib/ceph/ -mindepth 1 -maxdepth 3 -exec chown "${CHOWN_OPT[@]}" ceph. {} \;
find -L /var/lib/ceph/ -mindepth 1 -maxdepth 3 -not \( -user ceph -or -group ceph \) -exec chown "${CHOWN_OPT[@]}" ceph. {} \;
}

# Print resolved symbolic links of a device
Expand Down

0 comments on commit 04bf62c

Please sign in to comment.