nfsd fixes for 3.8
Subsystems (3)
The following are some minor nfsd fixes that I intend to queue up for 3.8.
--b.
PATCH 1/4 nfsd4: helper function for getting mounted_on ino
From: "J. Bruce Fields" <[email protected]>
Signed-off-by J. Bruce Fields <[email protected]>
--- fs/nfsd/nfs4xdr.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-)
fs/nfsd/nfs4xdr.c +18 -12
@@ -2014,6 +2014,22 @@ static __be32 fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)return 0 ; } + +static int get_parent_attributes (struct svc_export *exp,struct kstat *stat) +{ +struct path path = exp->ex_path; +int err; + +path_get (&path); +while (follow_up (&path)) { +if (path.dentry != path.mnt->mnt_root) +break ; + } + err =vfs_getattr (path.mnt, path.dentry, stat); +path_put (&path); +return err; +} +/* * Note: @fhp can be NULL; in this case, we might have to compose the filehandle * ourselves.
@@ -2430,18 +2446,8 @@ out_acl:* and this is the root of a cross-mounted filesystem. */ if (ignore_crossmnt ==0 && - dentry == exp->ex_path.mnt->mnt_root) { -struct path path = exp->ex_path; -path_get (&path); -while (follow_up (&path)) { -if (path.dentry != path.mnt->mnt_root) -break ; - } - err =vfs_getattr (path.mnt, path.dentry, &stat); -path_put (&path); -if (err) - goto out_nfserr; - } + dentry == exp->ex_path.mnt->mnt_root) +get_parent_attributes (exp, &stat);WRITE64 (stat.ino); }if (bmval2 &FATTR4_WORD2_SUPPATTR_EXCLCREAT ) {
Signature · 1 line
1.7.9.5
PATCH 2/4 nfsd4: remove unused init_session return
In reply to J. Bruce FieldsFrom: "J. Bruce Fields" <[email protected]>
Signed-off-by J. Bruce Fields <[email protected]>
--- fs/nfsd/nfs4state.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfsd/nfs4state.c +1 -2
@@ -945,7 +945,7 @@ static struct nfsd4_session *alloc_session(struct nfsd4_channel_attrs *fchan)return new; } -static struct nfsd4_session *init_session (struct svc_rqst *rqstp,struct nfsd4_session *new,struct nfs4_client *clp,struct nfsd4_create_session *cses) +void init_session (struct svc_rqst *rqstp,struct nfsd4_session *new,struct nfs4_client *clp,struct nfsd4_create_session *cses) {int idx;
@@ -978,7 +978,6 @@ static struct nfsd4_session *init_session(struct svc_rqst *rqstp, struct nfsd4_srpc_copy_addr ((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa); clp->cl_cb_conn.cb_addrlen =svc_addr_len (sa); } -return new; }/* caller must hold client_lock */
Signature · 1 line
1.7.9.5
PATCH 3/4 svcrpc: demote some printks to a dprintk
In reply to J. Bruce FieldsFrom: "J. Bruce Fields" <[email protected]>
In general I'd rather random bad behavior on the network won't trigger a printk.
Signed-off-by J. Bruce Fields <[email protected]>
--- net/sunrpc/svc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
net/sunrpc/svc.c +2 -3
@@ -1035,7 +1035,7 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net) }/* -* Printk the given error with the address of the client that caused it. +* dprintk the given error with the address of the client that caused it. */ static __printf(2, 3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
@@ -1049,8 +1049,7 @@ void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) vaf.fmt = fmt; vaf.va = &args; -net_warn_ratelimited ("svc: %s: %pV" , -svc_print_addr (rqstp, buf,sizeof (buf)), &vaf); +dprintk ("svc: %s: %pV" ,svc_print_addr (rqstp, buf,sizeof (buf)), &vaf);va_end (args); }
Signature · 1 line
1.7.9.5
PATCH 4/4 nfsd4: don't BUG in delegation break callback
In reply to J. Bruce FieldsFrom: "J. Bruce Fields" <[email protected]>
These conditions would indeed indicate bugs in the code, but if we want to hear about them we're likely better off warning and returning than immediately dying while holding file_lock_lock.
Signed-off-by J. Bruce Fields <[email protected]>
--- fs/nfsd/nfs4state.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
fs/nfsd/nfs4state.c +8 -3
@@ -2554,9 +2554,14 @@ static void nfsd_break_deleg_cb(struct file_lock *fl)struct nfs4_file *fp = (struct nfs4_file *)fl->fl_owner;struct nfs4_delegation *dp; -BUG_ON (!fp); -/* We assume break_lease is only called once per lease: */ -BUG_ON (fp->fi_had_conflict); +if (!fp) { +WARN (1 ,"(%p)->fl_owner NULL\n" , fl); +return ; + } +if (fp->fi_had_conflict) { +WARN (1 ,"duplicate break on %p\n" , fp); +return ; + }/* * We don't want the locks code to timeout the lease for us; * we'll remove it ourself if a delegation isn't returned
Signature · 1 line
1.7.9.5