From nobody@FreeBSD.org  Wed Jun 27 17:57:12 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8026C106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Jun 2012 17:57:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C2F58FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Jun 2012 17:57:12 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RHvCKq003759
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 27 Jun 2012 17:57:12 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q5RHvCjA003758;
	Wed, 27 Jun 2012 17:57:12 GMT
	(envelope-from nobody)
Message-Id: <201206271757.q5RHvCjA003758@red.freebsd.org>
Date: Wed, 27 Jun 2012 17:57:12 GMT
From: Steve Wills <swills@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: lp doesn't work on an all ZFS system
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169493
>Category:       bin
>Synopsis:       [lp] lp doesn't work on an all ZFS system
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 27 18:00:30 UTC 2012
>Closed-Date:    Mon Oct 01 15:07:59 UTC 2012
>Last-Modified:  Mon Oct 01 15:07:59 UTC 2012
>Originator:     Steve Wills
>Release:        
>Organization:
>Environment:
>Description:
I setup lpd to print to a remote printer. My system uses all ZFS so the spool directory is on ZFS too. After initially setting it up, lpd runs, but does not print. Also, I get an error from lpq saying "cannot examine spooling area"
>How-To-Repeat:
1. Setup an all ZFS system.

2. Add these lines to /etc/printcap:

lp|hp1320:\
        :sh:\
        :rp=lp:\
        :mx#0:\
        :rm=hp1320:sd=/var/spool/output/hp1320:lf=/var/log/lpd-errs:

3. FInish configuring lpd:

echo 'lpd_enable="YES"' >> /etc/rc.conf
mkdir -p /var/spool/output/hp1320
/etc/rc.d/lpd start

4. Try to print:

lptest | lpr

5. See printing does not happen.

6. Also see error from lpq:

% lpq
lpq: lp: cannot examine spooling area

>Fix:
Work around is to put the spool dir on a UFS file system. Even one backed by md works.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jh 
Responsible-Changed-By: jh 
Responsible-Changed-When: Tue Jul 10 12:57:31 UTC 2012 
Responsible-Changed-Why:  
I am working on this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169493 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/169493: commit references a PR
Date: Tue, 17 Jul 2012 09:35:15 +0000 (UTC)

 Author: jh
 Date: Tue Jul 17 09:34:52 2012
 New Revision: 238547
 URL: http://svn.freebsd.org/changeset/base/238547
 
 Log:
   Make sure that arraysz is initialized to a value larger than zero.
   arraysz could get initialized to zero on ZFS because ZFS reports
   directory sizes differently compared to UFS.
   
   PR:		bin/169493
   Tested by:	swills
   MFC after:	2 weeks
 
 Modified:
   head/usr.sbin/lpr/common_source/common.c
 
 Modified: head/usr.sbin/lpr/common_source/common.c
 ==============================================================================
 --- head/usr.sbin/lpr/common_source/common.c	Tue Jul 17 09:31:05 2012	(r238546)
 +++ head/usr.sbin/lpr/common_source/common.c	Tue Jul 17 09:34:52 2012	(r238547)
 @@ -139,6 +139,8 @@ getq(const struct printer *pp, struct jo
  	 * and dividing it by a multiple of the minimum size entry.
  	 */
  	arraysz = (stbuf.st_size / 24);
 +	if (arraysz < 16)
 +		arraysz = 16;
  	queue = (struct jobqueue **)malloc(arraysz * sizeof(struct jobqueue *));
  	if (queue == NULL)
  		goto errdone;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: jh 
State-Changed-When: Tue Jul 17 09:50:00 UTC 2012 
State-Changed-Why:  
Patched in head (r238547). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169493 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/169493: commit references a PR
Date: Mon, 10 Sep 2012 16:29:08 +0000 (UTC)

 Author: jh
 Date: Mon Sep 10 16:28:45 2012
 New Revision: 240322
 URL: http://svn.freebsd.org/changeset/base/240322
 
 Log:
   MFC r238547:
   
   Make sure that arraysz is initialized to a value larger than zero.
   arraysz could get initialized to zero on ZFS because ZFS reports
   directory sizes differently compared to UFS.
   
   PR:		bin/169493
 
 Modified:
   stable/9/usr.sbin/lpr/common_source/common.c
 Directory Properties:
   stable/9/usr.sbin/lpr/   (props changed)
   stable/9/usr.sbin/lpr/filters/   (props changed)
   stable/9/usr.sbin/lpr/lpd/   (props changed)
 
 Modified: stable/9/usr.sbin/lpr/common_source/common.c
 ==============================================================================
 --- stable/9/usr.sbin/lpr/common_source/common.c	Mon Sep 10 16:27:19 2012	(r240321)
 +++ stable/9/usr.sbin/lpr/common_source/common.c	Mon Sep 10 16:28:45 2012	(r240322)
 @@ -139,6 +139,8 @@ getq(const struct printer *pp, struct jo
  	 * and dividing it by a multiple of the minimum size entry.
  	 */
  	arraysz = (stbuf.st_size / 24);
 +	if (arraysz < 16)
 +		arraysz = 16;
  	queue = (struct jobqueue **)malloc(arraysz * sizeof(struct jobqueue *));
  	if (queue == NULL)
  		goto errdone;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/169493: commit references a PR
Date: Mon,  1 Oct 2012 14:55:34 +0000 (UTC)

 Author: jh
 Date: Mon Oct  1 14:55:22 2012
 New Revision: 241099
 URL: http://svn.freebsd.org/changeset/base/241099
 
 Log:
   MFC r238547:
   
   Make sure that arraysz is initialized to a value larger than zero.
   arraysz could get initialized to zero on ZFS because ZFS reports
   directory sizes differently compared to UFS.
   
   PR:		bin/169493
 
 Modified:
   stable/8/usr.sbin/lpr/common_source/common.c
 Directory Properties:
   stable/8/usr.sbin/lpr/   (props changed)
   stable/8/usr.sbin/lpr/lpd/   (props changed)
 
 Modified: stable/8/usr.sbin/lpr/common_source/common.c
 ==============================================================================
 --- stable/8/usr.sbin/lpr/common_source/common.c	Mon Oct  1 14:52:34 2012	(r241098)
 +++ stable/8/usr.sbin/lpr/common_source/common.c	Mon Oct  1 14:55:22 2012	(r241099)
 @@ -139,6 +139,8 @@ getq(const struct printer *pp, struct jo
  	 * and dividing it by a multiple of the minimum size entry.
  	 */
  	arraysz = (stbuf.st_size / 24);
 +	if (arraysz < 16)
 +		arraysz = 16;
  	queue = (struct jobqueue **)malloc(arraysz * sizeof(struct jobqueue *));
  	if (queue == NULL)
  		goto errdone;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: jh 
State-Changed-When: Mon Oct 1 15:07:58 UTC 2012 
State-Changed-Why:  
Fixed in head, stable/9 and stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169493 
>Unformatted:
