<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/sunrpc/rpc_pipe.c, branch v3.2.48</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge branch 'nfs-for-3.2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs</title>
<updated>2011-10-25T13:44:06+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-10-25T13:44:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ef78cc75f11ba3b085b105209cbfc6666ee10499'/>
<id>ef78cc75f11ba3b085b105209cbfc6666ee10499</id>
<content type='text'>
* 'nfs-for-3.2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (26 commits)
  Check validity of cl_rpcclient in nfs_server_list_show
  NFS: Get rid of the nfs_rdata_mempool
  NFS: Don't rely on PageError in nfs_readpage_release_partial
  NFS: Get rid of unnecessary calls to ClearPageError() in read code
  NFS: Get rid of nfs_restart_rpc()
  NFS: Get rid of the unused nfs_write_data-&gt;flags field
  NFS: Get rid of the unused nfs_read_data-&gt;flags field
  NFSv4: Translate NFS4ERR_BADNAME into ENOENT when applied to a lookup
  NFS: Remove the unused "lookupfh()" version of nfs4_proc_lookup()
  NFS: Use the inode-&gt;i_version to cache NFSv4 change attribute information
  SUNRPC: Remove unnecessary export of rpc_sockaddr2uaddr
  SUNRPC: Fix rpc_sockaddr2uaddr
  nfs/super.c: local functions should be static
  pnfsblock: fix writeback deadlock
  pnfsblock: fix NULL pointer dereference
  pnfs: recoalesce when ld read pagelist fails
  pnfs: recoalesce when ld write pagelist fails
  pnfs: make _set_lo_fail generic
  pnfsblock: add missing rpc_put_mount and path_put
  SUNRPC/NFS: make rpc pipe upcall generic
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'nfs-for-3.2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (26 commits)
  Check validity of cl_rpcclient in nfs_server_list_show
  NFS: Get rid of the nfs_rdata_mempool
  NFS: Don't rely on PageError in nfs_readpage_release_partial
  NFS: Get rid of unnecessary calls to ClearPageError() in read code
  NFS: Get rid of nfs_restart_rpc()
  NFS: Get rid of the unused nfs_write_data-&gt;flags field
  NFS: Get rid of the unused nfs_read_data-&gt;flags field
  NFSv4: Translate NFS4ERR_BADNAME into ENOENT when applied to a lookup
  NFS: Remove the unused "lookupfh()" version of nfs4_proc_lookup()
  NFS: Use the inode-&gt;i_version to cache NFSv4 change attribute information
  SUNRPC: Remove unnecessary export of rpc_sockaddr2uaddr
  SUNRPC: Fix rpc_sockaddr2uaddr
  nfs/super.c: local functions should be static
  pnfsblock: fix writeback deadlock
  pnfsblock: fix NULL pointer dereference
  pnfs: recoalesce when ld read pagelist fails
  pnfs: recoalesce when ld write pagelist fails
  pnfs: make _set_lo_fail generic
  pnfsblock: add missing rpc_put_mount and path_put
  SUNRPC/NFS: make rpc pipe upcall generic
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>SUNRPC/NFS: make rpc pipe upcall generic</title>
<updated>2011-10-18T16:08:12+00:00</updated>
<author>
<name>Peng Tao</name>
<email>bergwolf@gmail.com</email>
</author>
<published>2011-09-23T01:50:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c1225158a8dad9e9d5eee8a17dbbd9c7cda05ab9'/>
<id>c1225158a8dad9e9d5eee8a17dbbd9c7cda05ab9</id>
<content type='text'>
The same function is used by idmap, gss and blocklayout code. Make it
generic.

Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Jim Rees &lt;rees@umich.edu&gt;
Cc: stable@kernel.org [3.0]
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The same function is used by idmap, gss and blocklayout code. Make it
generic.

Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Jim Rees &lt;rees@umich.edu&gt;
Cc: stable@kernel.org [3.0]
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sunrpc: add MODULE_ALIAS to match the filesystem name</title>
<updated>2011-10-10T22:04:47+00:00</updated>
<author>
<name>Michal Schmidt</name>
<email>mschmidt@redhat.com</email>
</author>
<published>2011-07-01T22:47:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dcbf8c30344dfa01915c34f88318d464e116f004'/>
<id>dcbf8c30344dfa01915c34f88318d464e116f004</id>
<content type='text'>
sunrpc implements the rpc_pipefs filesystem type.
Add the alias to have the module requested automatically by the kernel
when the filesystem is mounted.

