Commit a36d515c authored by Joel Becker's avatar Joel Becker

ocfs2_dlmfs: Fix math error when reading LVB.

When asked for a partial read of the LVB in a dlmfs file, we can
accidentally calculate a negative count.
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent c21a534e
......@@ -262,7 +262,7 @@ static ssize_t dlmfs_file_read(struct file *filp,
if ((count + *ppos) > i_size_read(inode))
readlen = i_size_read(inode) - *ppos;
else
readlen = count - *ppos;
readlen = count;
lvb_buf = kmalloc(readlen, GFP_NOFS);
if (!lvb_buf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment