aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-07-01 08:12:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-21 18:21:23 -0700
commit0529b225e14f6187cd7a997ebc438538059a7889 (patch)
tree1b0b0f98c7e4b333b828e9757a02d62e3f2bf1a3
parent5196bcf9844862ad05b2dfe825422e95a519e514 (diff)
ext4: check error return from ext4_write_inline_data_end()
commit 42c832debbbf819f6c4ad8601baa559c44105ba4 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ext4/inode.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d6382b89ecb..c2434f89e9e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1118,10 +1118,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);