remarkable-linux/fs/nfs
Trond Myklebust bb6fbc4548 NFS: Avoid a deadlock in nfs_release_page
J.R. Okajima reports the following deadlock:

INFO: task kswapd0:305 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
kswapd0       D 0000000000000001     0   305      2 0x00000000
 ffff88001f21d4f0 0000000000000046 ffff88001fdea680 ffff88001f21c000
 ffff88001f21dfd8 ffff88001f21c000 ffff88001f21dfd8 ffff88001f21dfd8
 ffff88001fdea040 0000000000014c00 0000000000000001 ffff88001fdea040
Call Trace:
 [<ffffffff8146155d>] io_schedule+0x4d/0x70
 [<ffffffff810d2be5>] sync_page+0x65/0xa0
 [<ffffffff81461b12>] __wait_on_bit_lock+0x52/0xb0
 [<ffffffff810d2b80>] ? sync_page+0x0/0xa0
 [<ffffffff810d2b64>] __lock_page+0x64/0x70
 [<ffffffff81070ce0>] ? wake_bit_function+0x0/0x40
 [<ffffffff810df1d4>] truncate_inode_pages_range+0x344/0x4a0
 [<ffffffff810df340>] truncate_inode_pages+0x10/0x20
 [<ffffffff8112cbfe>] generic_delete_inode+0x15e/0x190
 [<ffffffff8112cc8d>] generic_drop_inode+0x5d/0x80
 [<ffffffff8112bb88>] iput+0x78/0x80
 [<ffffffff811bc908>] nfs_dentry_iput+0x38/0x50
 [<ffffffff811285f4>] dentry_iput+0x84/0x110
 [<ffffffff811286ae>] d_kill+0x2e/0x60
 [<ffffffff8112912a>] dput+0x7a/0x170
 [<ffffffff8111e925>] path_put+0x15/0x40
 [<ffffffff811c3a44>] __put_nfs_open_context+0xa4/0xb0
 [<ffffffff811cb5d0>] ? nfs_free_request+0x0/0x50
 [<ffffffff811c3b0b>] put_nfs_open_context+0xb/0x10
 [<ffffffff811cb5f9>] nfs_free_request+0x29/0x50
 [<ffffffff81234b7e>] kref_put+0x8e/0xe0
 [<ffffffff811cb594>] nfs_release_request+0x14/0x20
 [<ffffffff811cf769>] nfs_find_and_lock_request+0x89/0xa0
 [<ffffffff811d1180>] nfs_wb_page+0x80/0x110
 [<ffffffff811c0770>] nfs_release_page+0x70/0x90
 [<ffffffff810d18ee>] try_to_release_page+0x5e/0x80
 [<ffffffff810e1178>] shrink_page_list+0x638/0x860
 [<ffffffff810e19de>] shrink_zone+0x63e/0xc40

We can fix this by making the call to put_nfs_open_context() happen when we
actually remove the write request from the inode (which is done by the
nfsiod thread in this case).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
2010-03-11 09:19:35 -05:00
..
cache_lib.c NFS: Add a dns resolver for use with NFSv4 referrals and migration 2009-08-19 18:22:15 -04:00
cache_lib.h NFS: Add a dns resolver for use with NFSv4 referrals and migration 2009-08-19 18:22:15 -04:00
callback.c SUNRPC: Bury "#ifdef IPV6" in svc_create_xprt() 2010-01-26 17:56:43 -05:00
callback.h nfs41: implement cb_recall_slot 2010-02-10 08:30:59 -05:00
callback_proc.c nfs41: cleanup callback code to use __be32 type 2010-02-10 08:31:01 -05:00
callback_xdr.c nfs4: Make the v4 callback service hidden 2010-03-08 14:56:42 -05:00
client.c nfs: kill renewd before clearing client minor version 2010-03-02 12:16:12 -05:00
delegation.c nfs41: v2 fix cb_recall bug 2009-12-05 13:48:55 -05:00
delegation.h NFSv4: Don't ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode() 2010-03-10 15:21:44 -05:00
dir.c NFSv4: Don't ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode() 2010-03-10 15:21:44 -05:00
direct.c NFS: Too many GETATTR and ACCESS calls after direct I/O 2010-02-15 19:53:43 -08:00
dns_resolve.c NFS: Fix an allocation-under-spinlock bug 2010-03-02 13:06:22 -05:00
dns_resolve.h NFS: Add a dns resolver for use with NFSv4 referrals and migration 2009-08-19 18:22:15 -04:00
file.c NFS: Improve NFS iostat byte count accuracy for writes 2010-02-10 08:31:04 -05:00
fscache-index.c NFS: Add read context retention for FS-Cache to call back with 2009-04-03 16:42:44 +01:00
fscache.c NFS: Fix a bug in nfs_fscache_release_page() 2010-02-09 14:29:10 -05:00
fscache.h NFS: Propagate 'fsc' mount option through automounts 2009-09-23 14:36:39 -04:00
getroot.c headers: mnt_namespace.h redux 2009-07-08 09:31:56 -07:00
idmap.c SUNRPC: Replace rpc_client->cl_dentry and cl_mnt, with a cl_path 2009-08-09 15:14:24 -04:00
inode.c NFSv4: Don't ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode() 2010-03-10 15:21:44 -05:00
internal.h pass writeback_control to ->write_inode 2010-03-05 13:25:52 -05:00
iostat.h percpu: add __percpu sparse annotations to fs 2010-02-17 11:17:38 +09:00
Kconfig Remove EXPERIMENTAL from NFS_FSCACHE 2010-02-26 17:22:35 -08:00
Makefile NFS: Add a dns resolver for use with NFSv4 referrals and migration 2009-08-19 18:22:15 -04:00
mount_clnt.c NFS: Fix the mapping of the NFSERR_SERVERFAULT error 2010-02-09 14:29:29 -05:00
namespace.c NFS: Fix nfs_path() to always return a '/' at the beginning of the path 2009-06-22 21:28:25 -07:00
nfs2xdr.c NFS: Fix the mapping of the NFSERR_SERVERFAULT error 2010-02-09 14:29:29 -05:00
nfs3acl.c nfs: remove unnecessary NFS_INO_INVALID_ACL checks 2009-06-17 18:02:14 -07:00
nfs3proc.c nfs: handle NFSv3 -EKEYEXPIRED errors as we would -EJUKEBOX 2010-02-10 08:30:51 -05:00
nfs3xdr.c headers: utsname.h redux 2009-09-23 18:13:10 -07:00
nfs4_fs.h nfs41: implement cb_recall_slot 2010-02-10 08:30:59 -05:00
nfs4namespace.c NFSv4: Fix the referral mount code 2009-10-06 15:42:20 -04:00
nfs4proc.c nfs: fix unlikely memory leak 2010-03-08 14:10:00 -05:00
nfs4renewd.c nfs: prevent backlogging of renewd requests 2010-03-02 12:44:07 -05:00
nfs4state.c NFSv4.1: Various fixes to the sequence flag error handling 2010-03-02 13:06:21 -05:00
nfs4xdr.c Merge branch 'writeback-for-2.6.34' into nfs-for-2.6.34 2010-03-05 15:46:18 -05:00
nfsroot.c NFS: Update MNT and MNT3 reply decoding functions 2009-06-17 18:02:13 -07:00
pagelist.c NFS: Avoid a deadlock in nfs_release_page 2010-03-11 09:19:35 -05:00
proc.c nfs: handle NFSv2 -EKEYEXPIRED returns from RPC layer appropriately 2010-02-10 08:30:52 -05:00
read.c NFS: Fix up the declaration of nfs4_restart_rpc when NFSv4 not configured 2009-12-07 09:00:24 -05:00
super.c NFS: Fix a umount race 2010-02-03 08:27:35 -05:00
symlink.c NFS: Remove requirement for inode->i_mutex from nfs_invalidate_mapping 2010-03-05 15:44:56 -05:00
sysctl.c NFS: Avoid warnings when CONFIG_NFS_V4=n 2010-01-26 15:42:11 -05:00
unlink.c NFS: Fix up the declaration of nfs4_restart_rpc when NFSv4 not configured 2009-12-07 09:00:24 -05:00
write.c NFS: Simplify nfs_wb_page() 2010-03-05 15:44:55 -05:00