[systemd-devel] [PATCH] tmpfiles.c: Honor ordering within files as the docs say.
Lennart Poettering
lennart at poettering.net
Wed Apr 22 09:31:09 PDT 2015
On Wed, 22.04.15 18:19, Lennart Poettering (lennart at poettering.net) wrote:
> On Thu, 05.03.15 11:13, Randy Witt (randy.e.witt at linux.intel.com) wrote:
>
> Sorry for the late review!
>
> > Previously, globs would always get processed first followed by any other
> > items in arbitrary order. This is contrary to the documentation which
> > states "Otherwise, the files/directories are processed in the order they
> > are listed."
> >
> > To fix this, remove the separate "globs" hashmap, and instead use only one
> > marking each entry as a glob or not. There should be little overhead
> > from doing this, considering the only time nested processing will occur
> > is for processing of globs which are not of type "X".
>
> Hmm, I figure the patch makes sense. Can you rebase this on current
> git, please?
>
> Also, any chance you can split this up in two patces, one that moves
> this to ordered hashmaps, and the other which then merges the two
> hashmaps? Should be much easier to review, then.
So I looked into this in more detail now, and made the change to
ordered hashmap now already. However, I don't think we should merge
the two hashmaps. The reasons for this is actually documented in the
code: lines that take globs *adjust* files or other fs objects, while
lines that do not take globs *create* files or other fs objects. I
think it is a good idea, to make sure that the lines that create files
should be processed before the ones that adjust them, so that the
adjustments are always applied to *all* files that exist in the fs
after tmpfiles finished.
I have updated the man page to explain this now.
I hope this makes sense!
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list