1
0
Fork 0

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>
hifive-unleashed-5.1
jon ernst 2014-04-18 11:50:35 -04:00 committed by Theodore Ts'o
parent 6dd834effc
commit 6c5e73d3a2
1 changed files with 3 additions and 0 deletions

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.