Re: [PATCH] fix command vm/files -d/mount on new kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 2012-3-13 11:45, qiaonuohan wrote:
At 2012-3-13 3:27, Dave Anderson wrote:


----- Original Message -----
At 2012-3-10 5:50, Dave Anderson wrote:

It's failing in its call to get_pathname(). I haven't had a chance to

You are right. I forgot to check every call to get_pathname. The new
patch has fixed the problem of swap.

Although the patch appears to work in the simple cases that I have
tested,
I have a few issues with it.

First, the get_pathname() function prototype is -- and has always been
-- this:

void get_pathname(ulong dentry, char *pathname, int length, int full,
ulong vfsmnt)

where the "vfsmnt" argument has always been a struct vfsmount pointer.

With your patch, prior to making get_pathname() calls, you typically
make a VALID_STRUCT(mount) call first, and if true, you modify the
vfsmnt argument to be a struct mount pointer.

It would make more sense maintenance-wise, and would simplify the patch,
if the get_pathname() "vfsmnt" argument would continue to be a struct
vfsmount pointer. And at the top of get_pathname(), you could make the
adjustments for when it is embedded inside a struct mount.

For example, taking these patches to open_files_dump() and file_dump():

@@ -2226,12 +2299,16 @@ open_files_dump(ulong task, int flags, struct
reference *ref)
if (VALID_MEMBER(fs_struct_rootmnt)) {
vfsmnt = ULONG(fs_struct_buf +
OFFSET(fs_struct_rootmnt));
+ if (VALID_STRUCT(mount))
+ vfsmnt = vfsmnt - OFFSET(mount_mnt);
get_pathname(root_dentry, root_pathname,
BUFSIZE, 1, vfsmnt);
} else if (use_path) {
vfsmnt = ULONG(fs_struct_buf +
OFFSET(fs_struct_root) +
OFFSET(path_mnt));
+ if (VALID_STRUCT(mount))
+ vfsmnt = vfsmnt - OFFSET(mount_mnt);
get_pathname(root_dentry, root_pathname,
BUFSIZE, 1, vfsmnt);
} else {
@@ -2250,12 +2327,16 @@ open_files_dump(ulong task, int flags, struct
reference *ref)
if (VALID_MEMBER(fs_struct_pwdmnt)) {
vfsmnt = ULONG(fs_struct_buf +
OFFSET(fs_struct_pwdmnt));
+ if (VALID_STRUCT(mount))
+ vfsmnt = vfsmnt - OFFSET(mount_mnt);
get_pathname(pwd_dentry, pwd_pathname,
BUFSIZE, 1, vfsmnt);
} else if (use_path) {
vfsmnt = ULONG(fs_struct_buf +
OFFSET(fs_struct_pwd) +
OFFSET(path_mnt));
+ if (VALID_STRUCT(mount))
+ vfsmnt = vfsmnt - OFFSET(mount_mnt);
get_pathname(pwd_dentry, pwd_pathname,
BUFSIZE, 1, vfsmnt);
@@ -2686,7 +2767,12 @@ file_dump(ulong file, ulong dentry, ulong
inode, int fd, int flags)
if (flags& DUMP_FULL_NAME) {
if (VALID_MEMBER(file_f_vfsmnt)) {
vfsmnt = get_root_vfsmount(file_buf);
- get_pathname(dentry, pathname, BUFSIZE, 1, vfsmnt);
+ if (VALID_STRUCT(mount))
+ get_pathname(dentry, pathname, BUFSIZE, 1,
+ vfsmnt - OFFSET(mount_mnt));
+ else
+ get_pathname(dentry, pathname, BUFSIZE, 1,
+ vfsmnt);
if (STRNEQ(pathname, "/pts/")&&
STREQ(vfsmount_devname(vfsmnt, buf1, BUFSIZE),
"devpts"))

If the vfsmount-to-mount calculation were always done in
get_pathname() itself,
then the patches above would be unnecessary. The same is true for a
few other
parts of the patch.

Did you consider doing it that way?

And consider the following patched version of display_dentry_info()
below.
The two get_pathname() calls below would generate fatal errors on older
kernels because OFFSET(mount_mnt) will be invalid:

if (!found&& symbol_exists("pipe_mnt")) {
get_symbol_data("pipe_mnt", sizeof(long),&vfs);
if (VALID_STRUCT(mount))
readmem(vfs - OFFSET(mount_mnt), KVADDR, mount_buf, SIZE(mount),
"mount buffer", FAULT_ON_ERROR);
else
readmem(vfs, KVADDR, vfsmount_buf, SIZE(vfsmount),
"vfsmount buffer", FAULT_ON_ERROR);
sb = ULONG(vfsmount_buf + OFFSET(vfsmount_mnt_sb));
if (superblock&& (sb == superblock)) {
get_pathname(dentry, pathname, BUFSIZE, 1,
vfs - OFFSET(mount_mnt));
found = TRUE;
}
}
if (!found&& symbol_exists("sock_mnt")) {
get_symbol_data("sock_mnt", sizeof(long),&vfs);
if (VALID_STRUCT(mount))
readmem(vfs - OFFSET(mount_mnt), KVADDR, mount_buf, SIZE(mount),
"mount buffer", FAULT_ON_ERROR);
else
readmem(vfs, KVADDR, vfsmount_buf, SIZE(vfsmount),
"vfsmount buffer", FAULT_ON_ERROR);
sb = ULONG(vfsmount_buf + OFFSET(vfsmount_mnt_sb));
if (superblock&& (sb == superblock)) {
get_pathname(dentry, pathname, BUFSIZE, 1,
vfs - OFFSET(mount_mnt));
found = TRUE;
}
}

If we can continue to have get_pathname() receive a vfsmount pointer,
it reduces the chance of introducing new bugs like the above, and future
maintenance will be easier.

It does reduce complication of the code. Still, places needing the
judgement of struct mount's existing remain. I will modify the patch,
and post later.

About the function, OFFSET_OPTION(), thanks for your advice.


The attachment is the modified patch.


Comments?

Dave

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility






--
--
Regards
Qiao Nuohan
diff --git a/defs.h b/defs.h
index a942dbb..0124f5f 100755
--- a/defs.h
+++ b/defs.h
@@ -1281,6 +1281,11 @@ struct offset_table {                    /* stash of commonly-used offsets */
 	long vfsmount_mnt_list;
 	long vfsmount_mnt_mountpoint;
 	long vfsmount_mnt_parent;
+	long mount_mnt_parent;
+	long mount_mnt_mountpoint;
+	long mount_mnt_list;
+	long mount_mnt_devname;
+	long mount_mnt;
 	long namespace_root;
 	long namespace_list;
 	long super_block_s_dirty;
@@ -1694,6 +1699,7 @@ struct size_table {         /* stash of commonly-used sizes */
 	long fs_struct;
 	long file;
 	long inode;
+	long mount;
 	long vfsmount;
 	long super_block;
         long irqdesc;
diff --git a/filesys.c b/filesys.c
index 55a4677..ddb5377 100755
--- a/filesys.c
+++ b/filesys.c
@@ -1298,7 +1298,7 @@ show_mounts(ulong one_vfsmount, int flags, struct task_context *namespace_contex
 	char buf4[BUFSIZE];
 	ulong *dentry_list, *dp, *mntlist;
 	ulong *vfsmnt;
-	char *vfsmount_buf, *super_block_buf;
+	char *vfsmount_buf, *super_block_buf, *mount_buf;
 	ulong dentry, inode, inode_sb, mnt_parent;
 	char *dentry_buf, *inode_buf;
 	int cnt, i, m, files_header_printed;
@@ -1336,9 +1336,10 @@ show_mounts(ulong one_vfsmount, int flags, struct task_context *namespace_contex
 		devlen = strlen("DEVNAME");
 
         	for (m = 0, vfsmnt = mntlist; m < mount_cnt; m++, vfsmnt++) {
-                	readmem(*vfsmnt + OFFSET(vfsmount_mnt_devname),
-                        	KVADDR, &devp, sizeof(void *),
-                        	"vfsmount mnt_devname", FAULT_ON_ERROR);
+			readmem(*vfsmnt + 
+				OFFSET_OPTION(vfsmount_mnt_devname,mount_mnt_devname),
+				KVADDR, &devp, sizeof(void *),
+				"[vfs]mount mnt_devname", FAULT_ON_ERROR);
 
                 	if (read_string(devp, buf1, BUFSIZE-1)) {
 				if (strlen(buf1) > devlen)
@@ -1366,23 +1367,41 @@ show_mounts(ulong one_vfsmount, int flags, struct task_context *namespace_contex
 			&cnt);
 	}
 
-	vfsmount_buf = GETBUF(SIZE(vfsmount));
+	if (VALID_STRUCT(mount)) {
+		mount_buf = GETBUF(SIZE(mount));
+		vfsmount_buf = mount_buf + OFFSET(mount_mnt);
+	} else {
+		mount_buf = NULL;
+		vfsmount_buf = GETBUF(SIZE(vfsmount));
+	}
 	super_block_buf = GETBUF(SIZE(super_block));
 
 	for (m = 0, vfsmnt = mntlist; m < mount_cnt; m++, vfsmnt++) {
-                readmem(*vfsmnt, KVADDR, vfsmount_buf, SIZE(vfsmount),
-                    	"vfsmount buffer", FAULT_ON_ERROR);
-		
-		devp = ULONG(vfsmount_buf +  OFFSET(vfsmount_mnt_devname));
+		if (VALID_STRUCT(mount)) {
+			readmem(*vfsmnt, KVADDR, mount_buf, SIZE(mount),
+				"mount buffer", FAULT_ON_ERROR);
+			devp = ULONG(mount_buf +  OFFSET(mount_mnt_devname));
+		} else {
+			readmem(*vfsmnt, KVADDR, vfsmount_buf, SIZE(vfsmount),
+				"vfsmount buffer", FAULT_ON_ERROR);
+			devp = ULONG(vfsmount_buf +  OFFSET(vfsmount_mnt_devname));
+		}
 
 		if (VALID_MEMBER(vfsmount_mnt_dirname)) {
 			dirp = ULONG(vfsmount_buf +  
 				OFFSET(vfsmount_mnt_dirname)); 
 		} else {
-			mnt_parent = ULONG(vfsmount_buf + 
-				OFFSET(vfsmount_mnt_parent));
-			dentry = ULONG(vfsmount_buf +  
-				OFFSET(vfsmount_mnt_mountpoint));
+			if (VALID_STRUCT(mount)) {
+				mnt_parent = ULONG(mount_buf + 
+					OFFSET(mount_mnt_parent));
+				dentry = ULONG(mount_buf +  
+					OFFSET(mount_mnt_mountpoint));
+			} else {
+				mnt_parent = ULONG(vfsmount_buf + 
+					OFFSET(vfsmount_mnt_parent));
+				dentry = ULONG(vfsmount_buf +  
+					OFFSET(vfsmount_mnt_mountpoint));
+			}
 		}
 
 		sbp = ULONG(vfsmount_buf + OFFSET(vfsmount_mnt_sb)); 
@@ -1419,7 +1438,8 @@ show_mounts(ulong one_vfsmount, int flags, struct task_context *namespace_contex
                 	else
                         	fprintf(fp, "%-10s\n", "(unknown)");
 		} else {
-			get_pathname(dentry, buf1, BUFSIZE, 1, mnt_parent);
+			get_pathname(dentry, buf1, BUFSIZE, 1, VALID_STRUCT(mount) ?
+				mnt_parent + OFFSET(mount_mnt) : mnt_parent);
                        	fprintf(fp, "%-10s\n", buf1);
 		}
 
@@ -1484,7 +1504,10 @@ show_mounts(ulong one_vfsmount, int flags, struct task_context *namespace_contex
 
 	if (!one_vfsmount)
 		FREEBUF(mntlist); 
-	FREEBUF(vfsmount_buf);
+	if (VALID_STRUCT(mount))
+		FREEBUF(mount_buf);
+	else
+		FREEBUF(vfsmount_buf);
 	FREEBUF(super_block_buf);
 }
 
@@ -1520,7 +1543,7 @@ get_mount_list(int *cntptr, struct task_context *namespace_context)
 			RETURN_ON_ERROR|QUIET))
 			error(FATAL, "cannot determine mount list location!\n");
 
-        	ld->start = root + OFFSET(vfsmount_mnt_list);
+		ld->start = root + OFFSET_OPTION(vfsmount_mnt_list, mount_mnt_list);
         	ld->end = mnt_ns + OFFSET(mnt_namespace_list);
 
 	} else if (VALID_MEMBER(namespace_root)) {
@@ -1538,14 +1561,16 @@ get_mount_list(int *cntptr, struct task_context *namespace_context)
 			console("namespace: %lx => root: %lx\n", 
 				namespace, root);
 
-        	ld->start = root + OFFSET(vfsmount_mnt_list);
+		ld->start = root + OFFSET_OPTION(vfsmount_mnt_list, mount_mnt_list);
         	ld->end = namespace + OFFSET(namespace_list);
 	} else
 		error(FATAL, "cannot determine mount list location!\n");
 	
         if (VALID_MEMBER(vfsmount_mnt_list)) 
                 ld->list_head_offset = OFFSET(vfsmount_mnt_list);
-        else 
+	else if (VALID_STRUCT(mount))
+		ld->list_head_offset = OFFSET(mount_mnt_list);
+	else
                 ld->member_offset = OFFSET(vfsmount_mnt_next);
         
         hq_open();
@@ -1566,7 +1591,7 @@ static void
 display_dentry_info(ulong dentry)
 {
 	int m, found;
-        char *dentry_buf, *inode_buf, *vfsmount_buf;
+        char *dentry_buf, *inode_buf, *vfsmount_buf, *mount_buf;
         ulong inode, superblock, sb, vfs;
 	ulong *mntlist, *vfsmnt;
 	char pathname[BUFSIZE];
@@ -1601,24 +1626,39 @@ display_dentry_info(ulong dentry)
 
         if (VALID_MEMBER(file_f_vfsmnt)) {
 		mntlist = get_mount_list(&mount_cnt, pid_to_context(1));
-        	vfsmount_buf = GETBUF(SIZE(vfsmount));
+		if (VALID_STRUCT(mount)) {
+			mount_buf = GETBUF(SIZE(mount));
+			vfsmount_buf = mount_buf + OFFSET(mount_mnt);
+		} else {
+			mount_buf = NULL;
+			vfsmount_buf = GETBUF(SIZE(vfsmount));
+		}
 
         	for (m = found = 0, vfsmnt = mntlist; 
 		     m < mount_cnt; m++, vfsmnt++) {
-                	readmem(*vfsmnt, KVADDR, vfsmount_buf, SIZE(vfsmount),
-                        	"vfsmount buffer", FAULT_ON_ERROR);
+			if (VALID_STRUCT(mount))
+				readmem(*vfsmnt, KVADDR, mount_buf, SIZE(mount),
+					"mount buffer", FAULT_ON_ERROR);
+			else
+				readmem(*vfsmnt, KVADDR, vfsmount_buf, SIZE(vfsmount),
+					"vfsmount buffer", FAULT_ON_ERROR);
                 	sb = ULONG(vfsmount_buf + OFFSET(vfsmount_mnt_sb));
 			if (superblock && (sb == superblock)) {
-                		get_pathname(dentry, pathname, 
-					BUFSIZE, 1, *vfsmnt);
+                		get_pathname(dentry, pathname, BUFSIZE, 1,
+					VALID_STRUCT(mount) ?
+					*vfsmnt+OFFSET(mount_mnt) : *vfsmnt);
 				found = TRUE;
 			}
 		}
 
 		if (!found && symbol_exists("pipe_mnt")) {
 			get_symbol_data("pipe_mnt", sizeof(long), &vfs);
-                        readmem(vfs, KVADDR, vfsmount_buf, SIZE(vfsmount),
-                                "vfsmount buffer", FAULT_ON_ERROR);
+			if (VALID_STRUCT(mount))
+				readmem(vfs - OFFSET(mount_mnt), KVADDR, mount_buf, SIZE(mount),
+					"mount buffer", FAULT_ON_ERROR);
+			else
+				readmem(vfs, KVADDR, vfsmount_buf, SIZE(vfsmount),
+					"vfsmount buffer", FAULT_ON_ERROR);
                         sb = ULONG(vfsmount_buf + OFFSET(vfsmount_mnt_sb));
                         if (superblock && (sb == superblock)) {
                                 get_pathname(dentry, pathname, BUFSIZE, 1, vfs);
@@ -1627,8 +1667,12 @@ display_dentry_info(ulong dentry)
 		}
 		if (!found && symbol_exists("sock_mnt")) {
 			get_symbol_data("sock_mnt", sizeof(long), &vfs);
-                        readmem(vfs, KVADDR, vfsmount_buf, SIZE(vfsmount),
-                                "vfsmount buffer", FAULT_ON_ERROR);
+			if (VALID_STRUCT(mount))
+				readmem(vfs - OFFSET(mount_mnt), KVADDR, mount_buf, SIZE(mount),
+					"mount buffer", FAULT_ON_ERROR);
+			else
+				readmem(vfs, KVADDR, vfsmount_buf, SIZE(vfsmount),
+					"vfsmount buffer", FAULT_ON_ERROR);
                         sb = ULONG(vfsmount_buf + OFFSET(vfsmount_mnt_sb));
                         if (superblock && (sb == superblock)) {
                                 get_pathname(dentry, pathname, BUFSIZE, 1, vfs);
@@ -1642,7 +1686,10 @@ display_dentry_info(ulong dentry)
 
 	if (mntlist) {
 		FREEBUF(mntlist);
-		FREEBUF(vfsmount_buf);
+		if (VALID_STRUCT(mount))
+			FREEBUF(mount_buf);
+		else
+			FREEBUF(vfsmount_buf);
 	}
 
 nopath:
@@ -1897,12 +1944,26 @@ vfs_init(void)
 
 	MEMBER_OFFSET_INIT(vfsmount_mnt_next, "vfsmount", "mnt_next");
         MEMBER_OFFSET_INIT(vfsmount_mnt_devname, "vfsmount", "mnt_devname");
+	if (INVALID_MEMBER(vfsmount_mnt_devname)) {
+		MEMBER_OFFSET_INIT(mount_mnt_devname, "mount", "mnt_devname");
+	}
         MEMBER_OFFSET_INIT(vfsmount_mnt_dirname, "vfsmount", "mnt_dirname");
         MEMBER_OFFSET_INIT(vfsmount_mnt_sb, "vfsmount", "mnt_sb");
         MEMBER_OFFSET_INIT(vfsmount_mnt_list, "vfsmount", "mnt_list");
+	if (INVALID_MEMBER(vfsmount_mnt_devname)) {
+		MEMBER_OFFSET_INIT(mount_mnt_list, "mount", "mnt_list");
+	}
         MEMBER_OFFSET_INIT(vfsmount_mnt_parent, "vfsmount", "mnt_parent");
+	if (INVALID_MEMBER(vfsmount_mnt_devname)) {
+		MEMBER_OFFSET_INIT(mount_mnt_parent, "mount", "mnt_parent");
+	}
         MEMBER_OFFSET_INIT(vfsmount_mnt_mountpoint, 
 		"vfsmount", "mnt_mountpoint");
+	if (INVALID_MEMBER(vfsmount_mnt_devname)) {
+		MEMBER_OFFSET_INIT(mount_mnt_mountpoint,
+			"mount", "mnt_mountpoint");
+	}
+	MEMBER_OFFSET_INIT(mount_mnt, "mount", "mnt");
 	MEMBER_OFFSET_INIT(namespace_root, "namespace", "root");
 	MEMBER_OFFSET_INIT(task_struct_nsproxy, "task_struct", "nsproxy");
 	if (VALID_MEMBER(namespace_root)) {
@@ -1939,6 +2000,7 @@ vfs_init(void)
 		STRUCT_SIZE_INIT(fdtable, "fdtable");
 	STRUCT_SIZE_INIT(file, "file");
 	STRUCT_SIZE_INIT(inode, "inode");
+	STRUCT_SIZE_INIT(mount, "mount");
 	STRUCT_SIZE_INIT(vfsmount, "vfsmount");
 	STRUCT_SIZE_INIT(fs_struct, "fs_struct");
 	STRUCT_SIZE_INIT(super_block, "super_block");
@@ -2793,13 +2855,24 @@ get_pathname(ulong dentry, char *pathname, int length, int full, ulong vfsmnt)
 	int d_name_len = 0;
 	ulong d_name_name;
 	ulong tmp_vfsmnt, mnt_parent;
-	char *dentry_buf, *vfsmnt_buf;
+	char *dentry_buf, *vfsmnt_buf, *mnt_buf;
 
 	BZERO(buf, BUFSIZE);
 	BZERO(tmpname, BUFSIZE);
 	BZERO(pathname, length);
-	vfsmnt_buf = VALID_MEMBER(vfsmount_mnt_mountpoint) ? 
-		GETBUF(SIZE(vfsmount)) : NULL;
+	if (VALID_STRUCT(mount)) {
+		if (VALID_MEMBER(mount_mnt_mountpoint)) {
+			mnt_buf = GETBUF(SIZE(mount));
+			vfsmnt_buf = mnt_buf + OFFSET(mount_mnt);
+		} else {
+			mnt_buf = NULL;
+			vfsmnt_buf = NULL;
+		}
+	} else {
+		mnt_buf = NULL;
+		vfsmnt_buf = VALID_MEMBER(vfsmount_mnt_mountpoint) ? 
+			GETBUF(SIZE(vfsmount)) : NULL;
+	}
 
 	parent = dentry;
 	tmp_vfsmnt = vfsmnt;
@@ -2861,7 +2934,26 @@ get_pathname(ulong dentry, char *pathname, int length, int full, ulong vfsmnt)
 					else
 						tmp_vfsmnt = mnt_parent;
 				}
-			} else {
+			} else if (VALID_STRUCT(mount)) {
+				if (tmp_vfsmnt) {
+					if (strncmp(pathname, "//", 2) == 0)
+						shift_string_left(pathname, 1);
+                                        readmem(tmp_vfsmnt - OFFSET(mount_mnt),
+						KVADDR, mnt_buf,
+						SIZE(mount), 
+						"mount buffer", 
+						FAULT_ON_ERROR);
+        				parent = ULONG(mnt_buf + 
+					    OFFSET(mount_mnt_mountpoint));
+        				mnt_parent = ULONG(mnt_buf + 
+					    OFFSET(mount_mnt_parent));
+					if ((tmp_vfsmnt - OFFSET(mount_mnt)) == mnt_parent)
+						break;
+					else
+						tmp_vfsmnt = mnt_parent + OFFSET(mount_mnt);
+				}
+			}
+			else {
 				parent = ULONG(dentry_buf + 
 					OFFSET(dentry_d_covers)); 
 			}
@@ -2869,7 +2961,9 @@ get_pathname(ulong dentry, char *pathname, int length, int full, ulong vfsmnt)
 						
 	} while (tmp_dentry != parent && parent);
 
-	if (vfsmnt_buf)
+	if (mnt_buf)
+		FREEBUF(mnt_buf);
+	else if (vfsmnt_buf)
 		FREEBUF(vfsmnt_buf);
 }
 
@@ -3901,10 +3995,17 @@ vfsmount_devname(ulong vfsmnt, char *buf, int maxlen)
 
 	BZERO(buf, maxlen);
 
-	if (!readmem(vfsmnt + OFFSET(vfsmount_mnt_devname),
-	    KVADDR, &devp, sizeof(void *), "vfsmount mnt_devname", 
-	    QUIET|RETURN_ON_ERROR))
-		return buf;
+	if (VALID_STRUCT(mount)) {
+		if (!readmem(vfsmnt - OFFSET(mount_mnt) + OFFSET(mount_mnt_devname),
+		    KVADDR, &devp, sizeof(void *), "mount mnt_devname", 
+		    QUIET|RETURN_ON_ERROR))
+			return buf;
+	} else {
+		if (!readmem(vfsmnt + OFFSET(vfsmount_mnt_devname),
+		    KVADDR, &devp, sizeof(void *), "vfsmount mnt_devname", 
+		    QUIET|RETURN_ON_ERROR))
+			return buf;
+	}
 
 	if (read_string(devp, buf, BUFSIZE-1))
 		return buf;
@@ -3925,10 +4026,17 @@ get_root_vfsmount(char *file_buf)
 		return vfsmnt;
 
 	if (STREQ(buf, "udev")) {
-		if (!readmem(vfsmnt + OFFSET(vfsmount_mnt_parent), KVADDR, 
-	    	    &mnt_parent, sizeof(void *), "vfsmount mnt_parent", 
-	    	    QUIET|RETURN_ON_ERROR))
-			return vfsmnt;
+		if (VALID_STRUCT(mount)) {
+			if (!readmem(vfsmnt - OFFSET(mount_mnt) + OFFSET(mount_mnt_parent), KVADDR, 
+			    &mnt_parent, sizeof(void *), "mount mnt_parent", 
+			    QUIET|RETURN_ON_ERROR))
+				return vfsmnt;
+		} else {
+			if (!readmem(vfsmnt + OFFSET(vfsmount_mnt_parent), KVADDR, 
+			    &mnt_parent, sizeof(void *), "vfsmount mnt_parent", 
+			    QUIET|RETURN_ON_ERROR))
+				return vfsmnt;
+		}
 
 		if (!strlen(vfsmount_devname(mnt_parent, buf, BUFSIZE)))
 			return vfsmnt;
diff --git a/symbols.c b/symbols.c
index f88c016..d141f1b 100755
--- a/symbols.c
+++ b/symbols.c
@@ -7934,6 +7934,16 @@ dump_offset_table(char *spec, ulong makestruct)
 		OFFSET(vfsmount_mnt_mountpoint));
         fprintf(fp, "           vfsmount_mnt_parent: %ld\n", 
 		OFFSET(vfsmount_mnt_parent));
+	fprintf(fp, "              mount_mnt_parent: %ld\n",
+		OFFSET(mount_mnt_parent));
+	fprintf(fp, "          mount_mnt_mountpoint: %ld\n",
+		OFFSET(mount_mnt_mountpoint));
+	fprintf(fp, "                mount_mnt_list: %ld\n",
+		OFFSET(mount_mnt_list));
+	fprintf(fp, "             mount_mnt_devname: %ld\n",
+		OFFSET(mount_mnt_devname));
+	fprintf(fp, "                     mount_mnt: %ld\n",
+		OFFSET(mount_mnt));
 	fprintf(fp, "                namespace_root: %ld\n",
 			OFFSET(namespace_root));
 	fprintf(fp, "                namespace_list: %ld\n",
@@ -8701,6 +8711,7 @@ dump_offset_table(char *spec, ulong makestruct)
 	fprintf(fp, "                          file: %ld\n", SIZE(file)); 
 	fprintf(fp, "                         inode: %ld\n", SIZE(inode)); 
 	fprintf(fp, "                      vfsmount: %ld\n", SIZE(vfsmount)); 
+	fprintf(fp, "                         mount: %ld\n", SIZE(mount));
 	fprintf(fp, "                   super_block: %ld\n", 
 		SIZE(super_block)); 
 	fprintf(fp, "                       irqdesc: %ld\n", SIZE(irqdesc));
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux