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

nfsd4: exchange_id cleanup: comments

Make these comments a bit more concise and uniform.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>

+10 -26
+10 -26
fs/nfsd/nfs4state.c
··· 1550 1550 1551 1551 strhashval = clientstr_hashval(dname); 1552 1552 1553 + /* Cases below refer to rfc 5661 section 18.35.4: */ 1553 1554 nfs4_lock_state(); 1554 1555 conf = find_confirmed_client_by_str(dname, strhashval); 1555 1556 if (conf) { ··· 1558 1557 bool verfs_match = same_verf(&verf, &conf->cl_verifier); 1559 1558 1560 1559 if (!clp_used_exchangeid(conf)) { 1561 - if (update) { 1562 - status = nfserr_inval; /* buggy client */ 1560 + if (update) { /* buggy client */ 1561 + status = nfserr_inval; 1563 1562 goto out; 1564 1563 } 1565 1564 } 1566 - if (!creds_match) { 1567 - /* 18.35.4 case 9 */ 1565 + if (!creds_match) { /* case 9 */ 1568 1566 if (update) 1569 1567 status = nfserr_perm; 1570 1568 else /* case 3 */ 1571 1569 status = nfserr_clid_inuse; 1572 1570 goto out; 1573 1571 } 1574 - if (!verfs_match) { 1575 - /* 18.35.4 case 8 */ 1572 + if (!verfs_match) { /* case 8 */ 1576 1573 if (update) { 1577 1574 status = nfserr_not_same; 1578 1575 goto out; 1579 1576 } 1580 - /* Client reboot: destroy old state */ 1577 + /* case 5, client reboot */ 1581 1578 expire_client(conf); 1582 1579 goto out_new; 1583 1580 } ··· 1583 1584 status = nfserr_inval; 1584 1585 goto out; 1585 1586 } 1586 - /* 1587 - * Set bit when the owner id and verifier map to an already 1588 - * confirmed client id (18.35.3). 1589 - */ 1587 + /* case 2 */ 1590 1588 exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; 1591 - 1592 - /* 1593 - * Falling into 18.35.4 case 2, possible router replay. 1594 - * Leave confirmed record intact and return same result. 1595 - */ 1596 1589 new = conf; 1597 1590 goto out_copy; 1598 1591 } 1599 1592 1600 - /* 18.35.4 case 7 */ 1601 - if (update) { 1593 + if (update) { /* case 7 */ 1602 1594 status = nfserr_noent; 1603 1595 goto out; 1604 1596 } 1605 1597 1606 1598 unconf = find_unconfirmed_client_by_str(dname, strhashval); 1607 - if (unconf) { 1608 - /* 1609 - * Possible retry or client restart. Per 18.35.4 case 4, 1610 - * a new unconfirmed record should be generated regardless 1611 - * of whether any properties have changed. 1612 - */ 1599 + if (unconf) /* case 4, possible retry or client restart */ 1613 1600 expire_client(unconf); 1614 - } 1615 1601 1602 + /* case 1 (normal case) */ 1616 1603 out_new: 1617 - /* Normal case */ 1618 1604 new = create_client(exid->clname, dname, rqstp, &verf); 1619 1605 if (new == NULL) { 1620 1606 status = nfserr_jukebox;