[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101122040953.GB3017@spritzera.linux.bs1.fc.nec.co.jp>
Date: Mon, 22 Nov 2010 13:09:54 +0900
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: LKML <linux-kernel@...r.kernel.org>, linux-mm <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Jun'ichi Nomura" <j-nomura@...jp.nec.com>,
Matt Mackall <mpm@...enic.com>
Subject: Re: [BUGFIX][PATCH] pagemap: set pagemap walk limit to PMD boundary
> > @@ -776,7 +777,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
> > unsigned long end;
> >
> > pm.pos = 0;
> > - end = start_vaddr + PAGEMAP_WALK_SIZE;
> > + end = (start_vaddr + PAGEMAP_WALK_SIZE) & PAGEMAP_WALK_MASK;
> > /* overflow ? */
> > if (end < start_vaddr || end > end_vaddr)
> > end = end_vaddr;
>
> Ack.
>
> But ALIGN() can't be used ?
ALIGN() returns the same address as the input if it is already aligned,
but what we need here is the next PMD boundary. So something like
end = IS_ALIGNED(start_vaddr, PAGEMAP_WALK_SIZE) ?
start_vaddr + PAGEMAP_WALK_SIZE :
ALIGN(start_vaddr, PAGEMAP_WALK_SIZE)
keeps the semantics, but I don't like it because it's lengthy.
Anyway, thanks for your comment.
Naoya Horiguchi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists