Date: Wed, 26 Dec 2007 14:09:17 GMT From: Gu xianjie <kevinxlinuz@163.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/119041: lsof not work correctly in zfs Message-ID: <200712261409.lBQE9HQK073435@www.freebsd.org> Resent-Message-ID: <200712261410.lBQEA0CG081996@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 119041 >Category: ports >Synopsis: lsof not work correctly in zfs >Confidential: no >Severity: critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Dec 26 14:10:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Gu xianjie >Release: FreeBSD 7.0-BETA3 >Organization: Netease >Environment: FreeBSD xxx.people.163.org 7.0-BETA3 FreeBSD 7.0-BETA3 #1: Tue Nov 20 14:49:16 CST 2007 root@xxx.people.163.org:/usr/obj/usr/src/sys/G7RN i386 >Description: lsof can't show zfs system's path syslogd 520 root 8r VCHR 0,17 0t22864 17 /dev/klog syslogd 520 root 10w VCHR 0,27 0t0 27 /dev/console syslogd 520 root 11w unknown file system type: zfs syslogd 520 root 12w unknown file system type: zfs syslogd 520 root 13w unknown file system type: zfs syslogd 520 root 14w unknown file system type: zfs syslogd 520 root 15w unknown file system type: zfs syslogd 520 root 16w unknown file system type: zfs syslogd 520 root 17w unknown file system type: zfs syslogd 520 root 18w unknown file system type: zfs syslogd 520 root 19w unknown file system type: zfs syslogd 520 root 20w unknown file system type: zfs >How-To-Repeat: install lsof then run it. >Fix: I made some patchs for lsof.I think it need to be tested.it works well in my system. --- work/lsof_4.79D.freebsd/print.c 2007-10-26 19:22:44.000000000 +0800 +++ work/lsof_4.79D.freebsd/print.c.orig 2007-12-26 21:57:09.513690537 +0800 @@ -2047,8 +2047,10 @@ if (cp1 == (char *)NULL || *(cp1 + 1) != '\0') putchar('/'); } - } else - (void) fputs(" -- ", stdout); + } else + if( (Lf ->inp_ty == 1) || (Lf ->inp_ty == 3)) + putchar('/'); + else (void) fputs(" -- ", stdout); safestrprt(cp, stdout, 0); ps++; goto print_nma; --- work/lsof_4.79D.freebsd/dialects/freebsd/dnode.c 2007-10-26 19:22:46.000000000 +0800 +++ work/lsof_4.79D.freebsd/dialects/freebsd/dnode.c.orig 2007-12-26 21:57:34.574069705 +0800 @@ -227,7 +227,7 @@ char vtbuf[32]; char *vtbp; enum vtagtype { VT_DEVFS, VT_FDESC, VT_ISOFS, VT_PSEUDOFS, VT_NFS, - VT_NULL, VT_UFS, VT_UNKNOWN + VT_NULL, VT_UFS, VT_ZFS, VT_UNKNOWN }; #endif /* FREEBSDV>=5000 */ @@ -407,6 +407,8 @@ vtbp = vtbuf; if (!strcmp(vtbuf, "ufs")) vtag = VT_UFS; + if (!strcmp(vtbuf, "zfs")) + vtag = VT_ZFS; else if (!strcmp(vtbuf, "devfs")) vtag = VT_DEVFS; else if (!strcmp(vtbuf, "nfs")) @@ -600,8 +602,8 @@ } pnp = &pn; break; -#endif /* defined(HASPSEUDOFS) */ - +#endif /* defined(HASPSEUDOFS) */ + case VT_ZFS: case VT_UFS: #if FREEBSDV<2000 >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712261409.lBQE9HQK073435>