[lvm-devel] [PATCH 12/12] Remove init_full_scan_done(0) call after create_toolcontext().

Alasdair G Kergon agk at redhat.com
Thu Dec 11 23:10:05 UTC 2008


On Wed, Dec 10, 2008 at 10:26:18PM -0500, Dave Wysochanski wrote:
> _full_scan_done is initialized to 0 at compile time

But as with patch 10, its state should be considered 'undefined' when
create_toolcontext is called.
That initialisation does not include a full device scan (because many
commands that could be run would not require it) and on return from that
function you need it to be set to 0.

If the list of devices is read in from .cache then some code does not
need to scan but other code may still choose to scan.

> Is this a bug?  Why are we setting _full_scan_done = 0 here when we've
> already read the config file(s) for the 'scan' and other variables, then
> scanned the system for devices as shown above?  

We haven't scanned the system at that point.

This scanning code is certainly messy, but it will become 'legacy' when the
udev integration work is done, so it's not worth spending much time on.
(It's a while now since we've had a bug report against this scanning code
so it's best not to change the behaviour of code paths.)

Alasdair
-- 
agk at redhat.com




More information about the lvm-devel mailing list