Signed-off-by: Michal Schmidt &lt;mschmidt@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sunrpc implements the rpc_pipefs filesystem type.
Add the alias to have the module requested automatically by the kernel
when the filesystem is mounted.

Signed-off-by: Michal Schmidt &lt;mschmidt@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sunrpc: Reduce switch/case indent</title>
<updated>2011-07-01T23:11:16+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2011-07-01T09:43:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=89f0e4feafb64643b0f0aba9d89984362bac9739'/>
<id>89f0e4feafb64643b0f0aba9d89984362bac9739</id>
<content type='text'>
Make the case labels the same indent as the switch.

git diff -w shows 80 column line reflowing.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the case labels the same indent as the switch.

git diff -w shows 80 column line reflowing.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6</title>
<updated>2011-01-11T23:11:56+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-01-11T23:11:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b9d919a4ac6cf031b8e065f82ad8f1b0c9ed74b1'/>
<id>b9d919a4ac6cf031b8e065f82ad8f1b0c9ed74b1</id>
<content type='text'>
* 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (89 commits)
  NFS fix the setting of exchange id flag
  NFS: Don't use vm_map_ram() in readdir
  NFSv4: Ensure continued open and lockowner name uniqueness
  NFS: Move cl_delegations to the nfs_server struct
  NFS: Introduce nfs_detach_delegations()
  NFS: Move cl_state_owners and related fields to the nfs_server struct
  NFS: Allow walking nfs_client.cl_superblocks list outside client.c
  pnfs: layout roc code
  pnfs: update nfs4_callback_recallany to handle layouts
  pnfs: add CB_LAYOUTRECALL handling
  pnfs: CB_LAYOUTRECALL xdr code
  pnfs: change lo refcounting to atomic_t
  pnfs: check that partial LAYOUTGET return is ignored
  pnfs: add layout to client list before sending rpc
  pnfs: serialize LAYOUTGET(openstateid)
  pnfs: layoutget rpc code cleanup
  pnfs: change how lsegs are removed from layout list
  pnfs: change layout state seqlock to a spinlock
  pnfs: add prefix to struct pnfs_layout_hdr fields
  pnfs: add prefix to struct pnfs_layout_segment fields
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'nfs-for-2.6.38' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (89 commits)
  NFS fix the setting of exchange id flag
  NFS: Don't use vm_map_ram() in readdir
  NFSv4: Ensure continued open and lockowner name uniqueness
  NFS: Move cl_delegations to the nfs_server struct
  NFS: Introduce nfs_detach_delegations()
  NFS: Move cl_state_owners and related fields to the nfs_server struct
  NFS: Allow walking nfs_client.cl_superblocks list outside client.c
  pnfs: layout roc code
  pnfs: update nfs4_callback_recallany to handle layouts
  pnfs: add CB_LAYOUTRECALL handling
  pnfs: CB_LAYOUTRECALL xdr code
  pnfs: change lo refcounting to atomic_t
  pnfs: check that partial LAYOUTGET return is ignored
  pnfs: add layout to client list before sending rpc
  pnfs: serialize LAYOUTGET(openstateid)
  pnfs: layoutget rpc code cleanup
  pnfs: change how lsegs are removed from layout list
  pnfs: change layout state seqlock to a spinlock
  pnfs: add prefix to struct pnfs_layout_hdr fields
  pnfs: add prefix to struct pnfs_layout_segment fields
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: dcache reduce branches in lookup path</title>
<updated>2011-01-07T06:50:28+00:00</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fb045adb99d9b7c562dc7fef834857f78249daa1'/>
<id>fb045adb99d9b7c562dc7fef834857f78249daa1</id>
<content type='text'>
Reduce some branches and memory accesses in dcache lookup by adding dentry
flags to indicate common d_ops are set, rather than having to check them.
This saves a pointer memory access (dentry-&gt;d_op) in common path lookup
situations, and saves another pointer load and branch in cases where we
have d_op but not the particular operation.

