Re: Union mount and lockdep design issues

From: Peter Zijlstra
Date: Mon Jul 11 2011 - 10:02:40 EST


On Mon, 2011-07-11 at 14:54 +0100, David Howells wrote:
>
> I think I misunderstood you, then. 'Fully formed' in what sense? I assumed
> you meant populated on disk.

I meant, sb exists and has inodes. It would be easier to deal with if
the union mount creates all sb involved, because then we can set the
proper lock class from the start and not have to worry about existing
state.

> I'll post the two patches I have to deal with this. The first propagates the
> mount flags to sget() and the second makes use of MS_UNION in sget() to key the
> locks appropriately.

Right, note that the patch I provided has a number of problems, for one
it assumes inodes are unused and unlocked in that reclassify loop,
furthermore even by holding inode_sb_list_lock there is a race with
inode creation because we set the lock keys before adding to the
s_inodes list.

Anyway, it does illustrate the idea and someone more versed in vfs can
make it work, I hope ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/