- 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 back story, the sys_remove() function will
try to do some rather complicated recovery if it fails to remove an
object after it has already removed the directory entry, and it isn't
really working right in this case. This patch changes things so that if
it hits an ENOENT when removing an object, the remove will just complete
and return the error code, bypassing the recovery steps. I think this
is the right behavior; there is no point in recovering a file that was
already incomplete at the time that you tried to remove it. So on the
command line you will see this message from pvfs2-rm:
[pca...@pcarns-laptop admin]$ ./pvfs2-rm /mnt/pvfs2/b.dat
Error: An error occurred while removing /mnt/pvfs2/b.dat
PVFS_sys_remove: No such file or directory (error class: 0)
But the end result is a sane directory:
[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)
-rw-r--r-- 1 pcarns pcarns 16.0M 2010-10-11 10:53 a.dat
-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
-Phil
diff -Naupr pvfs2_src/src/client/sysint/sys-remove.sm pvfs2_src_buildfix/src/client/sysint/sys-remove.sm
--- pvfs2_src/src/client/sysint/sys-remove.sm 2008-01-31 12:53:45.000000000 -0500
+++ pvfs2_src_buildfix/src/client/sysint/sys-remove.sm 2010-10-11 11:25:47.000000000 -0400
@@ -409,6 +409,8 @@ static int remove_check_error_code(
break;
case -PVFS_EINVAL:
case -PVFS_ENOMEM:
+ /* the object(s) are already gone in the ENOENT case */
+ case -PVFS_ENOENT:
/* don't undo after these errors */
sm_p->u.remove.stored_error_code = js_p->error_code;
js_p->error_code = RETURN_STORED_ERROR_CODE;
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers