Re: [PATCH] check_layer: Add tests for constant st_dev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 7, 2017 at 11:35 PM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:

> Chandan,
>
> I think your tests will fail on upstream kernel and older kernels.
>
> The test matrix to verify is at least:
>  run --ov[=1] [--samefs] with kernel [v4.11|v4.12|overlayfs-next]
>  run --ov[=1] --samefs --verify with kernel [4.12|overlayfs-next]
>  run --ov[=1] --verify with kernel overlayfs-devel (with your patch)
> * all overlayfs Kconfig options set to y
>
> Maybe something like this.
> It is not tested at all, so may be bogus. Please reply on specific
> lines if you don't
> follow the reasoning:
>

Sorry for all the messed up spaced and line wrapping...

>         if self.skip_layer_test():
>             pass
>         elif dentry.is_dir():
>             # Directory inodes are always on overlay st_dev
>             if dev != self.upper_dir_fs():
>                 raise TestError(name + ": Directory not on union layer")
>             pass
>         elif self.config().is_samefs():
>             # With samefs setup, files are on overlay st_dev if st_ino
> is constant
>             # on copy up and on real st_dev if st_ino is not constant.
>             # --verify verifies constant st_ino, so it implies overlay
> st_dev check.
>             # Without --verify, we allow for both options.
>             if  dev == self.upper_dir_fs():
>                 pass
>             if  self.config().is_verify():
>                 raise TestError(name + ": File not on union layer")
>             if dev != self.upper_fs():
>                raise TestError(name + ": File unexpectedly not on
> lower/upper layer")
>             pass
>         else
>             # With non samefs setup, files are on pseudo or upper
> st_dev if st_ino
>             # is constant on copy up and on lower or upper st_dev if
> st_ino is not constant.
>             # --verify verifies constant st_ino, so it implies pseudo
> st_dev check.
>             # Without --verify we allow for both options.

>             # Lower file can be on upper fs when rotating upper layers (--ov=N).
>             # TODO: stricter lower/upper checks for --ov=0.

Don't think this comment about Lower file is relevant to these test cases.
I think in this context, not dentry.on_upper() means on lowermost layer,
which is either self.lower_fs() or pseudo dev.

>             if  dev == self.upper_dir_fs():
>                 raise TestError(name + ": File unexpectedly on union layer")
>             if dev == self.upper_fs():
>                 if not dentry.on_upper():
>                     raise TestError(name + ": File unexpectedly on upper layer")
>                 pass
>             if self.config().is_verify()
>                 if dev == self.lower_fs():
>                     # Overlayfs returns pseudo st_dev or upper st_dev,
> but never the lower layer
>                     raise TestError(name + ": File unexpectedly on lower layer")
>                 pass
>             if dev != self.upper_fs() and dev != self.lower_fs():
>                raise TestError(name + ": File unexpectedly not on
> lower/upper layer")

Yeah, this last test is wrong because without --verify, pseudo st_dev
is still allowed.
Instead could check:
             if dev == self.lower_fs() and dentry.on_upper():
                raise TestError(name + ": File unexpectedly on lower layer")


>             pass
>
>          if dentry.is_sym() and dentry not in symlinks:
>              symlinks.add(dentry)
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux