This is a note to let you know that I've just added the patch titled
GFS2: BUG in gfs2_adjust_quota
to the 2.6.32-longterm tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary
The filename of the patch is:
gfs2-bug-in-gfs2_adjust_quota.patch
and it can be found in the queue-2.6.32 subdirectory.
If you, or anyone else, feels it should not be added to the 2.6.32 longterm
tree,
please let <[email protected]> know about it.
>From 15923a645855b9ad20b6875d84e876cc130eb5b7 Mon Sep 17 00:00:00 2001
From: Abhijith Das <[email protected]>
Date: Sun, 4 Jul 2010 01:33:24 -0400
Subject: GFS2: BUG in gfs2_adjust_quota
From: Abhijith Das <[email protected]>
commit 8b4216018bdbfbb1b76150d202b15ee68c38e991 upstream.
HighMem pages on i686 do not get mapped to the buffer_heads and this was
causing a NULL pointer dereference when we were trying to memset page buffers
to zero.
We now use zero_user() that kmaps the page and directly manipulates page data.
This patch also fixes a boundary condition that was incorrect.
Signed-off-by: Abhi Das <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
[Adjusted to apply to 2.6.32 by dann frazier <[email protected]>]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/gfs2/quota.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -679,10 +679,8 @@ get_a_page:
if (!buffer_mapped(bh))
goto unlock_out;
/* If it's a newly allocated disk block for quota, zero it */
- if (buffer_new(bh)) {
- memset(bh->b_data, 0, bh->b_size);
- set_buffer_uptodate(bh);
- }
+ if (buffer_new(bh))
+ zero_user(page, pos - blocksize, bh->b_size);
}
if (PageUptodate(page))
@@ -708,7 +706,7 @@ get_a_page:
/* If quota straddles page boundary, we need to update the rest of the
* quota at the beginning of the next page */
- if (offset != 0) { /* first page, offset is closer to PAGE_CACHE_SIZE */
+ if ((offset + sizeof(struct gfs2_quota)) > PAGE_CACHE_SIZE) {
ptr = ptr + nbytes;
nbytes = sizeof(struct gfs2_quota) - nbytes;
offset = 0;
Patches currently in longterm-queue-2.6.32 which might be from [email protected]
are
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/gfs2-fix-writing-to-non-page-aligned-gfs2_quota-stru.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/gfs2-bug-in-gfs2_adjust_quota.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable