xfs
[Top] [All Lists]

[Bug 365] New: Truncating a file over NFS+DMAPI hangs client

To: xfs-master@xxxxxxxxxxx
Subject: [Bug 365] New: Truncating a file over NFS+DMAPI hangs client
From: bugzilla-daemon@xxxxxxxxxxx
Date: Thu, 7 Oct 2004 12:48:49 -0700
Sender: linux-xfs-bounce@xxxxxxxxxxx
http://oss.sgi.com/bugzilla/show_bug.cgi?id=365

           Summary: Truncating a file over NFS+DMAPI hangs client
           Product: Linux XFS
           Version: Current
          Platform: IA32
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: dmapi
        AssignedTo: xfs-master@xxxxxxxxxxx
        ReportedBy: mmontour@xxxxxxxxxx


Summary: The problem occurs on a server running the current linux-2.4-xfs CVS
kernel from oss.sgi.com, with a DMAPI-enabled filesystem exported over NFS. Most
operations work as expected for an NFS client, but truncating a file hangs the
client and also does something to the server that later prevents the server from
un-exporting the NFS filesystem.

Detailed steps to reproduce are shown below.
---
On the server,

Create an XFS filesystem:

        mkfs.xfs -f -i size=2048,maxpct=0 /dev/sdb1

Mount it on /test

        dev-fsg-40:~# mount /dev/sdb1 /test -o dmapi,mtpt=/test

Export it over NFS, using /etc/exports line:
         /test   192.168.1.0/24(rw,no_root_squash)

Set up DMAPI handling:
        dm_create_session -i TestSession
        ret=0
        newsid=1

        set_disp -s 1 /test DM_EVENT_TRUNCATE

---
On the client (here SuSE 9.0, kernel 2.4.21-243-athlon, although this has been
observed on other clients including Solaris 8):

Mount the NFS directory:

        mount 192.168.1.2:/test /mnt -o nfsvers=3,udp,hard,intr

Create a file:
        echo "12345" > /mnt/file1

---
On the server, set TRUNCATE events:
        set_region -o 0 -l 0 -s 1 /test/file1 DM_REGION_TRUNCATE
        exactflag is True

---
On the client, try to truncate the file:
        > /mnt/file1

The client hangs at this point, which is expected. 

---
On the server, get the event and respond with "Continue":

        get_events 1
        rlenp is 72
        truncate: token=1 sequence=1
                file handle     ab3011b1efcf4b2d0e000000000000001300000000000000
                offset          0
                length          0

        respond_event 1 1 1 0

---

On the client, the "> /mnt/file1" operation should have completed. However it
is still hung and cannot be interrupted with ctrl-C. 

---

On the server, the file still shows its original length:

        ls -l /test
        total 4
        -rw-r--r--    1 root     root            6 Oct  7 18:34 file1

---
On the client, forcibly unmount the filesystem:
        umount -f /mnt
        umount2: Device or resource busy
        umount: /mnt: Illegal seek
        
        umount -f /mnt

The second "umount -f" completes without error, and /proc/mounts confirms
that the filesystem is unmounted. 

---
On the server, try to shut down the NFS server:
        /etc/init.d/nfs-kernel-server stop
        Stopping NFS kernel daemon: mountd nfsd.
        Unexporting directories for NFS kernel daemon...

The init.d script hangs at this point. 
"cat /proc/fs/nfs/exports" also hangs now. 
I have to do a "/sbin/reboot -f" to restart the server.

-----------
Partial kernel configuration for the server is shown below.

egrep -i "NFS|XFS|DMAPI" .config
CONFIG_DMAPI=y
CONFIG_DMAPI_DEBUG=y
# CONFIG_VXFS_FS is not set
CONFIG_XFS_FS=y
# CONFIG_XFS_POSIX_ACL is not set
# CONFIG_XFS_QUOTA is not set
CONFIG_XFS_DMAPI=y
# CONFIG_XFS_RT is not set
# CONFIG_XFS_TRACE is not set
CONFIG_XFS_DEBUG=y
CONFIG_DMAPI=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_ROOT_NFS is not set
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
# CONFIG_NFSD_TCP is not set
# CONFIG_NCPFS_NFS_NS is not set

Additional debugging information is available on request.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


<Prev in Thread] Current Thread [Next in Thread>
  • [Bug 365] New: Truncating a file over NFS+DMAPI hangs client, bugzilla-daemon <=