linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfs: initialize d_iname to null for long file names
@ 2008-11-26 13:41 Wu Fengguang
  2008-11-26 16:45 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Wu Fengguang @ 2008-11-26 13:41 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Eric Van Hensbergen, Latchesar Ionkov, v9fs-developer, LKML,
	linux-fsdevel

dentry->d_iname is currently uninitialized for long file names.  Init
it to null string to avoid bad behaviors on careless references to it.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
---
diff --git a/fs/dcache.c b/fs/dcache.c
index a1d86c7..29d1768 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -929,6 +929,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
 			kmem_cache_free(dentry_cache, dentry); 
 			return NULL;
 		}
+		dentry->d_iname[0] = '\0';
 	} else  {
 		dname = dentry->d_iname;
 	}	

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

* Re: [PATCH] vfs: initialize d_iname to null for long file names
  2008-11-26 13:41 [PATCH] vfs: initialize d_iname to null for long file names Wu Fengguang
@ 2008-11-26 16:45 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2008-11-26 16:45 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: Andrew Morton, Eric Van Hensbergen, Latchesar Ionkov,
	v9fs-developer, LKML, linux-fsdevel

On Wed, Nov 26, 2008 at 09:41:05PM +0800, Wu Fengguang wrote:
> dentry->d_iname is currently uninitialized for long file names.  Init
> it to null string to avoid bad behaviors on careless references to it.

I don't really see the point.  If your code references it's already
buggy.  The only proper way to acces it is through dentry->d_name.


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

end of thread, other threads:[~2008-11-26 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-26 13:41 [PATCH] vfs: initialize d_iname to null for long file names Wu Fengguang
2008-11-26 16:45 ` Christoph Hellwig

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).