[lkml]   [2011]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Union mount and lockdep design issues
    Michal Suchanek <> writes:

    > The locking order is likely determined by the structure of the union
    > and not some system-wide order of filesystems so assuming the readonly
    > layers are locked as well you will probably get a deadlock with
    > technically correct mount:
    > mount -t overlayfs overlayfs -olowerdir=/lower2,upperdir=/upper /tmpoverlay
    > mount -t overlayfs overlayfs -olowerdir=/lower1,upperdir=/tmpoverlay /overlay
    > mount -t overlayfs overlayfs -olowerdir=/lower1,upperdir=/upper2 /tmpoverlay2
    > mount -t overlayfs overlayfs -olowerdir=/lower2,upperdir=/tmpoverlay2 /overlay2
    > because now lower1 and lower2 are differently ordered in the two
    > overlays.

    Overlayfs never locks both upper and lower at the same time, which means
    there's no AB-BA locking dependency. The lock orderings are:

    -> /overlay
    -> /lower1
    -> /tmpoverlay
    -> /lower2
    -> /upper
    -> /overlay2
    -> /lower2
    -> /tmpoverlay2
    -> /lower1
    -> /upper2

    As you can see there's no nesting of lower2 and lower1 into each other.

    When you combine two filesystems, a completely new ordering is created
    each time, there's no possibility to make an AB-BA nesting. At least I
    cannot see one.


     \ /
      Last update: 2011-07-12 10:31    [W:0.029 / U:44.376 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site