Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfs-for-3.5-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
- Fix a write hang due to an uninitalised variable when
!defined(CONFIG_NFS_V4)
- Address upcall races in the legacy NFSv4 idmapper
- Remove an O_DIRECT refcounting issue
- Fix a pNFS refcounting bug when the file layout metadata server is
also acting as a data server
- Fix a pNFS module loading race.

* tag 'nfs-for-3.5-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
NFS: Force the legacy idmapper to be single threaded
NFS: Initialise commit_info.rpc_out when !defined(CONFIG_NFS_V4)
NFS: Fix a refcounting issue in O_DIRECT
NFSv4.1: Fix a race in set_pnfs_layoutdriver
NFSv4.1: Fix umount when filelayout DS is also the MDS

+20 -11
-1
fs/nfs/client.c
··· 207 207 static void nfs4_shutdown_session(struct nfs_client *clp) 208 208 { 209 209 if (nfs4_has_session(clp)) { 210 - nfs4_deviceid_purge_client(clp); 211 210 nfs4_destroy_session(clp->cl_session); 212 211 nfs4_destroy_clientid(clp); 213 212 }
+1
fs/nfs/direct.c
··· 490 490 dreq->error = -EIO; 491 491 spin_unlock(cinfo.lock); 492 492 } 493 + nfs_release_request(req); 493 494 } 494 495 nfs_pageio_complete(&desc); 495 496
+8 -5
fs/nfs/idmap.c
··· 57 57 static const struct cred *id_resolver_cache; 58 58 static struct key_type key_type_id_resolver_legacy; 59 59 60 + struct idmap { 61 + struct rpc_pipe *idmap_pipe; 62 + struct key_construction *idmap_key_cons; 63 + struct mutex idmap_mutex; 64 + }; 60 65 61 66 /** 62 67 * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields ··· 315 310 name, namelen, type, data, 316 311 data_size, NULL); 317 312 if (ret < 0) { 313 + mutex_lock(&idmap->idmap_mutex); 318 314 ret = nfs_idmap_request_key(&key_type_id_resolver_legacy, 319 315 name, namelen, type, data, 320 316 data_size, idmap); 317 + mutex_unlock(&idmap->idmap_mutex); 321 318 } 322 319 return ret; 323 320 } ··· 360 353 361 354 /* idmap classic begins here */ 362 355 module_param(nfs_idmap_cache_timeout, int, 0644); 363 - 364 - struct idmap { 365 - struct rpc_pipe *idmap_pipe; 366 - struct key_construction *idmap_key_cons; 367 - }; 368 356 369 357 enum { 370 358 Opt_find_uid, Opt_find_gid, Opt_find_user, Opt_find_group, Opt_find_err ··· 471 469 return error; 472 470 } 473 471 idmap->idmap_pipe = pipe; 472 + mutex_init(&idmap->idmap_mutex); 474 473 475 474 clp->cl_idmap = idmap; 476 475 return 0;
+1 -1
fs/nfs/inode.c
··· 1530 1530 nfsi->delegation_state = 0; 1531 1531 init_rwsem(&nfsi->rwsem); 1532 1532 nfsi->layout = NULL; 1533 - atomic_set(&nfsi->commit_info.rpcs_out, 0); 1534 1533 #endif 1535 1534 } 1536 1535 ··· 1544 1545 INIT_LIST_HEAD(&nfsi->commit_info.list); 1545 1546 nfsi->npages = 0; 1546 1547 nfsi->commit_info.ncommit = 0; 1548 + atomic_set(&nfsi->commit_info.rpcs_out, 0); 1547 1549 atomic_set(&nfsi->silly_count, 1); 1548 1550 INIT_HLIST_HEAD(&nfsi->silly_list); 1549 1551 init_waitqueue_head(&nfsi->waitqueue);
+9 -4
fs/nfs/pnfs.c
··· 70 70 71 71 spin_lock(&pnfs_spinlock); 72 72 local = find_pnfs_driver_locked(id); 73 + if (local != NULL && !try_module_get(local->owner)) { 74 + dprintk("%s: Could not grab reference on module\n", __func__); 75 + local = NULL; 76 + } 73 77 spin_unlock(&pnfs_spinlock); 74 78 return local; 75 79 } ··· 84 80 if (nfss->pnfs_curr_ld) { 85 81 if (nfss->pnfs_curr_ld->clear_layoutdriver) 86 82 nfss->pnfs_curr_ld->clear_layoutdriver(nfss); 83 + /* Decrement the MDS count. Purge the deviceid cache if zero */ 84 + if (atomic_dec_and_test(&nfss->nfs_client->cl_mds_count)) 85 + nfs4_deviceid_purge_client(nfss->nfs_client); 87 86 module_put(nfss->pnfs_curr_ld->owner); 88 87 } 89 88 nfss->pnfs_curr_ld = NULL; ··· 122 115 goto out_no_driver; 123 116 } 124 117 } 125 - if (!try_module_get(ld_type->owner)) { 126 - dprintk("%s: Could not grab reference on module\n", __func__); 127 - goto out_no_driver; 128 - } 129 118 server->pnfs_curr_ld = ld_type; 130 119 if (ld_type->set_layoutdriver 131 120 && ld_type->set_layoutdriver(server, mntfh)) { ··· 130 127 module_put(ld_type->owner); 131 128 goto out_no_driver; 132 129 } 130 + /* Bump the MDS count */ 131 + atomic_inc(&server->nfs_client->cl_mds_count); 133 132 134 133 dprintk("%s: pNFS module for %u set\n", __func__, id); 135 134 return;
+1
include/linux/nfs_fs_sb.h
··· 25 25 */ 26 26 struct nfs_client { 27 27 atomic_t cl_count; 28 + atomic_t cl_mds_count; 28 29 int cl_cons_state; /* current construction state (-ve: init error) */ 29 30 #define NFS_CS_READY 0 /* ready to be used */ 30 31 #define NFS_CS_INITING 1 /* busy initialising */