Skip to content

Commit

Permalink
ext4: check error return from ext4_write_inline_data_end()
Browse files Browse the repository at this point in the history
The function ext4_write_inline_data_end() can return an error.  So we
need to assign it to a signed integer variable to check for an error
return (since copied is an unsigned int).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Zheng Liu <wenqing.lz@taobao.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Theodore Ts'o committed Jul 1, 2013
1 parent 353eefd commit 42c832d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,13 @@ static int ext4_write_end(struct file *file,
}
}

if (ext4_has_inline_data(inode))
copied = ext4_write_inline_data_end(inode, pos, len,
copied, page);
else
if (ext4_has_inline_data(inode)) {
ret = ext4_write_inline_data_end(inode, pos, len,
copied, page);
if (ret < 0)
goto errout;
copied = ret;
} else
copied = block_write_end(file, mapping, pos,
len, copied, page, fsdata);

Expand Down

0 comments on commit 42c832d

Please sign in to comment.