Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jun 2011 07:09:35 GMT
From:      Will DeVries <william.devries@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/158376: [patch] The UDF file system under counts the number of entries in directories by one.
Message-ID:  <201106280709.p5S79ZJO071010@red.freebsd.org>
Resent-Message-ID: <201106280710.p5S7A9g3086576@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         158376
>Category:       kern
>Synopsis:       [patch] The UDF file system under counts the number of entries in directories by one.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 28 07:10:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Will DeVries
>Release:        9.0-current
>Organization:
>Environment:
9.0-current
>Description:
The UDF file system does not include '.' in the count of items in a directory.  This was not accounted for in the code for vop_getattr.

>How-To-Repeat:
This issue can been seen by mounting a UDF file system and comparing the count given by ls -l for the number of entries in the mount point to the actual number of entries.  (The count will be one less then the actual number of entries.  '.' is excluded from the count.)
>Fix:


Patch attached with submission follows:

--- sys/fs/udf/udf_vnops.c.old	2011-06-27 15:56:54.000000000 -0700
+++ sys/fs/udf/udf_vnops.c	2011-06-27 16:05:51.000000000 -0700
@@ -316,6 +316,9 @@
 	vap->va_ctime = vap->va_mtime; /* XXX Stored as an Extended Attribute */
 	vap->va_rdev = NODEV;
 	if (vp->v_type & VDIR) {
+		/* UDF doesn't include '.' as entry in directories. */
+		vap->va_nlink++;
+
 		/*
 		 * Directories that are recorded within their ICB will show
 		 * as having 0 blocks recorded.  Since tradition dictates


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106280709.p5S79ZJO071010>