[PVFS-developers] chown of root crashes manager

Porter Don PorterDE@mercury.hendrix.edu
Fri, 24 Oct 2003 17:08:18 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C39A7B.548B0E00
Content-Type: text/plain


If you chown the mount point where pvfs is mounted, the .pvfsdir file in the
root directory gets corrupted and the manager crashes.

I think this is caused by the WORKAROUND FOR SUBDIRECTORY PROBLEM in
get_dmeta and put_dmeta.  I am a little unclear on the problem trying to be
worked around here. Would someone explain what this problem is?

I have at least a temporary fix (attached) which checks if you are in "/"
before trying to do your magic.  This seems to prevent the manager from
crashing, but I would like to understand the problem better if possible.

Oh, and this is bug #34 on bugzilla.mcs.anl.gov/pvfs .  I understand that it
would be useful to start logging these things through bugzilla.  

Thanks,
Don Porter


------_=_NextPart_000_01C39A7B.548B0E00
Content-Type: application/octet-stream;
	name="root_chown.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="root_chown.patch"

diff -ur pvfs-1.6.0/mgr/meta/get_dmeta.c =
pvfs-chown/mgr/meta/get_dmeta.c=0A=
--- pvfs-1.6.0/mgr/meta/get_dmeta.c	Fri Oct 25 12:33:05 2002=0A=
+++ pvfs-chown/mgr/meta/get_dmeta.c	Fri Oct 24 16:53:37 2003=0A=
@@ -103,15 +103,17 @@=0A=
 	 * then rewrite the sd_path and the fname and reset the fname=0A=
 	 * pointer.=0A=
 	 */=0A=
-	rd_len =3D strlen(d_p->rd_path)+1;=0A=
-	strcpy(d_p->sd_path, &nbuf[rd_len]);=0A=
-	d_p->fname =3D d_p->sd_path + strlen(d_p->sd_path)+1;=0A=
+	if(strcmp(d_p->sd_path, "/")){ /*only do this if you aren't in =
root*/=0A=
+		rd_len =3D strlen(d_p->rd_path)+1;=0A=
+		strcpy(d_p->sd_path, &nbuf[rd_len]);=0A=
+		d_p->fname =3D d_p->sd_path + strlen(d_p->sd_path)+1;=0A=
 =0A=
-	if (is_dir) {=0A=
-		*d_p->fname =3D '\0';=0A=
-	}=0A=
-	else {=0A=
-		strcpy(d_p->fname, &nbuf[len+1]); /* could check len... */=0A=
+		if (is_dir) {=0A=
+			*d_p->fname =3D '\0';=0A=
+		}=0A=
+		else {=0A=
+			strcpy(d_p->fname, &nbuf[len+1]); /* could check len... */=0A=
+		}=0A=
 	}=0A=
 =0A=
 	/* copy the dmeta structure to the specified location */=0A=
diff -ur pvfs-1.6.0/mgr/meta/put_dmeta.c =
pvfs-chown/mgr/meta/put_dmeta.c=0A=
--- pvfs-1.6.0/mgr/meta/put_dmeta.c	Fri Oct 25 12:33:05 2002=0A=
+++ pvfs-chown/mgr/meta/put_dmeta.c	Fri Oct 24 16:49:44 2003=0A=
@@ -46,7 +46,11 @@=0A=
    strcat(temp, "/.pvfsdir");=0A=
    old_umask =3D umask(0033);=0A=
 =0A=
-	subdir =3D fname + strlen(dir->rd_path) + 1;=0A=
+	if(strcmp(dir->sd_path, "/")){=0A=
+		subdir =3D fname + strlen(dir->rd_path) + 1;=0A=
+	} else {=0A=
+		subdir =3D dir->sd_path;=0A=
+	}=0A=
 =0A=
 	/* should use the dmeta_xxx calls */=0A=
    if ((fp =3D fopen(temp, "w+")) =3D=3D 0) {=0A=

------_=_NextPart_000_01C39A7B.548B0E00--