On 10/11/2010 11:42 AM, Phil Carns wrote:
- how to make pvfs2-rm safely remove what it can (even if via a
"force" option)
- how to get pvfs2-lsplus (and probably other utilities and/or
kernel module as well) to report a sane error message instead of the
"Invalid object" message
The attached patch fixes the first problem (assuming I'm looking at
the right scenario). For some
... and this attached patch fixes the second problem. If I do an lsplus
with it on a broken file I now see this:
[pca...@pcarns-laptop admin]$ ./pvfs2-lsplus -alh /mnt/pvfs2/
drwxrwxrwx 1 pcarns pcarns 4.0K 2010-10-11 11:34 .
drwxrwxrwx 1 pcarns pcarns 4.0K 2010-10-11 11:34 .. (faked)
a.dat: could not retrieve attributes: No such file or directory
-rw-r--r-- 1 pcarns pcarns 16.0M 2010-10-11 10:53 c.dat
-rw-r--r-- 1 pcarns pcarns 16.0M 2010-10-11 10:53 d.dat
drwxrwxrwx 1 pcarns pcarns 4.0K 2010-10-11 10:52 lost+found
That "<entry>: could not retrieve attributes: <error>" line of output
isn't the prettiest thing in the world, but at least it shows the
directory entry and an appropriate error message for it :) Feel free to
adjust pvfs2-lsplus.c appropriately if we need a different format there
that looks more like /bin/ls.
The problems in this path were shared by both the client and the server,
but to make a long story short it wasn't propagating errors out
correctly for individual attributes in a list-attr response.
I have no idea what subset of these problems are relevant to the current
code base. The list-attr server state machine has since been rewritten
using nested state machines, and pvfs2-lsplus has gone away (and its
logic folded into pvfs2-ls instead). Can someone try out the example
from earlier in the email thread on trunk or 2.8 to see what happens?
We just need to create a file, remove the metadata object out from under
it, and then try pvfs2-ls -alh on the directory and pvfs2-rm on the file
to see what happens...
thanks,
-Phil
diff -Naupr pvfs2_src_almost/src/apps/admin/pvfs2-lsplus.c pvfs2_src_buildfix/src/apps/admin/pvfs2-lsplus.c
--- pvfs2_src_almost/src/apps/admin/pvfs2-lsplus.c 2009-07-22 12:48:34.000000000 -0400
+++ pvfs2_src_buildfix/src/apps/admin/pvfs2-lsplus.c 2010-10-11 12:48:04.000000000 -0400
@@ -460,6 +460,12 @@ void print_entry(
print_entry_attr(handle, entry_name, attr, opts, entry_buffer);
}
}
+ else
+ {
+ char err_string[128];
+ PVFS_strerror_r(attr_error, err_string, 128);
+ printf("%s: could not retrieve attributes: %s\n", entry_name, err_string);
+ }
}
static double Wtime(void)
diff -Naupr pvfs2_src_almost/src/io/trove/trove-dbpf/dbpf-dspace.c pvfs2_src_buildfix/src/io/trove/trove-dbpf/dbpf-dspace.c
--- pvfs2_src_almost/src/io/trove/trove-dbpf/dbpf-dspace.c 2010-10-11 12:49:39.000000000 -0400
+++ pvfs2_src_buildfix/src/io/trove/trove-dbpf/dbpf-dspace.c 2010-10-11 12:26:47.000000000 -0400
@@ -1281,8 +1281,11 @@ static int dbpf_dspace_getattr_list_op_s
NULL, &key, &data, 0);
if (ret != 0)
{
- op_p->coll_p->ds_db->err(op_p->coll_p->ds_db, ret, "DB->get");
- op_p->u.d_getattr_list.error_p[i] = -TROVE_EIO;
+ if(ret != DB_NOTFOUND)
+ {
+ op_p->coll_p->ds_db->err(op_p->coll_p->ds_db, ret, "DB->get");
+ }
+ op_p->u.d_getattr_list.error_p[i] = -dbpf_db_error_to_trove_error(ret);
continue;
}
diff -Naupr pvfs2_src_almost/src/server/list-attr.sm pvfs2_src_buildfix/src/server/list-attr.sm
--- pvfs2_src_almost/src/server/list-attr.sm 2009-08-11 13:13:24.000000000 -0400
+++ pvfs2_src_buildfix/src/server/list-attr.sm 2010-10-11 12:40:49.000000000 -0400
@@ -171,10 +171,16 @@ static int listattr_verify_attribs(
ds_attr = &s_op->u.listattr.ds_attr_a[s_op->u.listattr.handle_index];
handle = &s_op->u.listattr.handles[s_op->u.listattr.handle_index];
ds_error = &s_op->u.listattr.errors[s_op->u.listattr.handle_index];
+ *resp_error = *ds_error;
+ /* don't bother copying attributes around if we got an error on this one */
+ if(*resp_error != 0)
+ {
+ return 1;
+ }
+
PVFS_ds_attr_to_object_attr(ds_attr, obj_attr);
obj_attr->mask = PVFS_ATTR_COMMON_ALL;
- *resp_error = *ds_error;
resp_attr->owner = obj_attr->owner;
resp_attr->group = obj_attr->group;
resp_attr->perms = obj_attr->perms;
@@ -577,6 +583,14 @@ static int listattr_setup_resp(PINT_serv
resp_attr = &s_op->resp.u.listattr.attr[s_op->u.listattr.handle_index++];
s_op->u.listattr.nhandles--;
+ if(*resp_error != 0)
+ {
+ /* we've already hit an error on this handle; do not try to retrieve
+ * additional information
+ */
+ js_p->error_code = s_op->u.listattr.nhandles == 0 ? 0 : MORE_WORK;
+ return 1;
+ }
gossip_debug(
GOSSIP_LISTATTR_DEBUG,
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers