2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 01:34:00 +08:00

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

Signed-off-by: Jon Ernst <jonernst07@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
jon ernst 2014-04-18 11:50:35 -04:00 committed by Theodore Ts'o
parent 6dd834effc
commit 6c5e73d3a2

View File

@ -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.