ovl: fix unneeded call to ovl_change_flags()
authorAmir Goldstein <amir73il@gmail.com>
Thu, 18 Jun 2020 15:43:53 +0000 (18:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:21 +0000 (09:34 +0200)
commit383cf066d1f87a38f6452ff0d8349a61868f35ee
tree845523e12766207f5e888c07c1c675ff193fa8c1
parent96d30fe6f738c848b97c1a601d991d11069e91bd
ovl: fix unneeded call to ovl_change_flags()

commit 81a33c1ee941c3bb9ffc6bac8f676be13351344e upstream.

The check if user has changed the overlay file was wrong, causing unneeded
call to ovl_change_flags() including taking f_lock on every file access.

Fixes: d989903058a8 ("ovl: do not generate duplicate fsnotify events for "fake" path")
Cc: <stable@vger.kernel.org> # v4.19+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/file.c