Bug 46881
Summary: | inode.c:157: bad call to memset | ||
---|---|---|---|
Product: | File System | Reporter: | David Binderman (dcb314) |
Component: | NFS | Assignee: | Trond Myklebust (trondmy) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | florian |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.6-rc4 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | NFS: Fix the initialisation of the readdir 'cookieverf' array |
Description
David Binderman
2012-09-02 14:49:00 UTC
That would be a gcc regression, not a kernel bug. NFS_COOKIEVERF(inode) points to the 'cookieverf' field in struct nfs_inode, which is an array. If the 'sizeof' operator suddenly thinks that it is a pointer, then that's a pretty major gcc bug... Marking this as resolved invalid. >That would be a gcc regression, not a kernel bug.
Can't see that, myself. The code looks to me like
memset(X, 0, sizeof(X));
First parameter is memset is a pointer, so I wouldn't expect to
see that first parameter duplicated as the third parameter.
I would expect to see something like
memset(X, 0, sizeof(*X));
or maybe
memset(X, 0, SOME_NUMBER * sizeof(*X));
No... The problem is that NFS_COOKIEVERF got changed from being a macro to a static inline back in 2.6.25. That changed the type being passed to the memset() from being an array to being a pointer. At this point NFS_COOKIEVERF appears to be pure obfuscation and just needs to be removed altogether. Created attachment 79151 [details]
NFS: Fix the initialisation of the readdir 'cookieverf' array
A patch referencing this bug report has been merged in Linux v3.6-rc6: commit c3f52af3e03013db5237e339c817beaae5ec9e3a Author: Trond Myklebust <Trond.Myklebust@netapp.com> Date: Mon Sep 3 14:56:02 2012 -0400 NFS: Fix the initialisation of the readdir 'cookieverf' array |