Manvendra Bhangui wrote:
> Now let say I delete a user who has a directory
> in /var/vpopmail/domains/1
> The backfill code will put the entry '1' in the first line in the file
> So after deleting 3 users, the file dir_control_free will have 3 lines
> Each time the function backfill() is called it will deplete the file
> dir_control_free by one line and will always return the first line as
> the user_hash. When all lines get depleted, backfill() will return NULL
> in which case the regular dir_control will again come into effect and
> start from where it had left earlier.
Okay. I can definitely see how this would work. It is a reasonable
solution, and I'd be very interested to see a completed patch against
the CVS head.
The one comment I would make is that it's okay for user deletion to be
an expensive call since it won't be being done nearly as much as queries
for user information, but that depending upon the number of users a system
has, for instance, where the hash levels have tripled up, the dir_control_free
file would become very large and your solution requires a re-write of the file
It would be interesting to see a more efficient method where duplicates,
as in your example, the hash directory 2, could be listed a single time.
Remember that this feature does not yet exist, and that there are probably
many systems with backfilling needs that go back years. Potentially this
patch could hit a system with four levels of hashing simply because there's
been a lot of additions and deletions. If the backfill patch doesn't take
this into consideration, we may need to consider writing some sort of
utility to analyze and "clean", a system that is "overhashed".
> The advantage of this method is that you can use the find command to
> generate the missing directories in dir_control_free to catch up with
> the actual dir_control.
> Another way to explain this is that when backfill is in operation,
> dir_control stops working and when backfill() gets depleted and stops
> working, dir_control starts working
Matt Brookings <m...@inter7.com> GnuPG Key D9414F70
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465