All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Pavel Emelyanov <xemul@parallels.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [rfc 0/2] Introducing VmFlags field into smaps output
Date: Wed, 24 Oct 2012 01:59:07 +0400	[thread overview]
Message-ID: <20121023215907.GB24069@moon> (raw)
In-Reply-To: <20121023214639.GM7020@moon>

On Wed, Oct 24, 2012 at 01:46:39AM +0400, Cyrill Gorcunov wrote:
> 
> > Also...  what happens if there's an unrecognised bit set in `flags'? 
> > Memory corruption or code skew could cause this.  We emit a couple of
> > NULs into the procfs output, which I guess is an OK response to such a
> > condition.
> 
> That's indeed will produce some nil character on the screen. I guess we
> need some designited init here, say
> 
> 	[0 ... (BITS_PER_LONG-1)] = { {'-', '-'} },
> 	...
> 	[ilog2(VM_READ)]	= { {'r', 'd'} },
> 	...
> 	and so on, i'll update on top
> 

Andrew, could you please fold it on top of your
procfs-add-vmflags-field-in-smaps-output-v3-fix ?

(If this is inconvenient -- just give me a word and I'll
 squash everything in one new patch instead).
---
From: Cyrill Gorcunov <gorcunov@openvz.org>
Subject: procfs-add-vmflags-field-in-smaps-output-v3-fix-on-top

Use designated init to assign "??" mnemonic on unknown flags.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 fs/proc/task_mmu.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6.git/fs/proc/task_mmu.c
===================================================================
--- linux-2.6.git.orig/fs/proc/task_mmu.c
+++ linux-2.6.git/fs/proc/task_mmu.c
@@ -488,6 +488,11 @@ static void show_smap_vma_flags(struct s
 	static const struct {
 		const char l[2];
 	} mnemonics[BITS_PER_LONG] = {
+		/*
+		 * In case if we meet a flag we don't know about.
+		 */
+		[0 ... (BITS_PER_LONG-1)] = { {'?', '?'} },
+
 		[ilog2(VM_READ)]	= { {'r', 'd'} },
 		[ilog2(VM_WRITE)]	= { {'w', 'r'} },
 		[ilog2(VM_EXEC)]	= { {'e', 'x'} },

  reply	other threads:[~2012-10-23 21:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 19:14 [rfc 0/2] Introducing VmFlags field into smaps output Cyrill Gorcunov
2012-10-22 19:14 ` [rfc 1/2] [RFC] procfs: Add VmFlags field in " Cyrill Gorcunov
2012-10-22 19:14 ` [rfc 2/2] [RFC] procfs: Documantation -- Add VmFlags field description Cyrill Gorcunov
2012-10-22 19:29 ` [rfc 0/2] Introducing VmFlags field into smaps output Andrew Morton
2012-10-22 19:39   ` Cyrill Gorcunov
2012-10-22 20:50   ` Pavel Emelyanov
2012-10-22 20:56     ` Cyrill Gorcunov
2012-10-22 21:34       ` Cyrill Gorcunov
2012-10-22 21:51         ` Andrew Morton
2012-10-23  6:13           ` Cyrill Gorcunov
2012-10-23  6:30             ` Andrew Morton
2012-10-23  6:34               ` Cyrill Gorcunov
2012-10-23  7:15                 ` Cyrill Gorcunov
2012-10-23 21:30                   ` Andrew Morton
2012-10-23 21:46                     ` Cyrill Gorcunov
2012-10-23 21:59                       ` Cyrill Gorcunov [this message]
2012-10-23 22:32                         ` Peter Zijlstra
2012-10-23 23:56                           ` Stephen Rothwell
2012-10-24  6:30                           ` Cyrill Gorcunov

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=20121023215907.GB24069@moon \
    --to=gorcunov@openvz.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xemul@parallels.com \
    /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 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.