Re: [PATCH 05/25] Unionfs: cast page-index loff_t before shifting

2007-09-26 Thread Christoph Hellwig
On Tue, Sep 25, 2007 at 11:09:44PM -0400, Erez Zadok wrote:
 Fixes bugs in number promotion/demotion computation, as per
 http://lkml.org/lkml/2007/9/20/17

It's better to use te page_offset helper as that avoids any confusion
on where to cast.

-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 05/25] Unionfs: cast page-index loff_t before shifting

2007-09-26 Thread Erez Zadok
In message [EMAIL PROTECTED], Christoph Hellwig writes:
 On Tue, Sep 25, 2007 at 11:09:44PM -0400, Erez Zadok wrote:
  Fixes bugs in number promotion/demotion computation, as per
  http://lkml.org/lkml/2007/9/20/17
 
 It's better to use te page_offset helper as that avoids any confusion
 on where to cast.

Excellent.  Will do.

Erez.
-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/25] Unionfs: cast page-index loff_t before shifting

2007-09-25 Thread Erez Zadok
Fixes bugs in number promotion/demotion computation, as per
http://lkml.org/lkml/2007/9/20/17

Signed-off-by: Erez Zadok [EMAIL PROTECTED]
Acked-by: Josef 'Jeff' Sipek [EMAIL PROTECTED]
---
 fs/unionfs/mmap.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c
index 88ef6a6..37af979 100644
--- a/fs/unionfs/mmap.c
+++ b/fs/unionfs/mmap.c
@@ -179,7 +179,8 @@ static int unionfs_do_readpage(struct file *file, struct 
page *page)
 * may be a little slower, but a lot safer, as the VFS does a lot of
 * the necessary magic for us.
 */
-   offset = lower_file-f_pos = (page-index  PAGE_CACHE_SHIFT);
+   offset = lower_file-f_pos =
+   ((loff_t) page-index  PAGE_CACHE_SHIFT);
old_fs = get_fs();
set_fs(KERNEL_DS);
err = vfs_read(lower_file, page_data, PAGE_CACHE_SIZE,
@@ -289,7 +290,7 @@ static int unionfs_commit_write(struct file *file, struct 
page *page,
BUG_ON(lower_file == NULL);
 
page_data = (char *)kmap(page);
-   lower_file-f_pos = (page-index  PAGE_CACHE_SHIFT) + from;
+   lower_file-f_pos = ((loff_t) page-index  PAGE_CACHE_SHIFT) + from;
 
/*
 * SP: I use vfs_write instead of copying page data and the
-- 
1.5.2.2

-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html