pnfsd: Add ability to clear pnfs dlm device ds list
Subsystems (2)
PATCH 1/1 pnfsd: Add ability to clear pnfs dlm device ds list
Added the ability to clear the pnfs dlm device ds list. Before, we checked to make sure the list wasn't empty; this is accomplished by examining the character after the ':' in the passed-in string. By modifying this check, an empty list is considered valid, and everything just works.
--- fs/nfsd/nfs4pnfsdlm.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
fs/nfsd/nfs4pnfsdlm.c +0 -0
@@ -160,17 +160,15 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device,
int len)
err = -EINVAL;
bufp += len + 1;
- if (bufp >= endp)
+ if (bufp > endp)
goto out_free;
/* data server list */
- /* FIXME: need to check for comma separated valid ip format */
len = strcspn(bufp, ":");
if (len > NFSD_DLM_DS_LIST_MAX)
goto out_free;
memcpy(new->ds_list, bufp, len);-
/* validate the ips */
if (!nfsd4_validate_pnfs_dlm_device(new->ds_list,
&(new->num_ds)))
goto out_free;Signature · 1 line
1.7.0.4
Quoted 19 lines · Eric Anderle
Added the ability to clear the pnfs dlm device ds list. Before, we checked to make sure the list wasn't empty; this is accomplished by examining the character after the ':' in the passed-in string. By modifying this check, an empty list is considered valid, and everything just works.
--- fs/nfsd/nfs4pnfsdlm.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)fs/nfsd/nfs4pnfsdlm.c +0
-0@@ -160,17 +160,15 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len) err = -EINVAL ; bufp += len +1 ;
fs/nfsd/nfs4pnfsdlm.c nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, · line 171
Quoted 10 lines
fs/nfsd/nfs4pnfsdlm.c +1
-2-if (bufp >= endp) +if (bufp > endp) goto out_free;/* data server list */ and -/* FIXME: need to check for comma separated valid ip format */ len =strcspn (bufp,":" );if (len >NFSD_DLM_DS_LIST_MAX ) goto out_free;memcpy (new->ds_list, bufp, len);
BTW, what about null termination in case len == NFSD_DLM_DS_LIST_MAX? and same for new->disk_name and DISK_NAME_LEN
Benny
Quoted 6 lines
fs/nfsd/nfs4pnfsdlm.c +0
-1-/* validate the ips */ if (!nfsd4_validate_pnfs_dlm_device (new->ds_list, &(new->num_ds)))goto out_free;
Quoted 6 lines · Eric Anderle
Added the ability to clear the pnfs dlm device ds list. Before, we checked to make sure the list wasn't empty; this is accomplished by examining the character after the ':' in the passed-in string. By modifying this check, an empty list is considered valid, and everything just works.
Eric, a couple technical nits:
One, please sign-off your patches.
This is the fact convention that the author also signs off his/her own patches.
Quoted 9 lines
--- fs/nfsd/nfs4pnfsdlm.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)fs/nfsd/nfs4pnfsdlm.c +0
-0
fs/nfsd/nfs4pnfsdlm.c nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, · line 164
Quoted 6 lines
fs/nfsd/nfs4pnfsdlm.c +1
-1@@ -160,17 +160,15 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len) err = -EINVAL ; bufp += len +1 ; -if (bufp >= endp) +if (bufp > endp)
Second, please make sure not to convert tabs to spaces...
Thanks!
Benny
Quoted 14 lines
fs/nfsd/nfs4pnfsdlm.c +0
-2goto out_free;/* data server list */ -/* FIXME: need to check for comma separated valid ip format */ len =strcspn (bufp,":" );if (len >NFSD_DLM_DS_LIST_MAX ) goto out_free;memcpy (new->ds_list, bufp, len); -/* validate the ips */ if (!nfsd4_validate_pnfs_dlm_device(new->ds_list,&(new->num_ds)))
goto out_free;
Quoted 31 lines · Benny Halevy
Quoted 6 lines · Eric Anderle
Added the ability to clear the pnfs dlm device ds list. Before, we checked to make sure the list wasn't empty; this is accomplished by examining the character after the ':' in the passed-in string. By modifying this check, an empty list is considered valid, and everything just works.
Eric, a couple technical nits:
One, please sign-off your patches.
This is the fact convention that the author also signs off his/her own patches.Quoted 9 lines
--- fs/nfsd/nfs4pnfsdlm.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)fs/nfsd/nfs4pnfsdlm.c +0
-0fs/nfsd/nfs4pnfsdlm.c nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, · line 164
Quoted 6 lines
fs/nfsd/nfs4pnfsdlm.c +1
-1@@ -160,17 +160,15 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len) err = -EINVAL ; bufp += len +1 ; -if (bufp >= endp) +if (bufp > endp)Second, please make sure not to convert tabs to spaces...
Quoted 17 lines
Thanks!
Benny
Quoted 13 lines
fs/nfsd/nfs4pnfsdlm.c +0
-2goto out_free;/* data server list */ -/* FIXME: need to check for comma separated valid ip format */ len =strcspn (bufp,":" );if (len >NFSD_DLM_DS_LIST_MAX ) goto out_free;memcpy (new->ds_list, bufp, len); -/* validate the ips */ if (!nfsd4_validate_pnfs_dlm_device(new->ds_list,&(new->num_ds)))
Oh, and beware of long line wrapping...
Quoted 5 lines
Quoted 1 line
goto out_free;--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Benny Halevy
Quoted 8 lines · Benny Halevy
Quoted 6 lines · Eric Anderle
Added the ability to clear the pnfs dlm device ds list. Before, we checked to make sure the list wasn't empty; this is accomplished by examining the character after the ':' in the passed-in string. By modifying this check, an empty list is considered valid, and everything just works.
Quoted 4 lines
Quoted 4 lines
Eric, a couple technical nits:
One, please sign-off your patches.
This is the fact convention that the author also signs off his/her own patches.
Note: see "120 Sign your work" under Documentation/SubmittingPatches to understand what you're agreeing to. (Basically, it's just certifying that the work you're submitting is really yours.)
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
--- fs/nfsd/nfs4pnfsdlm.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)fs/nfsd/nfs4pnfsdlm.c +0
-0fs/nfsd/nfs4pnfsdlm.c nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, · line 164
Quoted 6 lines
fs/nfsd/nfs4pnfsdlm.c +1
-1@@ -160,17 +160,15 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len) err = -EINVAL ; bufp += len +1 ; -if (bufp >= endp) +if (bufp > endp)Second, please make sure not to convert tabs to spaces...
...
Quoted 2 lines
Oh, and beware of long line wrapping...
The instructions for Evolution in Documentation/email-clients.txt may help.
--b.