ENTRY;
wobdo = object_update_param_get(update, 0, &size);
- if (wobdo == NULL || size != sizeof(*wobdo)) {
+ if (wobdo == NULL || IS_ERR(wobdo) || size != sizeof(*wobdo)) {
CERROR("%s: obdo is NULL, invalid RPC: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
dof->dof_type = dt_mode_to_dft(attr->la_mode);
if (update->ou_params_count > 1) {
fid = object_update_param_get(update, 1, &size);
- if (fid == NULL || size != sizeof(*fid)) {
+ if (fid == NULL || IS_ERR(fid) || size != sizeof(*fid)) {
CERROR("%s: invalid fid: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
ENTRY;
wobdo = object_update_param_get(update, 0, &size);
- if (wobdo == NULL || size != sizeof(*wobdo)) {
+ if (wobdo == NULL || IS_ERR(wobdo) || size != sizeof(*wobdo)) {
CERROR("%s: empty obdo in the update: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
}
name = object_update_param_get(update, 0, NULL);
- if (name == NULL) {
+ if (name == NULL || IS_ERR(name)) {
CERROR("%s: empty name for xattr get: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
RETURN(-ENOENT);
name = object_update_param_get(update, 0, NULL);
- if (name == NULL) {
+ if (name == NULL || IS_ERR(name)) {
CERROR("%s: empty name for lookup: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
ENTRY;
name = object_update_param_get(update, 0, NULL);
- if (name == NULL) {
+ if (name == NULL || IS_ERR(name)) {
CERROR("%s: empty name for xattr set: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
}
buf = object_update_param_get(update, 1, &buf_len);
- if (buf == NULL || buf_len == 0) {
- CERROR("%s: empty buf for xattr set: rc = %d\n",
- tgt_name(tsi->tsi_tgt), -EPROTO);
+ if (IS_ERR(buf))
RETURN(err_serious(-EPROTO));
- }
lbuf->lb_buf = buf;
lbuf->lb_len = buf_len;
ENTRY;
name = object_update_param_get(update, 0, NULL);
- if (name == NULL) {
+ if (name == NULL || IS_ERR(name)) {
CERROR("%s: empty name for xattr set: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
ENTRY;
name = object_update_param_get(update, 0, NULL);
- if (name == NULL) {
+ if (name == NULL || IS_ERR(name)) {
CERROR("%s: empty name for index insert: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
}
fid = object_update_param_get(update, 1, &size);
- if (fid == NULL || size != sizeof(*fid)) {
+ if (fid == NULL || IS_ERR(fid) || size != sizeof(*fid)) {
CERROR("%s: invalid fid: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
- RETURN(err_serious(-EPROTO));
+ RETURN(err_serious(-EPROTO));
}
if (ptlrpc_req_need_swab(tsi->tsi_pill->rc_req))
}
ptype = object_update_param_get(update, 2, &size);
- if (ptype == NULL || size != sizeof(*ptype)) {
+ if (ptype == NULL || IS_ERR(ptype) || size != sizeof(*ptype)) {
CERROR("%s: invalid type for index insert: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
RETURN(-ENOENT);
name = object_update_param_get(update, 0, NULL);
- if (name == NULL) {
+ if (name == NULL || IS_ERR(name)) {
CERROR("%s: empty name for index delete: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
ENTRY;
buf = object_update_param_get(update, 0, &buf_len);
- if (buf == NULL || buf_len == 0) {
+ if (buf == NULL || IS_ERR(buf) || buf_len == 0) {
CERROR("%s: empty buf for xattr set: rc = %d\n",
tgt_name(tsi->tsi_tgt), -EPROTO);
RETURN(err_serious(-EPROTO));
lbuf->lb_len = buf_len;
tmp = object_update_param_get(update, 1, &size);
- if (tmp == NULL || size != sizeof(*tmp)) {
+ if (tmp == NULL || IS_ERR(tmp) || size != sizeof(*tmp)) {
CERROR("%s: empty or wrong size %zu pos: rc = %d\n",
tgt_name(tsi->tsi_tgt), size, -EPROTO);
RETURN(err_serious(-EPROTO));
setfattr -n user.$(basename $tfile) $DIR/$tfile || error "setfattr"
getfattr -n user.$(basename $tfile) $DIR/$tfile || error "getfattr"
rm $DIR/$tfile || error "rm"
+
+ #normal directory
+ mkdir -p $DIR/$tdir || error "mkdir"
+ setfattr -n user.$(basename $tdir) $DIR/$tdir || error "setfattr dir"
+ getfattr -n user.$(basename $tdir) $DIR/$tdir || error "getfattr dir"
+ setfattr -x user.$(basename $tdir) $DIR/$tdir ||
+ error "$testfile error deleting user.author1"
+ getfattr -d -m user.$(basename $tdir) 2> /dev/null |
+ grep "user.$(basename $tdir)" &&
+ error "$tdir did not delete user.$(basename $tdir)"
+ rmdir $DIR/$tdir || error "rmdir"
+
+ #striped directory
+ test_mkdir -p $DIR/$tdir || error "make striped dir"
+ setfattr -n user.$(basename $tdir) $DIR/$tdir || error "setfattr dir"
+ getfattr -n user.$(basename $tdir) $DIR/$tdir || error "getfattr dir"
+ setfattr -x user.$(basename $tdir) $DIR/$tdir ||
+ error "$testfile error deleting user.author1"
+ getfattr -d -m user.$(basename $tdir) 2> /dev/null |
+ grep "user.$(basename $tdir)" &&
+ error "$tdir did not delete user.$(basename $tdir)"
+ rmdir $DIR/$tdir || error "rm striped dir"
}
run_test 102r "set EAs with empty values"