FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-06-2009, 03:47 PM
Benjamin Marzinski
 
Default Fix typo in gfs_page_mkwrite()

There is a typo in gfs2_page_mkwrite()

gfs2_write_alloc_required() expects pos to be the offset in bytes. However,
instead of the page index being shifted by by PAGE_CACHE_SHIFT, it was shifted
by (PAGE_CACHE_SIZE - inode->i_blkbits). This patch simply shifts the page
index by the proper amount.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
fs/gfs2/ops_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: kernel-315191/fs/gfs2/ops_file.c
================================================== =================
--- kernel-315191.orig/fs/gfs2/ops_file.c
+++ kernel-315191/fs/gfs2/ops_file.c
@@ -342,7 +342,7 @@ static int gfs2_page_mkwrite(struct vm_a
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_sbd *sdp = GFS2_SB(inode);
unsigned long last_index;
- u64 pos = page->index << (PAGE_CACHE_SIZE - inode->i_blkbits);
+ u64 pos = page->index << PAGE_CACHE_SHIFT;
unsigned int data_blocks, ind_blocks, rblocks;
int alloc_required = 0;
struct gfs2_holder gh;
 
Old 01-06-2009, 03:49 PM
Steven Whitehouse
 
Default Fix typo in gfs_page_mkwrite()

Hi,

Now in the GFS2 -nmw git tree. Thanks,

Steve.

On Tue, 2009-01-06 at 10:47 -0600, Benjamin Marzinski wrote:
> There is a typo in gfs2_page_mkwrite()
>
> gfs2_write_alloc_required() expects pos to be the offset in bytes. However,
> instead of the page index being shifted by by PAGE_CACHE_SHIFT, it was shifted
> by (PAGE_CACHE_SIZE - inode->i_blkbits). This patch simply shifts the page
> index by the proper amount.
>
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> fs/gfs2/ops_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: kernel-315191/fs/gfs2/ops_file.c
> ================================================== =================
> --- kernel-315191.orig/fs/gfs2/ops_file.c
> +++ kernel-315191/fs/gfs2/ops_file.c
> @@ -342,7 +342,7 @@ static int gfs2_page_mkwrite(struct vm_a
> struct gfs2_inode *ip = GFS2_I(inode);
> struct gfs2_sbd *sdp = GFS2_SB(inode);
> unsigned long last_index;
> - u64 pos = page->index << (PAGE_CACHE_SIZE - inode->i_blkbits);
> + u64 pos = page->index << PAGE_CACHE_SHIFT;
> unsigned int data_blocks, ind_blocks, rblocks;
> int alloc_required = 0;
> struct gfs2_holder gh;
 

Thread Tools




All times are GMT. The time now is 02:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org