While poking around at the hot adding of disks in the kernel, I found what I 
think is an error in the function hot_add_disk() in md.c. This is a stock 
2.0.35 with raid0145-19981005-C-2.0.35 applied.

line 2087 performs a cli(). The error conditions inside this atomic 
operation all goto 'abort_unbind_export', which is after the 
corresponding sti().

Two of the three error conditions correctly call sti() before doing the 
goto. However:

        if (disk_removed(disk)) {
                /*
                 * reuse slot
                 */
                if (disk->number != i) {
                        MD_BUG();
                        err = -EINVAL;
                        goto abort_unbind_export;
                }
        } ...

... doesn't appear to do the right thing. Granted, this case shouldn't 
occur, but given that the code exists, it would probably be a good idea 
to sti().

Unless I missed something entirely.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Jorj Bauer                                  |       [EMAIL PROTECTED]
Systems Programmer / Network Specialist     |         200 S. 33rd St.
School of Engineering and Applied Science   |    Moore Building, Room 164
University of Pennsylvania                  |     Philadelphia, PA 19104
http://binky.seas.upenn.edu/~jorj           | O: 215/898-0575 F: 215/898-1195
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to