pvfs2-viewdist-filenames.patch:
-----------------------
I don't know if there is any interest in this patch or not, but it adds
some output to pvfs2-viewdist showing the handle number and file name
for each datafile associated with a PVFS2 file. It is useful if you are
trying to debug problems where you suspect that a particular datafile is
corrupt and you need to find it to investigate.
I have found some problems with pvfs2-viewdist, however, that I don't
have any patches for. The issue is that it is using extended attributes
to access the data that it needs. The problem with this approach is
that it is retrieving distribution and handle information by reading it
directly out of the server's collection, bypassing any network encoding.
Since the client doesn't really know how the server wrote this data,
it may not be able to interpret it correctly.
For example, pvfs2-viewdist does not work for me when I use a 32bit
client to look at a file system hosted on 64bit servers. I suspect that
the problem would be more severe if the endian-ness where inverted.
There is an interface for getting the list of handles (properly
en/decoded) with PVFS_mgmt_get_dfile_array() that might work better for
that portion of the utility. I'm not sure about the distribution
information.
At any rate, I have found pvfs2-viewdist to be a handy tool for
debugging, but we might want to think about how it should get the
information that it uses.
-Phil
---------------------
PatchSet 381
Date: 2006/01/18 02:55:11
Author: pcarns
Branch: HEAD
Tag: (none)
Log:
added ability to print handle number and bstream file name for each datafile
associated with the file/distribution
[artf29458]
Members:
src/apps/admin/pvfs2-viewdist.c:1.1->1.2
Index: src/apps/admin/pvfs2-viewdist.c
diff -u src/apps/admin/pvfs2-viewdist.c:1.1 src/apps/admin/pvfs2-viewdist.c:1.2
--- src/apps/admin/pvfs2-viewdist.c:1.1 Wed Jan 4 07:47:56 2006
+++ src/apps/admin/pvfs2-viewdist.c Tue Jan 17 19:55:11 2006
@@ -30,6 +30,7 @@
#include "pvfs2-dist-simple-stripe.h"
#include "pvfs2-dist-varstrip.h"
#include "pint-util.h"
+#include "pvfs2-internal.h"
#ifdef HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
@@ -71,7 +73,7 @@
static int resolve_filename(file_object *obj, char *filename);
static int generic_open(file_object *obj, PVFS_credentials *credentials);
static int generic_server_location(file_object *obj, PVFS_credentials *creds,
- char **servers, int *nservers);
+ char **servers, PVFS_handle *handles, int *nservers);
#ifndef HAVE_ATTR_XATTR_H
/* prototype taken from fgetxattr(2) man page on a FC 4 system */
@@ -123,7 +125,7 @@
* callers job is to free up all the memory
*/
static int generic_server_location(file_object *obj, PVFS_credentials *creds,
- char **servers, int *nservers)
+ char **servers, PVFS_handle *handles, int *nservers)
{
char *buffer = (char *) malloc(4096);
int ret, num_dfiles, count;
@@ -164,6 +166,7 @@
{
PVFS_handle *ptr = (PVFS_handle *) ((char *) buffer + ret * sizeof(PVFS_handle));
servers[ret] = (char *) calloc(1, PVFS_MAX_SERVER_ADDR_LEN);
+ handles[ret] = *ptr;
if (servers[ret] == NULL)
{
break;
@@ -197,6 +200,7 @@
int64_t ret;
PVFS_credentials credentials;
char *servers[256];
+ PVFS_handle handles[256];
int i, nservers = 256;
memset(&dist, 0, sizeof(dist));
@@ -232,7 +236,7 @@
fprintf(stderr, "Could not read distribution information!\n");
goto main_out;
}
- ret = generic_server_location(&src, &credentials, servers, &nservers);
+ ret = generic_server_location(&src, &credentials, servers, handles, &nservers);
if (ret < 0)
{
fprintf(stderr, "Could not read server location information!\n");
@@ -250,7 +254,8 @@
printf("Number of datafiles/servers = %d\n", nservers);
for (i = 0; i < nservers; i++)
{
- printf("Server %d - %s\n", i, servers[i]);
+ printf("Server %d - %s, handle: %llu (%08llx.bstream)\n", i, servers[i],
+ llu(handles[i]), llu(handles[i]));
free(servers[i]);
}
main_out:
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers