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

Commit 6c5e73d3 authored by jon ernst's avatar jon ernst Committed by Theodore Ts'o
Browse files

ext4: enforce we are operating on a regular file in ext4_zero_range()



Signed-off-by: default avatarJon Ernst <jonernst07@gmail.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 6dd834ef
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4741,6 +4741,9 @@ static long ext4_zero_range(struct file *file, loff_t offset,

	trace_ext4_zero_range(inode, offset, len, mode);

	if (!S_ISREG(inode->i_mode))
		return -EINVAL;

	/*
	 * Write out all dirty pages to avoid race conditions
	 * Then release them.