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 'for-2.6.40' of git://linux-nfs.org/~bfields/linux

* 'for-2.6.40' of git://linux-nfs.org/~bfields/linux:
nfsd4: fix break_lease flags on nfsd open
nfsd: link returns nfserr_delay when breaking lease
nfsd: v4 support requires CRYPTO
nfsd: fix dependency of nfsd on auth_rpcgss

+25 -21
+1
fs/nfsd/Kconfig
··· 82 82 select NFSD_V3 83 83 select FS_POSIX_ACL 84 84 select SUNRPC_GSS 85 + select CRYPTO 85 86 help 86 87 This option enables support in your system's NFS server for 87 88 version 4 of the NFS protocol (RFC 3530).
+6 -13
fs/nfsd/nfsctl.c
··· 13 13 #include <linux/lockd/lockd.h> 14 14 #include <linux/sunrpc/clnt.h> 15 15 #include <linux/sunrpc/gss_api.h> 16 + #include <linux/sunrpc/gss_krb5_enctypes.h> 16 17 17 18 #include "idmap.h" 18 19 #include "nfsd.h" ··· 190 189 .release = single_release, 191 190 }; 192 191 193 - #ifdef CONFIG_SUNRPC_GSS 192 + #if defined(CONFIG_SUNRPC_GSS) || defined(CONFIG_SUNRPC_GSS_MODULE) 194 193 static int supported_enctypes_show(struct seq_file *m, void *v) 195 194 { 196 - struct gss_api_mech *k5mech; 197 - 198 - k5mech = gss_mech_get_by_name("krb5"); 199 - if (k5mech == NULL) 200 - goto out; 201 - if (k5mech->gm_upcall_enctypes != NULL) 202 - seq_printf(m, k5mech->gm_upcall_enctypes); 203 - gss_mech_put(k5mech); 204 - out: 195 + seq_printf(m, KRB5_SUPPORTED_ENCTYPES); 205 196 return 0; 206 197 } 207 198 ··· 208 215 .llseek = seq_lseek, 209 216 .release = single_release, 210 217 }; 211 - #endif /* CONFIG_SUNRPC_GSS */ 218 + #endif /* CONFIG_SUNRPC_GSS or CONFIG_SUNRPC_GSS_MODULE */ 212 219 213 220 extern int nfsd_pool_stats_open(struct inode *inode, struct file *file); 214 221 extern int nfsd_pool_stats_release(struct inode *inode, struct file *file); ··· 1420 1427 [NFSD_Versions] = {"versions", &transaction_ops, S_IWUSR|S_IRUSR}, 1421 1428 [NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO}, 1422 1429 [NFSD_MaxBlkSize] = {"max_block_size", &transaction_ops, S_IWUSR|S_IRUGO}, 1423 - #ifdef CONFIG_SUNRPC_GSS 1430 + #if defined(CONFIG_SUNRPC_GSS) || defined(CONFIG_SUNRPC_GSS_MODULE) 1424 1431 [NFSD_SupportedEnctypes] = {"supported_krb5_enctypes", &supported_enctypes_ops, S_IRUGO}, 1425 - #endif /* CONFIG_SUNRPC_GSS */ 1432 + #endif /* CONFIG_SUNRPC_GSS or CONFIG_SUNRPC_GSS_MODULE */ 1426 1433 #ifdef CONFIG_NFSD_V4 1427 1434 [NFSD_Leasetime] = {"nfsv4leasetime", &transaction_ops, S_IWUSR|S_IRUSR}, 1428 1435 [NFSD_Gracetime] = {"nfsv4gracetime", &transaction_ops, S_IWUSR|S_IRUSR},
+12 -7
fs/nfsd/vfs.c
··· 696 696 } 697 697 #endif /* CONFIG_NFSD_V3 */ 698 698 699 + static int nfsd_open_break_lease(struct inode *inode, int access) 700 + { 701 + unsigned int mode; 699 702 703 + if (access & NFSD_MAY_NOT_BREAK_LEASE) 704 + return 0; 705 + mode = (access & NFSD_MAY_WRITE) ? O_WRONLY : O_RDONLY; 706 + return break_lease(inode, mode | O_NONBLOCK); 707 + } 700 708 701 709 /* 702 710 * Open an existing file or directory. ··· 752 744 if (!inode->i_fop) 753 745 goto out; 754 746 755 - /* 756 - * Check to see if there are any leases on this file. 757 - * This may block while leases are broken. 758 - */ 759 - if (!(access & NFSD_MAY_NOT_BREAK_LEASE)) 760 - host_err = break_lease(inode, O_NONBLOCK | ((access & NFSD_MAY_WRITE) ? O_WRONLY : 0)); 747 + host_err = nfsd_open_break_lease(inode, access); 761 748 if (host_err) /* NOMEM or WOULDBLOCK */ 762 749 goto out_nfserr; 763 750 ··· 1663 1660 if (!dold->d_inode) 1664 1661 goto out_drop_write; 1665 1662 host_err = nfsd_break_lease(dold->d_inode); 1666 - if (host_err) 1663 + if (host_err) { 1664 + err = nfserrno(host_err); 1667 1665 goto out_drop_write; 1666 + } 1668 1667 host_err = vfs_link(dold, dirp, dnew); 1669 1668 if (!host_err) { 1670 1669 err = nfserrno(commit_metadata(ffhp));
+4
include/linux/sunrpc/gss_krb5_enctypes.h
··· 1 + /* 2 + * Dumb way to share this static piece of information with nfsd 3 + */ 4 + #define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2"
+2 -1
net/sunrpc/auth_gss/gss_krb5_mech.c
··· 43 43 #include <linux/sunrpc/gss_krb5.h> 44 44 #include <linux/sunrpc/xdr.h> 45 45 #include <linux/crypto.h> 46 + #include <linux/sunrpc/gss_krb5_enctypes.h> 46 47 47 48 #ifdef RPC_DEBUG 48 49 # define RPCDBG_FACILITY RPCDBG_AUTH ··· 751 750 .gm_ops = &gss_kerberos_ops, 752 751 .gm_pf_num = ARRAY_SIZE(gss_kerberos_pfs), 753 752 .gm_pfs = gss_kerberos_pfs, 754 - .gm_upcall_enctypes = "18,17,16,23,3,1,2", 753 + .gm_upcall_enctypes = KRB5_SUPPORTED_ENCTYPES, 755 754 }; 756 755 757 756 static int __init init_kerberos_module(void)