NetBSD Problem Report #43576

From njoly@lanfeust.sis.pasteur.fr  Tue Jul  6 11:47:03 2010
Return-Path: <njoly@lanfeust.sis.pasteur.fr>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0232263BA9A
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  6 Jul 2010 11:47:02 +0000 (UTC)
Message-Id: <20100706114659.E09ACDC9B9@lanfeust.sis.pasteur.fr>
Date: Tue,  6 Jul 2010 13:46:59 +0200 (CEST)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: pathconf(2) FILESIZEBITS bad value on tmpfs
X-Send-Pr-Version: 3.95

>Number:         43576
>Category:       kern
>Synopsis:       pathconf(2) FILESIZEBITS bad value on tmpfs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rmind
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 06 11:50:00 +0000 2010
>Closed-Date:    Sun May 29 22:47:57 +0000 2011
>Last-Modified:  Sun May 29 22:47:57 +0000 2011
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.34
>Organization:
Institut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 5.99.34 NetBSD 5.99.34 (LANFEUST) #7: Tue Jul 6 12:12:47 CEST 2010 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
pathconf(2) FILESIZEBITS value is incorrect for tmpfs mounts.

njoly@lanfeust [~]> df -h /tmp               
Filesystem        Size       Used      Avail %Cap Mounted on
tmpfs              12G        20K        12G   0% /tmp
njoly@lanfeust [~]> getconf -a /tmp          
LINK_MAX = 32767
NAME_MAX = 255
PATH_MAX = 1024
PIPE_BUF = 512
_POSIX_CHOWN_RESTRICTED = 1
_POSIX_NO_TRUNC = 1
_POSIX_SYNC_IO = 1
FILESIZEBITS = 0

According to the opengroup document, it should be at least 32:

http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html
[...]
{FILESIZEBITS}
    Minimum number of bits needed to represent, as a signed integer value, the maximum size of a regular file allowed in the specified directory.
    Minimum Acceptable Value: 32

>How-To-Repeat:
Use getconf -a on a tmpfs mount
>Fix:

>Release-Note:

>Audit-Trail:
From: "Mindaugas Rasiukevicius" <rmind@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43576 CVS commit: src/sys/fs/tmpfs
Date: Sun, 29 May 2011 22:29:08 +0000

 Module Name:	src
 Committed By:	rmind
 Date:		Sun May 29 22:29:07 UTC 2011

 Modified Files:
 	src/sys/fs/tmpfs: tmpfs.h tmpfs_subr.c tmpfs_vfsops.c tmpfs_vnops.c

 Log Message:
 - Rework and document inode reference counting.  Also document inode life
   cycle (destruction part).  Perform link counting in tmpfs_dir_attach()
   and tmpfs_dir_detach(), instead of alloc/free and arbitrary places.
   Fixes PR/44285, PR/44288, PR/44657 and likely PR/42484.

 - Fix the race between the lookup and inode destruction.  Fixes PR/43167
   and its duplicates PR/40088, PR/40757.

 - Improve tmpfs_rename() locking a little, fix kqueue event notifications
   and also fix PR/43617.  Add simplistic tmpfs_parentcheck_p(); to be
   expanded and used for further rename() locking fixes.

 - Cache directory entry "hint" in the tmpfs node, add tmpfs_dir_cached(),
   and thus avoid unnecessary lookup in tmpfs_remove() and tmpfs_rmdir().

 - Set correct _PC_FILESIZEBITS value in tmpfs_pathconf().  Fixes PR/43576.

 - Few minor fixes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.43 -r1.44 src/sys/fs/tmpfs/tmpfs.h
 cvs rdiff -u -r1.70 -r1.71 src/sys/fs/tmpfs/tmpfs_subr.c
 cvs rdiff -u -r1.50 -r1.51 src/sys/fs/tmpfs/tmpfs_vfsops.c
 cvs rdiff -u -r1.84 -r1.85 src/sys/fs/tmpfs/tmpfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->rmind
Responsible-Changed-By: rmind@NetBSD.org
Responsible-Changed-When: Sun, 29 May 2011 22:47:57 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->closed
State-Changed-By: rmind@NetBSD.org
State-Changed-When: Sun, 29 May 2011 22:47:57 +0000
State-Changed-Why:
Fixed, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.