]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: constant d_ino across copy up
authorAmir Goldstein <amir73il@gmail.com>
Thu, 11 May 2017 13:42:27 +0000 (16:42 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 27 Jul 2017 19:54:06 +0000 (21:54 +0200)
commit174c0a24e85c37580d09ac8fb96c1de961b810d5
tree0217b12438c8b44a6949dfc636ce473f33b0e311
parentf5ea9c07828fb479e3cd8bf8145bd3b8b7dcf342
ovl: constant d_ino across copy up

When all layers are on the same fs, and iterating a directory which may
contain copy up entries, call vfs_getattr() on the overlay entries to make
sure that d_ino will be consistent with st_ino from stat(2).

There is an overhead of lookup per upper entry in readdir.

The overhead is minimal if the iterated entries are already in dcache.  It
is also quite useful for the common case of 'ls -l' that readdir() pre
populates the dcache with the listed entries, making the following stat()
calls faster.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/readdir.c