Commit 5b8dab0c authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Lipeng Sang
Browse files

fuse: add file_modified() to fallocate

stable inclusion
from stable-v5.10.154
commit f8e8cda869fd0a023e22c1fa98906d1a61bd152a
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f8e8cda869fd0a023e22c1fa98906d1a61bd152a



--------------------------------

commit 4a6f278d upstream.

Add missing file_modified() call to fuse_file_fallocate().  Without this
fallocate on fuse failed to clear privileges.

Fixes: 05ba1f08 ("fuse: add FALLOCATE operation")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent 6a9c2673
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3326,6 +3326,10 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
			goto out;
	}

	err = file_modified(file);
	if (err)
		goto out;

	if (!(mode & FALLOC_FL_KEEP_SIZE))
		set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);