Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4adb8302 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: check fallocate mode



Don't allow new fallocate modes until we figure out what (if anything) that
takes.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent 7736e8cc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2972,6 +2972,9 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
	bool lock_inode = !(mode & FALLOC_FL_KEEP_SIZE) ||
			   (mode & FALLOC_FL_PUNCH_HOLE);

	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
		return -EOPNOTSUPP;

	if (fc->no_fallocate)
		return -EOPNOTSUPP;