All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] proc: fix kflags to uflags copying in /proc/kpageflags
@ 2009-03-11  1:00 Wu Fengguang
  2009-03-11  1:17 ` KOSAKI Motohiro
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Fengguang @ 2009-03-11  1:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linus Torvalds, stable, LKML, Matt Mackall, Alexey Dobriyan

Fix kpf_copy_bit(src,dst) to be kpf_copy_bit(dst,src) to match the
actual call patterns, e.g. kpf_copy_bit(kflags, KPF_LOCKED, PG_locked).

This misplacement of src/dst only affected reporting of PG_writeback,
PG_reclaim and PG_buddy. For others kflags==uflags so not affected.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---

This is a tested and trivial no-side-effect fix.
I'd suggest it for 2.6.29-rc7 and 2.6.28.X kernels.

diff --git a/fs/proc/page.c b/fs/proc/page.c
index 2d13451..e998383 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -80,7 +80,7 @@ static const struct file_operations proc_kpagecount_operations = {
 #define KPF_RECLAIM    9
 #define KPF_BUDDY     10
 
-#define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
+#define kpf_copy_bit(flags, dstpos, srcpos) (((flags >> srcpos) & 1) << dstpos)
 
 static ssize_t kpageflags_read(struct file *file, char __user *buf,
 			     size_t count, loff_t *ppos)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] proc: fix kflags to uflags copying in /proc/kpageflags
  2009-03-11  1:00 [PATCH] proc: fix kflags to uflags copying in /proc/kpageflags Wu Fengguang
@ 2009-03-11  1:17 ` KOSAKI Motohiro
  2009-03-11  1:23   ` Wu Fengguang
  0 siblings, 1 reply; 3+ messages in thread
From: KOSAKI Motohiro @ 2009-03-11  1:17 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: kosaki.motohiro, Andrew Morton, Linus Torvalds, stable, LKML,
	Matt Mackall, Alexey Dobriyan

> Fix kpf_copy_bit(src,dst) to be kpf_copy_bit(dst,src) to match the
> actual call patterns, e.g. kpf_copy_bit(kflags, KPF_LOCKED, PG_locked).
> 
> This misplacement of src/dst only affected reporting of PG_writeback,
> PG_reclaim and PG_buddy. For others kflags==uflags so not affected.
> 
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
> 
> This is a tested and trivial no-side-effect fix.
> I'd suggest it for 2.6.29-rc7 and 2.6.28.X kernels.
> 
> diff --git a/fs/proc/page.c b/fs/proc/page.c
> index 2d13451..e998383 100644
> --- a/fs/proc/page.c
> +++ b/fs/proc/page.c
> @@ -80,7 +80,7 @@ static const struct file_operations proc_kpagecount_operations = {
>  #define KPF_RECLAIM    9
>  #define KPF_BUDDY     10
>  
> -#define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
> +#define kpf_copy_bit(flags, dstpos, srcpos) (((flags >> srcpos) & 1) << dstpos)

Good catch! :)
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>


but don't worry. the number of this interface user is very few.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] proc: fix kflags to uflags copying in /proc/kpageflags
  2009-03-11  1:17 ` KOSAKI Motohiro
@ 2009-03-11  1:23   ` Wu Fengguang
  0 siblings, 0 replies; 3+ messages in thread
From: Wu Fengguang @ 2009-03-11  1:23 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Andrew Morton, Linus Torvalds, stable, LKML, Matt Mackall,
	Alexey Dobriyan

On Wed, Mar 11, 2009 at 03:17:58AM +0200, KOSAKI Motohiro wrote:
> > Fix kpf_copy_bit(src,dst) to be kpf_copy_bit(dst,src) to match the
> > actual call patterns, e.g. kpf_copy_bit(kflags, KPF_LOCKED, PG_locked).
> > 
> > This misplacement of src/dst only affected reporting of PG_writeback,
> > PG_reclaim and PG_buddy. For others kflags==uflags so not affected.
> > 
> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> > ---
> > 
> > This is a tested and trivial no-side-effect fix.
> > I'd suggest it for 2.6.29-rc7 and 2.6.28.X kernels.
> > 
> > diff --git a/fs/proc/page.c b/fs/proc/page.c
> > index 2d13451..e998383 100644
> > --- a/fs/proc/page.c
> > +++ b/fs/proc/page.c
> > @@ -80,7 +80,7 @@ static const struct file_operations proc_kpagecount_operations = {
> >  #define KPF_RECLAIM    9
> >  #define KPF_BUDDY     10
> >  
> > -#define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
> > +#define kpf_copy_bit(flags, dstpos, srcpos) (((flags >> srcpos) & 1) << dstpos)
> 
> Good catch! :)
> 	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Thank you :)

> 
> but don't worry. the number of this interface user is very few.

Yeah, so few users that I have to write the tools by myself ;-)

Thanks,
Fengguang


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-11  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-11  1:00 [PATCH] proc: fix kflags to uflags copying in /proc/kpageflags Wu Fengguang
2009-03-11  1:17 ` KOSAKI Motohiro
2009-03-11  1:23   ` Wu Fengguang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.