From: Greg KH on
2.6.32-stable review patch. If anyone has any objections, please let us know.


From: Joel Becker <joel.becker(a)>

commit a36d515c7a2dfacebcf41729f6812dbc424ebcf0 upstream.

When asked for a partial read of the LVB in a dlmfs file, we can
accidentally calculate a negative count.

Reported-by: Dan Carpenter <error27(a)>
Signed-off-by: Joel Becker <joel.becker(a)>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)>

fs/ocfs2/dlm/dlmfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -205,7 +205,7 @@ static ssize_t dlmfs_file_read(struct fi
if ((count + *ppos) > i_size_read(inode))
readlen = i_size_read(inode) - *ppos;
- readlen = count - *ppos;
+ readlen = count;

lvb_buf = kmalloc(readlen, GFP_NOFS);
if (!lvb_buf)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at