From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 23 Sep 2009 17:48:14 -0400 (EDT) Subject: [Cluster-devel] [PATCH GFS2] gfs2_stuffed_write_end modifying source buffer? In-Reply-To: <652851863.523171253742277925.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Message-ID: <2007607020.523221253742494331.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Maybe I'm wrong, but this looks like a bug to me: It looks like GFS2's function gfs2_stuffed_write_end is zeroing out portions of the source buffer. So if I create a character array and filled it with "X" then wrote only one byte to a very small file, all the other X's in my buffer would get nuked. Just a theory at this point but perhaps Steve Whitehouse can tell. Regards, Bob Peterson Red Hat File Systems -- fs/gfs2/aops.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 7ebae9a..6a23ba2 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -801,7 +801,6 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh, BUG_ON((pos + len) > (dibh->b_size - sizeof(struct gfs2_dinode))); kaddr = kmap_atomic(page, KM_USER0); memcpy(buf + pos, kaddr + pos, copied); - memset(kaddr + pos + copied, 0, len - copied); flush_dcache_page(page); kunmap_atomic(kaddr, KM_USER0);