Re: [PATCH] PROC: Make proc_dir_entry::name a terminal array rather than a pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> Might as well move "namelen" next to the end.

Good point.  Before:

	(gdb) p &(((struct proc_dir_entry*)0)->name)
	$1 = (char (*)[]) 0xc0

After:

	(gdb) p &(((struct proc_dir_entry*)0)->name)
	$2 = (char (*)[]) 0xbc

The size is 192 in either case; the name just overlaps the hole at the end of
the structure.

Also, whilst I'm at it:

 (1) pde_unload_lock can be put two places later, so that if it's just a
     32-bit word, there won't be a hole left in the struct on a 64-bit
     machine.

 (2) namelen doesn't need to be a 32-bit word, but can be an 8-bit value as it
     doesn't have to exceed NAME_MAX.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux