[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/client/sysint:
sys-create.sm
CVS commit program
cvs at parl.clemson.edu
Thu May 15 17:11:32 EDT 2008
Update of /projects/cvsroot/pvfs2-1/src/client/sysint
In directory parlweb1:/tmp/cvs-serv14020
Modified Files:
Tag: small-file-branch
sys-create.sm
Log Message:
safety check layout specified by user
Index: sys-create.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/client/sysint/sys-create.sm,v
diff -p -u -r1.114.2.11 -r1.114.2.12
--- sys-create.sm 30 Apr 2008 19:01:48 -0000 1.114.2.11
+++ sys-create.sm 15 May 2008 21:11:31 -0000 1.114.2.12
@@ -199,6 +199,19 @@ PVFS_error PVFS_isys_create(
/* copy layout to sm struct */
if(layout)
{
+ /* make sure it is a supported layout */
+ switch(layout->algorithm)
+ {
+ /* these are valid */
+ case PVFS_SYS_LAYOUT_ROUND_ROBIN:
+ case PVFS_SYS_LAYOUT_RANDOM:
+ case PVFS_SYS_LAYOUT_LIST:
+ break;
+ /* anything else is not */
+ default:
+ return(-PVFS_EINVAL);
+ }
+
sm_p->u.create.layout.algorithm = layout->algorithm;
if(layout->algorithm == PVFS_SYS_LAYOUT_LIST)
{
More information about the Pvfs2-cvs
mailing list