Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2001 04:20:34 -0800 (PST)
From:      Mark Hannon <markhannon@optushome.com.au>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/32668: NFS directory removal problems manifested in portupgrade
Message-ID:  <200112101220.fBACKYT15330@freefall.freebsd.org>

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


>Number:         32668
>Category:       kern
>Synopsis:       NFS directory removal problems manifested in portupgrade
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 10 04:30:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mark Hannon
>Release:        4.4-STABLE (two versions ... see below)
>Organization:
>Environment:
NFS client: 
tbird:~# uname -a
FreeBSD tbird.home.lan 4.4-STABLE FreeBSD 4.4-STABLE #0: Sat Dec  1 22:39:55 EST 2001     mark@tbird.home.lan:/tmp  i386

NFS server:
doorway:~> uname -a
FreeBSD doorway.home.lan 4.4-STABLE FreeBSD 4.4-STABLE #0: Sun Oct  7 12:59:46 EST 2001     mark@tbird-fe1.home.lan:/site/arch/FreeBSD-i386/usr/src/sys/compile/DOORWAY_IPFW  i386

>Description:
I run a NFS distributed /usr/{compat,local,X11R6} as well as /var/db/pkg
and /etc/X11 small network.  Recently I have noticed some problems when
running portupgrade from the NFS client.  Upgrades, package removals
etc. all fail with an error message when attempting to delete the old
pkg database directory.  The error message is directory not empty.

Running the command from the NFS server works fine.

A ktrace looks ok.  The interesting bits are below:

 65158 rm       RET   break 0
 65158 rm       CALL  lstat(0x807d140,0x807d160)
 65158 rm       NAMI  "/var/db/pkg/rmoldmail-0.1.0"
 65158 rm       RET   lstat 0
 65158 rm       CALL  open(0x806bed0,0,0)
 65158 rm       NAMI  "."
 65158 rm       RET   open 3
 65158 rm       CALL  fchdir(0x3)
 65158 rm       RET   fchdir 0
 65158 rm       CALL  access(0x807c000,0x2)
 65158 rm       NAMI  "/var/db/pkg/rmoldmail-0.1.0"
 65158 rm       RET   access 0
 65158 rm       CALL  stat(0x807c000,0xbfbff368)
 65158 rm       NAMI  "/var/db/pkg/rmoldmail-0.1.0"
 65158 rm       RET   stat 0
 65158 rm       CALL  open(0x807c000,0x4,0)
 65158 rm       NAMI  "/var/db/pkg/rmoldmail-0.1.0"
 65158 rm       RET   open 6
 65158 rm       CALL  fstat(0x6,0xbfbff368)
 65158 rm       RET   fstat 0
 65158 rm       CALL  fcntl(0x6,0x2,0x1)
 65158 rm       RET   fcntl 0
 65158 rm       CALL  __sysctl(0xbfbff220,0x2,0x80772f0,0xbfbff21c,0,0)
 65158 rm       RET   __sysctl 0
 65158 rm       CALL  fstatfs(0x6,0xbfbff268)
 65158 rm       RET   fstatfs 0
 65158 rm       CALL  break(0x807f000)
 65158 rm       RET   break 0
 65158 rm       CALL  fstat(0x6,0xbfbff368)
 65158 rm       RET   fstat 0
 65158 rm       CALL  fchdir(0x6)
 65158 rm       RET   fchdir 0
 65158 rm       CALL  getdirentries(0x6,0x807e000,0x1000,0x807a0b4)
 65158 rm       RET   getdirentries 512/0x200
 65158 rm       CALL  lstat(0x807d240,0x807d24c)
 65158 rm       NAMI  "+CONTENTS"
 65158 rm       RET   lstat 0
 65158 rm       CALL  lstat(0x807d340,0x807d348)
 65158 rm       NAMI  "+DESC"
 65158 rm       RET   lstat 0
 65158 rm       CALL  lstat(0x807d440,0x807d44c)
 65158 rm       NAMI  "+COMMENT"
 65158 rm       RET   lstat 0
 65158 rm       CALL  getdirentries(0x6,0x807e000,0x1000,0x807a0b4)
 65158 rm       RET   getdirentries 0
 65158 rm       CALL  lseek(0x6,0,0,0,0)
 65158 rm       RET   lseek 0
 65158 rm       CALL  close(0x6)
 65158 rm       RET   close 0
 65158 rm       CALL  access(0x807d240,0x2)
 65158 rm       NAMI  "+CONTENTS"
 65158 rm       RET   access 0
 65158 rm       CALL  unlink(0x807d240)
 65158 rm       NAMI  "+CONTENTS"
 65158 rm       RET   unlink 0
 65158 rm       CALL  access(0x807d340,0x2)
 65158 rm       NAMI  "+DESC"
 65158 rm       RET   access 0
 65158 rm       CALL  unlink(0x807d340)
 65158 rm       NAMI  "+DESC"
 65158 rm       RET   unlink 0
 65158 rm       CALL  access(0x807d440,0x2)
 65158 rm       NAMI  "+COMMENT"
 65158 rm       RET   access 0
 65158 rm       CALL  unlink(0x807d440)
 65158 rm       NAMI  "+COMMENT"
 65158 rm       RET   unlink 0
 65158 rm       CALL  fchdir(0x3)
 65158 rm       RET   fchdir 0
 65158 rm       CALL  rmdir(0x807c000)
 65158 rm       NAMI  "/var/db/pkg/rmoldmail-0.1.0"
 65158 rm       RET   rmdir -1 errno 66 Directory not empty
 65158 rm       CALL  write(0x2,0xbfbfed80,0x4)
 65158 rm       GIO   fd 2 wrote 4 bytes
       "rm: "
 65158 rm       RET   write 4
 65158 rm       CALL  write(0x2,0xbfbfeda0,0x1b)
 65158 rm       GIO   fd 2 wrote 27 bytes
       "/var/db/pkg/rmoldmail-0.1.0"

My reading of the above says that all of the unlinks succeed but
the directory is not empty anyway ... perhaps a timing bug with 
one of those .nfs files ??

The NFS server has had softupdates both enabled and disabled with no
change in behaviour

>How-To-Repeat:

>Fix:

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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