From 66fac03fae3af9dded964b01c89662819dbfc5c2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 16 Mar 2017 11:54:29 +0100 Subject: libio: Fix deadlock in location management Perform a context-dependent deferred location release to avoid a deadlock on the file system instance locks, for example during a chdir(). Update #2936. --- testsuites/fstests/fsnofs01/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'testsuites/fstests') diff --git a/testsuites/fstests/fsnofs01/init.c b/testsuites/fstests/fsnofs01/init.c index ff2c2a8075..37ebac1771 100644 --- a/testsuites/fstests/fsnofs01/init.c +++ b/testsuites/fstests/fsnofs01/init.c @@ -74,9 +74,9 @@ static void test_initial_values(void) rtems_test_assert(null_mt->mt_fs_root == null_loc); rtems_test_assert(!null_mt->mounted); rtems_test_assert(!null_mt->writeable); - rtems_test_assert(null_loc->reference_count == 6); + rtems_test_assert(null_loc->reference_count == 4); rtems_test_assert(null_loc->deferred_released_next == NULL); - rtems_test_assert(null_loc->deferred_released_count == 2); + rtems_test_assert(null_loc->deferred_released_count == 0); } static void test_location_obtain(void) @@ -90,7 +90,7 @@ static void test_location_obtain(void) rtems_test_assert(node_count(loc_chain) == 1); rtems_test_assert(null_loc->reference_count == 5); - rtems_filesystem_global_location_release(null_loc); + rtems_filesystem_global_location_release(null_loc, false); rtems_test_assert(node_count(loc_chain) == 1); rtems_test_assert(null_loc->reference_count == 4); @@ -106,7 +106,7 @@ static void test_null_location_obtain(void) rtems_test_assert(node_count(loc_chain) == 1); rtems_test_assert(null_loc->reference_count == 5); - rtems_filesystem_global_location_release(null_loc); + rtems_filesystem_global_location_release(null_loc, false); rtems_test_assert(node_count(loc_chain) == 1); rtems_test_assert(null_loc->reference_count == 4); -- cgit v1.2.3