----- Original Message -----
...
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.
Qiao,
Another thing I forgot to mention w/respect to simplifying your
patch. You do things like this in a number of places:
@@ -1336,9 +1336,15 @@ 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);
+ if (VALID_STRUCT(mount)) {
+ readmem(*vfsmnt+OFFSET(mount_mnt_devname),
+ KVADDR, &devp, sizeof(void *),
+ "mount mnt_devname", FAULT_ON_ERROR);
+ } else {
+ readmem(*vfsmnt+OFFSET(vfsmount_mnt_devname),
+ KVADDR, &devp, sizeof(void *),
+ "vfsmount mnt_devname",
FAULT_ON_ERROR);
+ }
if (read_string(devp, buf1, BUFSIZE-1)) {
if (strlen(buf1) > devlen)
which could be simplified by a single readmem() call using OFFSET_OPTION():
readmem(*vfsmnt + OFFSET_OPTION(vfsmount_mnt_devname, mount_mnt_devname),
KVADDR, &devp, sizeof(void *), "[vfs]mount mnt_devname", FAULT_ON_ERROR);
If the first (older-kernel) option fails, then the second one is used.
Dave