Re: Remove BKL from FAT/VFAT/MSDOS (v1) (was Re: Fw: Regressioncaused by bf726e "semaphore: fix,")

From: Linus Torvalds
Date: Fri May 16 2008 - 18:59:08 EST

On Fri, 16 May 2008, Linus Torvalds wrote:
> [...] but I do think this is at
> least an interesting starting point, and it's at least not "totally
> obviously broken".

To clarify: lock_super() is actually a much *stronger* lock than
lock_kernel(), which is why testing is actually interesting: the locking
hasn't been weakened, it's actually become much stricter (because unlike
the kernel lock, the superblock lock is kept over scheduling events, and
doesn't silently nest).

So the most likely failure case is not that some locking went away and
you'd race on the data structures, it's that something deadlocks on itself
if the locking isn't right.

There could be some implicit kernel lock I missed (ie something that acts
like the "ioctl" callback I already mentioned), of course, so I'm not
going to swear myself blue in the face that there isn't a new race, but on
the whole this patch should be pretty safe from the angle that at least
the obvious locking bugs should cause deadlocks, not race conditions.

And if you enable lockdep, the deadlocks aren't silent deaths, but clear
"this is where you took it, and here is where you deadlocked due to
nesting" reports in dmesg. So this should be eminently debuggable even by
almost total newbies that are just interested in BKL removal.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at