Patched with:

git grep -E '[.&gt;]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)-&gt;d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&amp;\1, \2);/' -i

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reduce some branches and memory accesses in dcache lookup by adding dentry
flags to indicate common d_ops are set, rather than having to check them.
This saves a pointer memory access (dentry-&gt;d_op) in common path lookup
situations, and saves another pointer load and branch in cases where we
have d_op but not the particular operation.

Patched with:

git grep -E '[.&gt;]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)-&gt;d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&amp;\1, \2);/' -i

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: icache RCU free inodes</title>
<updated>2011-01-07T06:50:26+00:00</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fa0d7e3de6d6fc5004ad9dea0dd6b286af8f03e9'/>
<id>fa0d7e3de6d6fc5004ad9dea0dd6b286af8f03e9</id>
<content type='text'>
RCU free the struct inode. This will allow:

- Subsequent store-free path walking patch. The inode must be consulted for
  permissions when walking, so an RCU inode reference is a must.
- sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
  to take i_lock no longer need to take sb_inode_list_lock to walk the list in
  the first place. This will simplify and optimize locking.
- Could remove some nested trylock loops in dcache code
- Could potentially simplify things a bit in VM land. Do not need to take the
  page lock to follow page-&gt;mapping.

The downsides of this is the performance cost of using RCU. In a simple
creat/unlink microbenchmark, performance drops by about 10% due to inability to
reuse cache-hot slab objects. As iterations increase and RCU freeing starts
kicking over, this increases to about 20%.

In cases where inode lifetimes are longer (ie. many inodes may be allocated
during the average life span of a single inode), a lot of this cache reuse is
not applicable, so the regression caused by this patch is smaller.

The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
however this adds some complexity to list walking and store-free path walking,
so I prefer to implement this at a later date, if it is shown to be a win in
real situations. I haven't found a regression in any non-micro benchmark so I
doubt it will be a problem.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RCU free the struct inode. This will allow:

- Subsequent store-free path walking patch. The inode must be consulted for
  permissions when walking, so an RCU inode reference is a must.
- sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
  to take i_lock no longer need to take sb_inode_list_lock to walk the list in
  the first place. This will simplify and optimize locking.
- Could remove some nested trylock loops in dcache code
- Could potentially simplify things a bit in VM land. Do not need to take the
  page lock to follow page-&gt;mapping.

The downsides of this is the performance cost of using RCU. In a simple
creat/unlink microbenchmark, performance drops by about 10% due to inability to
reuse cache-hot slab objects. As iterations increase and RCU freeing starts
kicking over, this increases to about 20%.

In cases where inode lifetimes are longer (ie. many inodes may be allocated
during the average life span of a single inode), a lot of this cache reuse is
not applicable, so the regression caused by this patch is smaller.

The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
however this adds some complexity to list walking and store-free path walking,
so I prefer to implement this at a later date, if it is shown to be a win in
real situations. I haven't found a regression in any non-micro benchmark so I
doubt it will be a problem.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: change d_delete semantics</title>
<updated>2011-01-07T06:50:18+00:00</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe15ce446beb3a33583af81ffe6c9d01a75314ed'/>
<id>fe15ce446beb3a33583af81ffe6c9d01a75314ed</id>
<content type='text'>
Change d_delete from a dentry deletion notification to a dentry caching
advise, more like -&gt;drop_inode. Require it to be constant and idempotent,
and not take d_lock. This is how all existing filesystems use the callback
anyway.

