From: Al Viro Date: Thu, 24 Nov 2022 17:03:11 +0000 (+0000) Subject: ovl: update ->f_iocb_flags when ovl_change_flags() modifies ->f_flags X-Git-Tag: v6.6.7~3964^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=456b59e757b0c558df550764a4fd5ae6877e93f8;p=platform%2Fkernel%2Flinux-starfive.git ovl: update ->f_iocb_flags when ovl_change_flags() modifies ->f_flags ovl_change_flags() is an open-coded variant of fs/fcntl.c:setfl() and it got missed by commit 164f4064ca81 ("keep iocb_flags() result cached in struct file"); the same change applies there. Reported-by: Pierre Labastie Fixes: 164f4064ca81 ("keep iocb_flags() result cached in struct file") Cc: # v6.0 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216738 Signed-off-by: Al Viro Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index a1a22f5..dd688a8 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -96,6 +96,7 @@ static int ovl_change_flags(struct file *file, unsigned int flags) spin_lock(&file->f_lock); file->f_flags = (file->f_flags & ~OVL_SETFL_MASK) | flags; + file->f_iocb_flags = iocb_flags(file); spin_unlock(&file->f_lock); return 0;