From: Ilya Yanok <yanok@emcraft.com>
To: linuxppc-dev@ozlabs.org
Cc: Ilya Yanok <yanok@emcraft.com>, dzu@denx.de, wd@denx.de
Subject: [PATCH] mm: fix ENTRIES_PER_PAGEPAGE overflow with 256KB pages
Date: Thu, 11 Sep 2008 01:53:07 +0400 [thread overview]
Message-ID: <1221083587-8091-3-git-send-email-yanok@emcraft.com> (raw)
In-Reply-To: <1221083587-8091-1-git-send-email-yanok@emcraft.com>
ENTRIES_PER_PAGEPAGE define in mm/shmem.c becomes zero if page size is
256KB. This patch fixes this.
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
mm/shmem.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 04fb4f1..c603427 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -59,7 +59,7 @@
#define TMPFS_MAGIC 0x01021994
#define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long))
-#define ENTRIES_PER_PAGEPAGE (ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
+#define ENTRIES_PER_PAGEPAGE ((unsigned long long)ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
#define BLOCKS_PER_PAGE (PAGE_CACHE_SIZE/512)
#define SHMEM_MAX_INDEX (SHMEM_NR_DIRECT + (ENTRIES_PER_PAGEPAGE/2) * (ENTRIES_PER_PAGE+1))
@@ -519,7 +519,7 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
struct shmem_inode_info *info = SHMEM_I(inode);
unsigned long idx;
unsigned long size;
- unsigned long limit;
+ unsigned long long limit;
unsigned long stage;
unsigned long diroff;
struct page **dir;
@@ -535,7 +535,7 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
int punch_hole;
spinlock_t *needs_lock;
spinlock_t *punch_lock;
- unsigned long upper_limit;
+ unsigned long long upper_limit;
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
idx = (start + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
--
1.5.6.1
next prev parent reply other threads:[~2008-09-10 21:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 21:53 [RFC PATCH] Support for big page sizes on 44x Ilya Yanok
2008-09-10 21:53 ` [PATCH] powerpc: add support for PAGE_SIZEs greater than 4KB for Ilya Yanok
2008-09-11 16:57 ` prodyut hazarika
2008-09-11 18:15 ` Re[2]: " Yuri Tikhonov
2008-09-11 20:09 ` Josh Boyer
2008-09-11 23:38 ` Ilya Yanok
2008-09-12 0:47 ` Josh Boyer
2008-09-11 18:28 ` Ilya Yanok
2008-09-11 18:38 ` prodyut hazarika
2008-09-11 22:44 ` Ilya Yanok
2008-09-11 23:52 ` Re[2]: " Yuri Tikhonov
2008-09-11 18:53 ` prodyut hazarika
2008-09-11 21:51 ` Ilya Yanok
2008-09-13 17:49 ` Benjamin Herrenschmidt
2008-09-13 23:37 ` Josh Boyer
2008-09-11 22:37 ` prodyut hazarika
2008-09-11 23:20 ` Re[2]: " Yuri Tikhonov
2008-09-12 3:48 ` David Gibson
2008-09-13 17:46 ` Benjamin Herrenschmidt
2008-09-26 23:43 ` Ilya Yanok
2008-09-26 23:35 ` Ilya Yanok
2008-09-29 2:58 ` David Gibson
2008-09-10 21:53 ` Ilya Yanok [this message]
2008-09-12 3:50 ` [PATCH] mm: fix ENTRIES_PER_PAGEPAGE overflow with 256KB pages David Gibson
2008-09-12 5:29 ` prodyut hazarika
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1221083587-8091-3-git-send-email-yanok@emcraft.com \
--to=yanok@emcraft.com \
--cc=dzu@denx.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=wd@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).