This makes fine grained dentry locking of dput and dentry lru scanning
much simpler.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change d_delete from a dentry deletion notification to a dentry caching
advise, more like -&gt;drop_inode. Require it to be constant and idempotent,
and not take d_lock. This is how all existing filesystems use the callback
anyway.

This makes fine grained dentry locking of dput and dentry lru scanning
much simpler.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel panic when mount NFSv4</title>
<updated>2011-01-04T18:10:38+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2010-12-20T21:19:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=beb0f0a9fba1fa98b378329a9a5b0a73f25097ae'/>
<id>beb0f0a9fba1fa98b378329a9a5b0a73f25097ae</id>
<content type='text'>
On Tue, 2010-12-14 at 16:58 +0800, Mi Jinlong wrote:
&gt; Hi,
&gt;
&gt; When testing NFSv4 at RHEL6 with kernel 2.6.32, I got a kernel panic
&gt; at NFS client's __rpc_create_common function.
&gt;
&gt; The panic place is:
&gt;   rpc_mkpipe
&gt;     __rpc_lookup_create()          &lt;=== find pipefile *idmap*
&gt;     __rpc_mkpipe()                 &lt;=== pipefile is *idmap*
&gt;       __rpc_create_common()
&gt;        ******  BUG_ON(!d_unhashed(dentry)); ******    *panic*
&gt;
&gt; It means that the dentry's d_flags have be set DCACHE_UNHASHED,
&gt; but it should not be set here.
&gt;
&gt; Is someone known this bug? or give me some idea?
&gt;
&gt; A reproduce program is append, but it can't reproduce the bug every time.
&gt; the export is: "/nfsroot       *(rw,no_root_squash,fsid=0,insecure)"
&gt;
&gt; And the panic message is append.
&gt;
&gt; ============================================================================
&gt; #!/bin/sh
&gt;
&gt; LOOPTOTAL=768
&gt; LOOPCOUNT=0
&gt; ret=0
&gt;
&gt; while [ $LOOPCOUNT -ne $LOOPTOTAL ]
&gt; do
&gt; 	((LOOPCOUNT += 1))
&gt; 	service nfs restart
&gt; 	/usr/sbin/rpc.idmapd
&gt; 	mount -t nfs4 127.0.0.1:/ /mnt|| return 1;
&gt; 	ls -l /var/lib/nfs/rpc_pipefs/nfs/*/
&gt; 	umount /mnt
&gt; 	echo $LOOPCOUNT
&gt; done
&gt;
&gt; ===============================================================================
&gt; Code: af 60 01 00 00 89 fa 89 f0 e8 64 cf 89 f0 e8 5c 7c 64 cf 31 c0 8b 5c 24 10 8b
&gt; 74 24 14 8b 7c 24 18 8b 6c 24 1c 83 c4 20 c3 &lt;0f&gt; 0b eb fc 8b 46 28 c7 44 24 08 20
&gt; de ee f0 c7 44 24 04 56 ea
&gt; EIP:[&lt;f0ee92ea&gt;] __rpc_create_common+0x8a/0xc0 [sunrpc] SS:ESP 0068:eccb5d28
&gt; ---[ end trace 8f5606cd08928ed2]---
&gt; Kernel panic - not syncing: Fatal exception
&gt; Pid:7131, comm: mount.nfs4 Tainted: G     D   -------------------2.6.32 #1
&gt; Call Trace:
&gt;  [&lt;c080ad18&gt;] ? panic+0x42/0xed
&gt;  [&lt;c080e42c&gt;] ? oops_end+0xbc/0xd0
&gt;  [&lt;c040b090&gt;] ? do_invalid_op+0x0/0x90
&gt;  [&lt;c040b10f&gt;] ? do_invalid_op+0x7f/0x90
&gt;  [&lt;f0ee92ea&gt;] ? __rpc_create_common+0x8a/0xc0[sunrpc]
&gt;  [&lt;f0edc433&gt;] ? rpc_free_task+0x33/0x70[sunrpc]
&gt;  [&lt;f0ed6508&gt;] ? prc_call_sync+0x48/0x60[sunrpc]
&gt;  [&lt;f0ed656e&gt;] ? rpc_ping+0x4e/0x60[sunrpc]
&gt;  [&lt;f0ed6eaf&gt;] ? rpc_create+0x38f/0x4f0[sunrpc]
&gt;  [&lt;c080d80b&gt;] ? error_code+0x73/0x78
&gt;  [&lt;f0ee92ea&gt;] ? __rpc_create_common+0x8a/0xc0[sunrpc]
&gt;  [&lt;c0532bda&gt;] ? d_lookup+0x2a/0x40
&gt;  [&lt;f0ee94b1&gt;] ? rpc_mkpipe+0x111/0x1b0[sunrpc]
&gt;  [&lt;f10a59f4&gt;] ? nfs_create_rpc_client+0xb4/0xf0[nfs]
&gt;  [&lt;f10d6c6d&gt;] ? nfs_fscache_get_client_cookie+0x1d/0x50[nfs]
&gt;  [&lt;f10d3fcb&gt;] ? nfs_idmap_new+0x7b/0x140[nfs]
&gt;  [&lt;c05e76aa&gt;] ? strlcpy+0x3a/0x60
&gt;  [&lt;f10a60ca&gt;] ? nfs4_set_client+0xea/0x2b0[nfs]
&gt;  [&lt;f10a6d0c&gt;] ? nfs4_create_server+0xac/0x1b0[nfs]
&gt;  [&lt;c04f1400&gt;] ? krealloc+0x40/0x50
&gt;  [&lt;f10b0e8b&gt;] ? nfs4_remote_get_sb+0x6b/0x250[nfs]
&gt;  [&lt;c04f14ec&gt;] ? kstrdup+0x3c/0x60
&gt;  [&lt;c0520739&gt;] ? vfs_kern_mount+0x69/0x170
&gt;  [&lt;f10b1a3c&gt;] ? nfs_do_root_mount+0x6c/0xa0[nfs]
&gt;  [&lt;f10b1b47&gt;] ? nfs4_try_mount+0x37/0xa0[nfs]
&gt;  [&lt;f10afe6d&gt;] ? nfs4_validate_text_mount_data+-x7d/0xf0[nfs]
&gt;  [&lt;f10b1c42&gt;] ? nfs4_get_sb+0x92/0x2f0
&gt;  [&lt;c0520739&gt;] ? vfs_kern_mount+0x69/0x170
&gt;  [&lt;c05366d2&gt;] ? get_fs_type+0x32/0xb0
&gt;  [&lt;c052089f&gt;] ? do_kern_mount+0x3f/0xe0
&gt;  [&lt;c053954f&gt;] ? do_mount+0x2ef/0x740
&gt;  [&lt;c0537740&gt;] ? copy_mount_options+0xb0/0x120
&gt;  [&lt;c0539a0e&gt;] ? sys_mount+0x6e/0xa0

Hi,

Does the following patch fix the problem?

Cheers
  Trond

--------------------------
SUNRPC: Fix a BUG in __rpc_create_common

From: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;

Mi Jinlong reports:

When testing NFSv4 at RHEL6 with kernel 2.6.32, I got a kernel panic
at NFS client's __rpc_create_common function.

The panic place is:
  rpc_mkpipe
      __rpc_lookup_create()          &lt;=== find pipefile *idmap*
      __rpc_mkpipe()                 &lt;=== pipefile is *idmap*
        __rpc_create_common()
         ******  BUG_ON(!d_unhashed(dentry)); ****** *panic*

The test is wrong: we can find ourselves with a hashed negative dentry here
if the idmapper tried to look up the file before we got round to creating
it.

Just replace the BUG_ON() with a d_drop(dentry).

Reported-by: Mi Jinlong &lt;mijinlong@cn.fujitsu.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Tue, 2010-12-14 at 16:58 +0800, Mi Jinlong wrote:
&gt; Hi,
&gt;
&gt; When testing NFSv4 at RHEL6 with kernel 2.6.32, I got a kernel panic
&gt; at NFS client's __rpc_create_common function.
&gt;
&gt; The panic place is:
&gt;   rpc_mkpipe
&gt;     __rpc_lookup_create()          &lt;=== find pipefile *idmap*
&gt;     __rpc_mkpipe()                 &lt;=== pipefile is *idmap*
&gt;       __rpc_create_common()
&gt;        ******  BUG_ON(!d_unhashed(dentry)); ******    *panic*
&gt;
&gt; It means that the dentry's d_flags have be set DCACHE_UNHASHED,
&gt; but it should not be set here.
&gt;
&gt; Is someone known this bug? or give me some idea?
&gt;
&gt; A reproduce program is append, but it can't reproduce the bug every time.
&gt; the export is: "/nfsroot       *(rw,no_root_squash,fsid=0,insecure)"
&gt;
&gt; And the panic message is append.
&gt;
&gt; ============================================================================
&gt; #!/bin/sh
&gt;
&gt; LOOPTOTAL=768
&gt; LOOPCOUNT=0
&gt; ret=0
&gt;
&gt; while [ $LOOPCOUNT -ne $LOOPTOTAL ]
&gt; do
&gt; 	((LOOPCOUNT += 1))
&gt; 	service nfs restart
&gt; 	/usr/sbin/rpc.idmapd
&gt; 	mount -t nfs4 127.0.0.1:/ /mnt|| return 1;
&gt; 	ls -l /var/lib/nfs/rpc_pipefs/nfs/*/
&gt; 	umount /mnt
&gt; 	echo $LOOPCOUNT
&gt; done
&gt;
&gt; ===============================================================================
&gt; Code: af 60 01 00 00 89 fa 89 f0 e8 64 cf 89 f0 e8 5c 7c 64 cf 31 c0 8b 5c 24 10 8b
&gt; 74 24 14 8b 7c 24 18 8b 6c 24 1c 83 c4 20 c3 &lt;0f&gt; 0b eb fc 8b 46 28 c7 44 24 08 20
&gt; de ee f0 c7 44 24 04 56 ea
&gt; EIP:[&lt;f0ee92ea&gt;] __rpc_create_common+0x8a/0xc0 [sunrpc] SS:ESP 0068:eccb5d28
&gt; ---[ end trace 8f5606cd08928ed2]---
&gt; Kernel panic - not syncing: Fatal exception
&gt; Pid:7131, comm: mount.nfs4 Tainted: G     D   -------------------2.6.32 #1
&gt; Call Trace:
&gt;  [&lt;c080ad18&gt;] ? panic+0x42/0xed
&gt;  [&lt;c080e42c&gt;] ? oops_end+0xbc/0xd0
&gt;  [&lt;c040b090&gt;] ? do_invalid_op+0x0/0x90
&gt;  [&lt;c040b10f&gt;] ? do_invalid_op+0x7f/0x90
&gt;  [&lt;f0ee92ea&gt;] ? __rpc_create_common+0x8a/0xc0[sunrpc]
&gt;  [&lt;f0edc433&gt;] ? rpc_free_task+0x33/0x70[sunrpc]
&gt;  [&lt;f0ed6508&gt;] ? prc_call_sync+0x48/0x60[sunrpc]
&gt;  [&lt;f0ed656e&gt;] ? rpc_ping+0x4e/0x60[sunrpc]
&gt;  [&lt;f0ed6eaf&gt;] ? rpc_create+0x38f/0x4f0[sunrpc]
&gt;  [&lt;c080d80b&gt;] ? error_code+0x73/0x78
&gt;  [&lt;f0ee92ea&gt;] ? __rpc_create_common+0x8a/0xc0[sunrpc]
&gt;  [&lt;c0532bda&gt;] ? d_lookup+0x2a/0x40
&gt;  [&lt;f0ee94b1&gt;] ? rpc_mkpipe+0x111/0x1b0[sunrpc]
&gt;  [&lt;f10a59f4&gt;] ? nfs_create_rpc_client+0xb4/0xf0[nfs]
&gt;  [&lt;f10d6c6d&gt;] ? nfs_fscache_get_client_cookie+0x1d/0x50[nfs]
&gt;  [&lt;f10d3fcb&gt;] ? nfs_idmap_new+0x7b/0x140[nfs]
&gt;  [&lt;c05e76aa&gt;] ? strlcpy+0x3a/0x60
&gt;  [&lt;f10a60ca&gt;] ? nfs4_set_client+0xea/0x2b0[nfs]
&gt;  [&lt;f10a6d0c&gt;] ? nfs4_create_server+0xac/0x1b0[nfs]
&gt;  [&lt;c04f1400&gt;] ? krealloc+0x40/0x50
&gt;  [&lt;f10b0e8b&gt;] ? nfs4_remote_get_sb+0x6b/0x250[nfs]
&gt;  [&lt;c04f14ec&gt;] ? kstrdup+0x3c/0x60
&gt;  [&lt;c0520739&gt;] ? vfs_kern_mount+0x69/0x170
&gt;  [&lt;f10b1a3c&gt;] ? nfs_do_root_mount+0x6c/0xa0[nfs]
&gt;  [&lt;f10b1b47&gt;] ? nfs4_try_mount+0x37/0xa0[nfs]
&gt;  [&lt;f10afe6d&gt;] ? nfs4_validate_text_mount_data+-x7d/0xf0[nfs]
&gt;  [&lt;f10b1c42&gt;] ? nfs4_get_sb+0x92/0x2f0
&gt;  [&lt;c0520739&gt;] ? vfs_kern_mount+0x69/0x170
&gt;  [&lt;c05366d2&gt;] ? get_fs_type+0x32/0xb0
&gt;  [&lt;c052089f&gt;] ? do_kern_mount+0x3f/0xe0
&gt;  [&lt;c053954f&gt;] ? do_mount+0x2ef/0x740
&gt;  [&lt;c0537740&gt;] ? copy_mount_options+0xb0/0x120
&gt;  [&lt;c0539a0e&gt;] ? sys_mount+0x6e/0xa0

Hi,

Does the following patch fix the problem?

Cheers
  Trond

--------------------------
SUNRPC: Fix a BUG in __rpc_create_common

From: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;

Mi Jinlong reports:

When testing NFSv4 at RHEL6 with kernel 2.6.32, I got a kernel panic
at NFS client's __rpc_create_common function.

The panic place is:
  rpc_mkpipe
      __rpc_lookup_create()          &lt;=== find pipefile *idmap*
      __rpc_mkpipe()                 &lt;=== pipefile is *idmap*
        __rpc_create_common()
         ******  BUG_ON(!d_unhashed(dentry)); ****** *panic*

The test is wrong: we can find ourselves with a hashed negative dentry here
if the idmapper tried to look up the file before we got round to creating
it.

Just replace the BUG_ON() with a d_drop(dentry).

Reported-by: Mi Jinlong &lt;mijinlong@cn.fujitsu.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>convert get_sb_single() users</title>
<updated>2010-10-29T08:16:28+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2010-07-24T21:48:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fc14f2fef682df677d64a145256dbd263df2aa7b'/>
<id>fc14f2fef682df677d64a145256dbd263df2aa7b</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
