Repository navigation
Commit 345f379
ovl: hash non-dir by lower inode for fsnotify
commit 764baba upstream.
Commit 31747ed ("ovl: hash directory inodes for fsnotify")
fixed an issue of inotify watch on directory that stops getting
events after dropping dentry caches.
A similar issue exists for non-dir non-upper files, for example:
$ mkdir -p lower upper work merged
$ touch lower/foo
$ mount -t overlay -o
lowerdir=lower,workdir=work,upperdir=upper none merged
$ inotifywait merged/foo &
$ echo 2 > /proc/sys/vm/drop_caches
$ cat merged/foo
inotifywait doesn't get the OPEN event, because ovl_lookup() called
from 'cat' allocates a new overlay inode and does not reuse the
watched inode.
Fix this by hashing non-dir overlay inodes by lower real inode in
the following cases that were not hashed before this change:
- A non-upper overlay mount
- A lower non-hardlink when index=off
A helper ovl_hash_bylower() was added to put all the logic and
documentation about which real inode an overlay inode is hashed by
into one place.
The issue dates back to initial version of overlayfs, but this
patch depends on ovl_inode code that was introduced in kernel v4.13.
Cc: <stable@vger.kernel.org> #v4.13
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Mark Salyzyn <salyzyn@android.com> #4.14
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d134e91)
Orabug: 29634764
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>1 parent 88584ff commit 345f379
1 file changed
Lines changed: 44 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
608 | 609 | | |
609 | 610 | | |
610 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
611 | 645 | | |
612 | 646 | | |
613 | 647 | | |
| 648 | + | |
614 | 649 | | |
615 | 650 | | |
616 | 651 | | |
617 | | - | |
618 | | - | |
619 | | - | |
| 652 | + | |
620 | 653 | | |
621 | 654 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | 655 | | |
626 | 656 | | |
627 | 657 | | |
628 | 658 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
| 659 | + | |
| 660 | + | |
634 | 661 | | |
635 | 662 | | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
641 | 666 | | |
642 | 667 | | |
643 | | - | |
| 668 | + | |
644 | 669 | | |
645 | 670 | | |
646 | 671 | | |
| |||
664 | 689 | | |
665 | 690 | | |
666 | 691 | | |
667 | | - | |
| 692 | + | |
| 693 | + | |
668 | 694 | | |
669 | 695 | | |
670 | 696 | | |
| |||
0 commit comments