nfsd4: idmap upcalls should use unsigned uid and gid
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 11855710801310-git-send-email-
A message that is not in the archive (sent off-list or not yet received): 1185571080322-git-send-email-
PATCH 1/1 nfsd4: idmap upcalls should use unsigned uid and gid
From: J. Bruce Fields <[email protected]>
We shouldn't be using negative uid's and gid's in the idmap upcalls.
--- fs/nfsd/nfs4idmap.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
fs/nfsd/nfs4idmap.c +3 -3
@@ -138,7 +138,7 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,char idstr[11 ];qword_add (bpp, blen, ent->authname); -snprintf (idstr,sizeof (idstr),"%d" , ent->id); +snprintf (idstr,sizeof (idstr),"%u" , ent->id);qword_add (bpp, blen, ent->type ==IDMAP_TYPE_GROUP ?"group" :"user" );qword_add (bpp, blen, idstr);
@@ -165,7 +165,7 @@ idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h)return 0 ; } ent = container_of(h, struct ent, h); -seq_printf (m,"%s %s %d" , ent->authname, +seq_printf (m,"%s %s %u" , ent->authname, ent->type ==IDMAP_TYPE_GROUP ?"group" :"user" , ent->id);if (test_bit (CACHE_VALID , &h->flags))
@@ -349,7 +349,7 @@ nametoid_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) ent->type ==IDMAP_TYPE_GROUP ?"group" :"user" , ent->name);if (test_bit (CACHE_VALID , &h->flags)) -seq_printf (m," %d" , ent->id); +seq_printf (m," %u" , ent->id);seq_printf (m,"\n" );return 0 ; }
Signature · 11 lines
1.5.3.rc2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
A message that is not in the archive (sent off-list or not yet received): 11855710802313-git-send-email-
PATCH 1/1 knfsd: eliminate unnecessary -ENOENT returns on export downcalls
From: J. Bruce Fields <[email protected]>
A succesful downcall with a negative result (which indicates that the given filesystem is not exported to the given user) should not return an error.
Currently mountd is depending on stdio to write these downcalls. With some versions of libc this appears to cause subsequent writes to attempt to write all accumulated data (for which writes previously failed) along with any new data. This can prevent the kernel from seeing responses to later downcalls. Symptoms will be that nfsd fails to respond to certain requests.
--- fs/nfsd/export.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
fs/nfsd/export.c +3 -2
@@ -564,9 +564,10 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)/* flags */ err =get_int (&mesg, &an_int); -if (err == -ENOENT ) +if (err == -ENOENT ) { + err =0 ;set_bit (CACHE_NEGATIVE , &exp.h.flags); -else { + }else {if (err || an_int <0 ) goto out; exp.ex_flags= an_int;
Signature · 11 lines
1.5.3.rc2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
PATCH 1/1 knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE
In reply to a message not in the archiveFrom: Jeff Layton <[email protected]>
RFC 3530 says:
If the server uses an attribute to store the exclusive create verifier, it will signify which attribute by setting the appropriate bit in the attribute mask that is returned in the results.
Linux uses the atime and mtime to store the verifier, but sends a zeroed out bitmask back to the client. This patch makes sure that we set the correct bits in the bitmask in this situation.
--- fs/nfsd/nfs4proc.c | 10 +++++++++- fs/nfsd/vfs.c | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-)
fs/nfsd/nfs4proc.c +9 -1
@@ -100,7 +100,15 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o status =nfsd_create_v3 (rqstp, current_fh, open->op_fname.data, open->op_fname.len, &open->op_iattr, &resfh, open->op_createmode, - (u32 *)open->op_verf.data, &open->op_truncate, &created); + (u32 *)open->op_verf.data, + &open->op_truncate, &created); + +/* If we ever decide to use different attrs to store the +* verifier in nfsd_create_v3, then we'll need to change this +*/ +if (open->op_createmode ==NFS4_CREATE_EXCLUSIVE && status ==0 ) + open->op_bmval[1 ] |= (FATTR4_WORD1_TIME_ACCESS | +FATTR4_WORD1_TIME_MODIFY ); }else { status =nfsd_lookup (rqstp, current_fh, open->op_fname.data, open->op_fname.len, &resfh);
fs/nfsd/vfs.c +4 -1
@@ -1309,7 +1309,10 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,if (createmode ==NFS3_CREATE_EXCLUSIVE ) {/* solaris7 gets confused (bugid 4218508) if these have -* the high bit set, so just clear the high bits. +* the high bit set, so just clear the high bits. If this is +* ever changed to use different attrs for storing the +* verifier, then do_open_lookup() will also need to be fixed +* accordingly. */ v_mtime = verifier[0 ]&0x7fffffff ; v_atime = verifier[1 ]&0x7fffffff ;
Signature · 11 lines
1.5.3.rc2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs