From 554f7ffb5f2f2dae03cd4130ede2d624480a73ce Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Tue, 2 Aug 2005 14:47:58 +0000 Subject: [PATCH] STABLE14-linux-4gb-32bit-file-fix-20050802 FIXCES 20560 fix wrapping error on page offset (cherry picked from commit 893849bdca91df3ec60b0b587c0b56500c04d70d) --- src/afs/LINUX/osi_sleep.c | 4 ++-- src/afs/LINUX/osi_vnodeops.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/afs/LINUX/osi_sleep.c b/src/afs/LINUX/osi_sleep.c index c0e4072bb..33b53d79a 100644 --- a/src/afs/LINUX/osi_sleep.c +++ b/src/afs/LINUX/osi_sleep.c @@ -193,7 +193,7 @@ afs_osi_SleepSig(void *event) AFS_GUNLOCK(); schedule(); #ifdef AFS_LINUX26_ENV -#ifdef CONFIG_PM +#ifdef CONFIG_PF if (current->flags & PF_FREEZE) refrigerator(PF_FREEZE); #endif @@ -277,7 +277,7 @@ osi_TimedSleep(char *event, afs_int32 ams, int aintok) } else schedule_timeout(ticks); #ifdef AFS_LINUX26_ENV -#ifdef CONFIG_PM +#ifdef CONFIG_PF if (current->flags & PF_FREEZE) refrigerator(PF_FREEZE); #endif diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 1763da78a..9187614cf 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1263,7 +1263,7 @@ afs_linux_readpage(struct file *fp, struct page *pp) cred_t *credp = crref(); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) char *address; - afs_offs_t offset = page_offset(pp); + afs_offs_t offset = ((loff_t) pp->index) << PAGE_CACHE_SHIFT; #else ulong address = afs_linux_page_address(pp); afs_offs_t offset = pageoff(pp); @@ -1359,7 +1359,7 @@ afs_linux_writepage_sync(struct inode *ip, struct page *pp, int f_flags = 0; buffer = kmap(pp) + offset; - base = page_offset(pp) + offset; + base = (((loff_t) pp->index) << PAGE_CACHE_SHIFT) + offset; credp = crref(); lock_kernel(); -- 2.39.5