Skip to content

Commit

Permalink
"setattr problem is solved, post create should be allset. only thing …
Browse files Browse the repository at this point in the history
…remaning is letting pvfs mds know in case of create failure"

git-svn-id: svn+ssh://137.99.13.219/srv/svn/ofsproject/ofsproject/2.8.4-stock/osd_branch@59 dfcdf660-53a5-499b-8775-f9b82cf2d3b9
  • Loading branch information
cek10006 committed Mar 23, 2012
1 parent 7e68c6f commit d5d9520
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 374 deletions.
56 changes: 26 additions & 30 deletions src/client/sysint/sys-create.sm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ machine pvfs2_client_create_sm
state parent_getattr_inspect
{
run create_parent_getattr_inspect;
OSD_POST_CREATE => cleanup;
success => create_setup_msgpair;
default => cleanup;
}
Expand Down Expand Up @@ -140,8 +139,7 @@ machine pvfs2_client_create_sm
{
run create_setattr_setup_msgpair;
OSD_MSGPAIR => create_setattr_xfer_osd_msgpair;
success => create_setattr_xfer_msgpair;
default => cleanup;
default => crdirent_setup_msgpair;
}

state create_setattr_xfer_osd_msgpair
Expand All @@ -151,13 +149,6 @@ machine pvfs2_client_create_sm
default => crdirent_failure;
}

state create_setattr_xfer_msgpair
{
jump pvfs2_msgpairarray_sm;
success => crdirent_setup_msgpair;
default => crdirent_failure;
}

