Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/psshfs PR/51461: Mateusz Poszwa: Processes hang whe...



details:   https://anonhg.NetBSD.org/src/rev/f4d3bd551359
branches:  trunk
changeset: 817750:f4d3bd551359
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 05 08:53:57 2016 +0000

description:
PR/51461: Mateusz Poszwa: Processes hang when attempting to read from an empty file on psshfs mount, add unit test:

When a process attempts to read from an empty file originating from
psshfs mount, it waits indefinitely. Until the hanged process is
interrupted, the mounted filesystem appears to work as expected,
except for the directory containing the empty file. Processes trying
to list that directory also hang, and cause misbehaviour of the
containing directory.  It is possible to create a chain of hanged
processes trying to read directories up to the mount point. At the
same time, psshfs generates some network traffic (around 5KB/s, in
my case). Interrupting the first hanged process causes emission of
an error message by all other hanged processes, and psshfs ceases
to generate network traffic. Subsequent trials to list any affected
directory or if one of the affected directories is the mount point
to unmount the filesystem, fail with the same error.

diffstat:

 tests/fs/psshfs/t_psshfs.sh |  23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diffs (42 lines):

diff -r 7ee6908c76ad -r f4d3bd551359 tests/fs/psshfs/t_psshfs.sh
--- a/tests/fs/psshfs/t_psshfs.sh       Mon Sep 05 07:23:43 2016 +0000
+++ b/tests/fs/psshfs/t_psshfs.sh       Mon Sep 05 08:53:57 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_psshfs.sh,v 1.7 2013/03/16 07:54:04 jmmv Exp $
+# $NetBSD: t_psshfs.sh,v 1.8 2016/09/05 08:53:57 christos Exp $
 #
 # Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -262,6 +262,26 @@
        stop_ssh
 }
 
+atf_test_case read_empty_file cleanup
+read_empty_file_head() {
+       atf_set "descr" "Checks whether an empty file can be read"
+       # This test is supposed to make sure psshfs does not hang
+       # when reading from an empty file, hence the timeout.
+       atf_set "timeout" 8
+}
+read_empty_file_body() {
+       require_puffs
+       start_ssh
+       atf_check mkdir root mnt
+       atf_check -x ': > root/empty'
+       mount_psshfs root mnt
+       atf_check cat mnt/empty
+}
+read_empty_file_cleanup() {
+       umount mnt
+       stop_ssh
+}
+
 # -------------------------------------------------------------------------
 # Initialization.
 # -------------------------------------------------------------------------
@@ -271,4 +291,5 @@
        atf_add_test_case pwd
        atf_add_test_case ls
        #atf_add_test_case setattr_cache
+       atf_add_test_case read_empty_file
 }



Home | Main Index | Thread Index | Old Index