From b184ce57e1f0ca5eb075a1442e3699c20ef51549 Mon Sep 17 00:00:00 2001 From: Abhijith Das Date: Sun, 4 Jul 2010 01:33:24 -0400 Subject: [PATCH] --- yaml --- r: 201010 b: refs/heads/master c: 8b4216018bdbfbb1b76150d202b15ee68c38e991 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/gfs2/quota.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f363a78d473f..a668b8fdbe95 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1becbdee776b447f203aa8da9a40488d5a75e1d +refs/heads/master: 8b4216018bdbfbb1b76150d202b15ee68c38e991 diff --git a/trunk/fs/gfs2/quota.c b/trunk/fs/gfs2/quota.c index 49667d68769e..b256d6f24288 100644 --- a/trunk/fs/gfs2/quota.c +++ b/trunk/fs/gfs2/quota.c @@ -694,10 +694,8 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, 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)) @@ -723,7 +721,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, /* 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;