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

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
NFSv4.1: Return NFS4ERR_BADSESSION to callbacks during session resets
NFSv4.1: Fix the callback 'highest_used_slotid' behaviour
pnfs-obj: Fix the comp_index != 0 case
pnfs-obj: Bug when we are running out of bio
nfs: add missing prefetch.h include

+43 -40
+1
fs/nfs/blocklayout/blocklayout.c
··· 36 36 #include <linux/namei.h> 37 37 #include <linux/bio.h> /* struct bio */ 38 38 #include <linux/buffer_head.h> /* various write calls */ 39 + #include <linux/prefetch.h> 39 40 40 41 #include "blocklayout.h" 41 42
+1 -1
fs/nfs/callback.h
··· 38 38 struct cb_process_state { 39 39 __be32 drc_status; 40 40 struct nfs_client *clp; 41 + int slotid; 41 42 }; 42 43 43 44 struct cb_compound_hdr_arg { ··· 167 166 void *dummy, struct cb_process_state *cps); 168 167 169 168 extern void nfs4_check_drain_bc_complete(struct nfs4_session *ses); 170 - extern void nfs4_cb_take_slot(struct nfs_client *clp); 171 169 172 170 struct cb_devicenotifyitem { 173 171 uint32_t cbd_notify_type;
+19 -6
fs/nfs/callback_proc.c
··· 348 348 /* Normal */ 349 349 if (likely(args->csa_sequenceid == slot->seq_nr + 1)) { 350 350 slot->seq_nr++; 351 - return htonl(NFS4_OK); 351 + goto out_ok; 352 352 } 353 353 354 354 /* Replay */ ··· 367 367 /* Wraparound */ 368 368 if (args->csa_sequenceid == 1 && (slot->seq_nr + 1) == 0) { 369 369 slot->seq_nr = 1; 370 - return htonl(NFS4_OK); 370 + goto out_ok; 371 371 } 372 372 373 373 /* Misordered request */ 374 374 return htonl(NFS4ERR_SEQ_MISORDERED); 375 + out_ok: 376 + tbl->highest_used_slotid = args->csa_slotid; 377 + return htonl(NFS4_OK); 375 378 } 376 379 377 380 /* ··· 436 433 struct cb_sequenceres *res, 437 434 struct cb_process_state *cps) 438 435 { 436 + struct nfs4_slot_table *tbl; 439 437 struct nfs_client *clp; 440 438 int i; 441 439 __be32 status = htonl(NFS4ERR_BADSESSION); 442 - 443 - cps->clp = NULL; 444 440 445 441 clp = nfs4_find_client_sessionid(args->csa_addr, &args->csa_sessionid); 446 442 if (clp == NULL) 447 443 goto out; 448 444 445 + tbl = &clp->cl_session->bc_slot_table; 446 + 447 + spin_lock(&tbl->slot_tbl_lock); 449 448 /* state manager is resetting the session */ 450 449 if (test_bit(NFS4_SESSION_DRAINING, &clp->cl_session->session_state)) { 451 - status = NFS4ERR_DELAY; 450 + spin_unlock(&tbl->slot_tbl_lock); 451 + status = htonl(NFS4ERR_DELAY); 452 + /* Return NFS4ERR_BADSESSION if we're draining the session 453 + * in order to reset it. 454 + */ 455 + if (test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state)) 456 + status = htonl(NFS4ERR_BADSESSION); 452 457 goto out; 453 458 } 454 459 455 460 status = validate_seqid(&clp->cl_session->bc_slot_table, args); 461 + spin_unlock(&tbl->slot_tbl_lock); 456 462 if (status) 457 463 goto out; 464 + 465 + cps->slotid = args->csa_slotid; 458 466 459 467 /* 460 468 * Check for pending referring calls. If a match is found, a ··· 483 469 res->csr_slotid = args->csa_slotid; 484 470 res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; 485 471 res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; 486 - nfs4_cb_take_slot(clp); 487 472 488 473 out: 489 474 cps->clp = clp; /* put in nfs4_callback_compound */
+7 -17
fs/nfs/callback_xdr.c
··· 754 754 * Let the state manager know callback processing done. 755 755 * A single slot, so highest used slotid is either 0 or -1 756 756 */ 757 - tbl->highest_used_slotid--; 757 + tbl->highest_used_slotid = -1; 758 758 nfs4_check_drain_bc_complete(session); 759 759 spin_unlock(&tbl->slot_tbl_lock); 760 760 } 761 761 762 - static void nfs4_cb_free_slot(struct nfs_client *clp) 762 + static void nfs4_cb_free_slot(struct cb_process_state *cps) 763 763 { 764 - if (clp && clp->cl_session) 765 - nfs4_callback_free_slot(clp->cl_session); 766 - } 767 - 768 - /* A single slot, so highest used slotid is either 0 or -1 */ 769 - void nfs4_cb_take_slot(struct nfs_client *clp) 770 - { 771 - struct nfs4_slot_table *tbl = &clp->cl_session->bc_slot_table; 772 - 773 - spin_lock(&tbl->slot_tbl_lock); 774 - tbl->highest_used_slotid++; 775 - BUG_ON(tbl->highest_used_slotid != 0); 776 - spin_unlock(&tbl->slot_tbl_lock); 764 + if (cps->slotid != -1) 765 + nfs4_callback_free_slot(cps->clp->cl_session); 777 766 } 778 767 779 768 #else /* CONFIG_NFS_V4_1 */ ··· 773 784 return htonl(NFS4ERR_MINOR_VERS_MISMATCH); 774 785 } 775 786 776 - static void nfs4_cb_free_slot(struct nfs_client *clp) 787 + static void nfs4_cb_free_slot(struct cb_process_state *cps) 777 788 { 778 789 } 779 790 #endif /* CONFIG_NFS_V4_1 */ ··· 855 866 struct cb_process_state cps = { 856 867 .drc_status = 0, 857 868 .clp = NULL, 869 + .slotid = -1, 858 870 }; 859 871 unsigned int nops = 0; 860 872 ··· 896 906 897 907 *hdr_res.status = status; 898 908 *hdr_res.nops = htonl(nops); 899 - nfs4_cb_free_slot(cps.clp); 909 + nfs4_cb_free_slot(&cps); 900 910 nfs_put_client(cps.clp); 901 911 dprintk("%s: done, status = %u\n", __func__, ntohl(status)); 902 912 return rpc_success;
+12 -16
fs/nfs/objlayout/objio_osd.c
··· 479 479 for (i = 0; i < ios->numdevs; i++) { 480 480 struct osd_sense_info osi; 481 481 struct osd_request *or = ios->per_dev[i].or; 482 - unsigned dev; 483 482 int ret; 484 483 485 484 if (!or) ··· 499 500 500 501 continue; /* we recovered */ 501 502 } 502 - dev = ios->per_dev[i].dev; 503 - objlayout_io_set_result(&ios->ol_state, dev, 504 - &ios->layout->comps[dev].oc_object_id, 503 + objlayout_io_set_result(&ios->ol_state, i, 504 + &ios->layout->comps[i].oc_object_id, 505 505 osd_pri_2_pnfs_err(osi.osd_err_pri), 506 506 ios->per_dev[i].offset, 507 507 ios->per_dev[i].length, ··· 587 589 } 588 590 589 591 static int _add_stripe_unit(struct objio_state *ios, unsigned *cur_pg, 590 - unsigned pgbase, struct _objio_per_comp *per_dev, int cur_len, 592 + unsigned pgbase, struct _objio_per_comp *per_dev, int len, 591 593 gfp_t gfp_flags) 592 594 { 593 595 unsigned pg = *cur_pg; 596 + int cur_len = len; 594 597 struct request_queue *q = 595 598 osd_request_queue(_io_od(ios, per_dev->dev)); 596 599 597 - per_dev->length += cur_len; 598 - 599 600 if (per_dev->bio == NULL) { 600 - unsigned stripes = ios->layout->num_comps / 601 - ios->layout->mirrors_p1; 602 - unsigned pages_in_stripe = stripes * 601 + unsigned pages_in_stripe = ios->layout->group_width * 603 602 (ios->layout->stripe_unit / PAGE_SIZE); 604 603 unsigned bio_size = (ios->ol_state.nr_pages + pages_in_stripe) / 605 - stripes; 604 + ios->layout->group_width; 606 605 607 606 if (BIO_MAX_PAGES_KMALLOC < bio_size) 608 607 bio_size = BIO_MAX_PAGES_KMALLOC; ··· 627 632 } 628 633 BUG_ON(cur_len); 629 634 635 + per_dev->length += len; 630 636 *cur_pg = pg; 631 637 return 0; 632 638 } ··· 646 650 int ret = 0; 647 651 648 652 while (length) { 649 - struct _objio_per_comp *per_dev = &ios->per_dev[dev]; 653 + struct _objio_per_comp *per_dev = &ios->per_dev[dev - first_dev]; 650 654 unsigned cur_len, page_off = 0; 651 655 652 656 if (!per_dev->length) { ··· 666 670 cur_len = stripe_unit; 667 671 } 668 672 669 - if (max_comp < dev) 670 - max_comp = dev; 673 + if (max_comp < dev - first_dev) 674 + max_comp = dev - first_dev; 671 675 } else { 672 676 cur_len = stripe_unit; 673 677 } ··· 802 806 struct _objio_per_comp *per_dev = &ios->per_dev[cur_comp]; 803 807 unsigned dev = per_dev->dev; 804 808 struct pnfs_osd_object_cred *cred = 805 - &ios->layout->comps[dev]; 809 + &ios->layout->comps[cur_comp]; 806 810 struct osd_obj_id obj = { 807 811 .partition = cred->oc_object_id.oid_partition_id, 808 812 .id = cred->oc_object_id.oid_object_id, ··· 900 904 for (; cur_comp < last_comp; ++cur_comp, ++dev) { 901 905 struct osd_request *or = NULL; 902 906 struct pnfs_osd_object_cred *cred = 903 - &ios->layout->comps[dev]; 907 + &ios->layout->comps[cur_comp]; 904 908 struct osd_obj_id obj = { 905 909 .partition = cred->oc_object_id.oid_partition_id, 906 910 .id = cred->oc_object_id.oid_object_id,
+3
fs/nfs/objlayout/pnfs_osd_xdr_cli.c
··· 170 170 p = _osd_xdr_decode_data_map(p, &layout->olo_map); 171 171 layout->olo_comps_index = be32_to_cpup(p++); 172 172 layout->olo_num_comps = be32_to_cpup(p++); 173 + dprintk("%s: olo_comps_index=%d olo_num_comps=%d\n", __func__, 174 + layout->olo_comps_index, layout->olo_num_comps); 175 + 173 176 iter->total_comps = layout->olo_num_comps; 174 177 return 0; 175 178 }