state crdirent_xfer_msgpair
{
jump pvfs2_msgpairarray_sm;
Expand Down Expand Up @@ -738,15 +729,16 @@ static PINT_sm_action create_create_setup_msgpair(
sm_p->u.create.dist;
msg_p->req.u.create.attr.u.meta.dist_size =
PINT_DIST_PACK_SIZE(sm_p->u.create.dist);

msg_p->req.u.create.attr.cid = sm_p->getattr.attr.cid;
sm_p->u.create.attr.cid = sm_p->getattr.attr.cid;

PINT_sm_push_frame(smcb, 0, &sm_p->msgarray_op);
return SM_ACTION_COMPLETE;
}

static PINT_sm_action create_datafiles_setup_msgpair_array(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("create_datafiles_setup_msgpair_array\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
int ret = -PVFS_EINVAL;
struct server_configuration_s *server_config;
Expand Down Expand Up @@ -885,6 +877,9 @@ static PINT_sm_action create_setattr_setup_msgpair(
"create state: setattr_setup_msgpair\n");

js_p->error_code = 0;

if (!is_osd_md && !is_osd_meta)
return SM_ACTION_COMPLETE;

gossip_debug(GOSSIP_CLIENT_DEBUG," create: posting setattr req\n");

Expand Down Expand Up @@ -976,24 +971,24 @@ static PINT_sm_action create_setattr_setup_msgpair(
return 1;
}
} else {
PINT_SERVREQ_SETATTR_FILL(
msg_p->req,
*sm_p->cred_p,
sm_p->object_ref.fs_id,
sm_p->u.create.metafile_handle,
PVFS_TYPE_METAFILE,
sm_p->u.create.attr,
PVFS_ATTR_META_ALL,
sm_p->hints);

msg_p->req.u.setattr.attr.u.meta.dfile_array =
sm_p->u.create.datafile_handles;
msg_p->req.u.setattr.attr.u.meta.dfile_count =
sm_p->u.create.num_data_files;
msg_p->req.u.setattr.attr.u.meta.dist =
sm_p->u.create.dist;
msg_p->req.u.setattr.attr.u.meta.dist_size =
PINT_DIST_PACK_SIZE(sm_p->u.create.dist);
/* PINT_SERVREQ_SETATTR_FILL(*/
/* msg_p->req,*/
/* *sm_p->cred_p,*/
/* sm_p->object_ref.fs_id,*/
/* sm_p->u.create.metafile_handle,*/
/* PVFS_TYPE_METAFILE,*/
/* sm_p->u.create.attr,*/
/* PVFS_ATTR_META_ALL,*/
/* sm_p->hints);*/

/* msg_p->req.u.setattr.attr.u.meta.dfile_array =*/
/* sm_p->u.create.datafile_handles;*/
/* msg_p->req.u.setattr.attr.u.meta.dfile_count =*/
/* sm_p->u.create.num_data_files;*/
/* msg_p->req.u.setattr.attr.u.meta.dist =*/
/* sm_p->u.create.dist;*/
/* msg_p->req.u.setattr.attr.u.meta.dist_size =*/
/* PINT_DIST_PACK_SIZE(sm_p->u.create.dist);*/
}

msg_p->fs_id = sm_p->object_ref.fs_id;
Expand Down Expand Up @@ -1108,6 +1103,7 @@ static PINT_sm_action create_cleanup(
{
metafile_ref.handle = sm_p->u.create.metafile_handle;
metafile_ref.fs_id = sm_p->object_ref.fs_id;
metafile_ref.cid = sm_p->getattr.attr.cid;

/* fill in outgoing response fields */
sm_p->u.create.create_resp->ref = metafile_ref;
Expand Down
6 changes: 2 additions & 4 deletions src/client/sysint/sys-getattr.sm
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ enum
GETATTR_ACACHE_MISS = 1,
GETATTR_NEED_DATAFILE_SIZES = 2,
GETATTR_IO_RETRY = 3,
OSD_MSGPAIR = 2001,
IO_DO_OSD = 2002
OSD_MSGPAIR = 2001
};

/* completion function prototypes */
Expand Down Expand Up @@ -111,7 +110,6 @@ nested machine pvfs2_client_getattr_sm
run getattr_acache_lookup;
GETATTR_ACACHE_MISS => object_getattr_setup_msgpair;
GETATTR_NEED_DATAFILE_SIZES => datafile_get_sizes;
IO_DO_OSD => cleanup;
default => cleanup;
}

Expand Down Expand Up @@ -1451,7 +1449,7 @@ static PINT_sm_action getattr_cleanup(
free(getattr->size_array);

/* cleanup getattr when an error occurs */
if (js_p->error_code && js_p->error_code != IO_DO_OSD)
if (js_p->error_code && js_p->error_code)
{
if (getattr->attr.mask & PVFS_ATTR_META_DFILES)
{
Expand Down
8 changes: 2 additions & 6 deletions src/client/sysint/sys-io.sm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
extern job_context_id pint_client_sm_context;

enum {
IO_DO_OSD_IO = 2001,
IO_OSD_NOT_CREATED = 2002
IO_DO_OSD_IO = 2001
};

enum
Expand Down Expand Up @@ -172,7 +171,6 @@ machine pvfs2_client_io_sm
{
jump pvfs2_client_getattr_sm;
success => inspect_attr;
IO_OSD_NOT_CREATED => osd_io;
default => io_cleanup;
}

Expand Down Expand Up @@ -437,7 +435,6 @@ PVFS_error PVFS_sys_io(
static PINT_sm_action io_init(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("io_init\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
job_id_t tmp_id;

Expand Down Expand Up @@ -483,7 +480,6 @@ static PINT_sm_action io_init(
static PINT_sm_action io_inspect_attr(
struct PINT_smcb *smcb, job_status_s *js_p)
{
gossip_err("io_inspect_attr\n");
struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
int is_osd_meta = fsid_is_osd_meta(sm_p->getattr.object_ref.fs_id);
int is_osd_md = fsid_is_osd_md(sm_p->getattr.object_ref.fs_id);
Expand All @@ -493,7 +489,7 @@ static PINT_sm_action io_inspect_attr(
js_p->error_code = -PVFS_ECANCEL;
return SM_ACTION_COMPLETE;
}

/* determine if we need to unstuff or not to service this request */
js_p->error_code = unstuff_needed(
sm_p->u.io.mem_req,
Expand Down
5 changes: 4 additions & 1 deletion src/client/sysint/sys-mkdir.sm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ enum
MKDIR_RETRY = 180,
MKDIR_SKIP_EATTR = 181,
OSD_MKDIR_MSGPAIR = 2001,
CREATE_COLLECTION = 2002
CREATE_COLLECTION = 2002,
SKIP_COLLECTION_CREATE = 2003
};

static int mkdir_msg_comp_fn(
Expand Down Expand Up @@ -96,6 +97,7 @@ machine pvfs2_client_mkdir_sm
{
run create_collection_setup_msgpair;
success => create_collection_xfer_msgpair;
SKIP_COLLECTION_CREATE => mkdir_seteattr_setup_msgpair;
default => mkdir_crdirent_failure;
}

Expand Down Expand Up @@ -432,6 +434,7 @@ static PINT_sm_action create_collection_setup_msgpair(
js_p->error_code = 0;

if (!is_osd) {
js_p->error_code = SKIP_COLLECTION_CREATE;
return SM_ACTION_COMPLETE;
}

Expand Down
Loading

0 comments on commit d5d9520

Please sign in to comment.