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.17-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client fixes from Trond Myklebust:
"Highligts:
- fix an Oops in nfs4_open_and_get_state
- fix an Oops in the nfs4_state_manager
- fix another bug in the close/open_downgrade code"

* tag 'nfs-for-3.17-5' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
NFSv4: Fix another bug in the close/open_downgrade code
NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists()
NFS: remove BUG possibility in nfs4_open_and_get_state

+42 -36
+20 -18
fs/nfs/nfs4client.c
··· 482 482 483 483 spin_lock(&nn->nfs_client_lock); 484 484 list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { 485 + 486 + if (pos->rpc_ops != new->rpc_ops) 487 + continue; 488 + 489 + if (pos->cl_proto != new->cl_proto) 490 + continue; 491 + 492 + if (pos->cl_minorversion != new->cl_minorversion) 493 + continue; 494 + 485 495 /* If "pos" isn't marked ready, we can't trust the 486 496 * remaining fields in "pos" */ 487 497 if (pos->cl_cons_state > NFS_CS_READY) { ··· 509 499 spin_lock(&nn->nfs_client_lock); 510 500 } 511 501 if (pos->cl_cons_state != NFS_CS_READY) 512 - continue; 513 - 514 - if (pos->rpc_ops != new->rpc_ops) 515 - continue; 516 - 517 - if (pos->cl_proto != new->cl_proto) 518 - continue; 519 - 520 - if (pos->cl_minorversion != new->cl_minorversion) 521 502 continue; 522 503 523 504 if (pos->cl_clientid != new->cl_clientid) ··· 623 622 624 623 spin_lock(&nn->nfs_client_lock); 625 624 list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) { 625 + 626 + if (pos->rpc_ops != new->rpc_ops) 627 + continue; 628 + 629 + if (pos->cl_proto != new->cl_proto) 630 + continue; 631 + 632 + if (pos->cl_minorversion != new->cl_minorversion) 633 + continue; 634 + 626 635 /* If "pos" isn't marked ready, we can't trust the 627 636 * remaining fields in "pos", especially the client 628 637 * ID and serverowner fields. Wait for CREATE_SESSION ··· 656 645 status = -NFS4ERR_STALE_CLIENTID; 657 646 } 658 647 if (pos->cl_cons_state != NFS_CS_READY) 659 - continue; 660 - 661 - if (pos->rpc_ops != new->rpc_ops) 662 - continue; 663 - 664 - if (pos->cl_proto != new->cl_proto) 665 - continue; 666 - 667 - if (pos->cl_minorversion != new->cl_minorversion) 668 648 continue; 669 649 670 650 if (!nfs4_match_clientids(pos, new))
+22 -18
fs/nfs/nfs4proc.c
··· 2226 2226 ret = _nfs4_proc_open(opendata); 2227 2227 if (ret != 0) { 2228 2228 if (ret == -ENOENT) { 2229 - d_drop(opendata->dentry); 2230 - d_add(opendata->dentry, NULL); 2231 - nfs_set_verifier(opendata->dentry, 2229 + dentry = opendata->dentry; 2230 + if (dentry->d_inode) 2231 + d_delete(dentry); 2232 + else if (d_unhashed(dentry)) 2233 + d_add(dentry, NULL); 2234 + 2235 + nfs_set_verifier(dentry, 2232 2236 nfs_save_change_attribute(opendata->dir->d_inode)); 2233 2237 } 2234 2238 goto out; ··· 2618 2614 is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags); 2619 2615 is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags); 2620 2616 is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags); 2621 - /* Calculate the current open share mode */ 2622 - calldata->arg.fmode = 0; 2623 - if (is_rdonly || is_rdwr) 2624 - calldata->arg.fmode |= FMODE_READ; 2625 - if (is_wronly || is_rdwr) 2626 - calldata->arg.fmode |= FMODE_WRITE; 2627 2617 /* Calculate the change in open mode */ 2618 + calldata->arg.fmode = 0; 2628 2619 if (state->n_rdwr == 0) { 2629 - if (state->n_rdonly == 0) { 2630 - call_close |= is_rdonly || is_rdwr; 2631 - calldata->arg.fmode &= ~FMODE_READ; 2632 - } 2633 - if (state->n_wronly == 0) { 2634 - call_close |= is_wronly || is_rdwr; 2635 - calldata->arg.fmode &= ~FMODE_WRITE; 2636 - } 2637 - } 2620 + if (state->n_rdonly == 0) 2621 + call_close |= is_rdonly; 2622 + else if (is_rdonly) 2623 + calldata->arg.fmode |= FMODE_READ; 2624 + if (state->n_wronly == 0) 2625 + call_close |= is_wronly; 2626 + else if (is_wronly) 2627 + calldata->arg.fmode |= FMODE_WRITE; 2628 + } else if (is_rdwr) 2629 + calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; 2630 + 2631 + if (calldata->arg.fmode == 0) 2632 + call_close |= is_rdwr; 2633 + 2638 2634 if (!nfs4_valid_open_stateid(state)) 2639 2635 call_close = 0; 2640 2636 spin_unlock(&state->owner->so_lock);