summaryrefslogtreecommitdiff
path: root/fs/dlm
diff options
context:
space:
mode:
authortsutomu.owa@toshiba.co.jp <tsutomu.owa@toshiba.co.jp>2017-09-12 09:01:16 +0000
committerDavid Teigland <teigland@redhat.com>2017-09-25 12:45:21 -0500
commit8a4abb0819769a556f9023845d3821a06f81452d (patch)
treee255458f1d2a4c0f179dc2c1a83113a6b3ac7c89 /fs/dlm
parente412f9201de255a503ae3d67f46aae580c79006c (diff)
downloadlwn-8a4abb0819769a556f9023845d3821a06f81452d.tar.gz
lwn-8a4abb0819769a556f9023845d3821a06f81452d.zip
DLM: Reanimate CF_WRITE_PENDING flag
CF_WRITE_PENDING flag has been reanimated to make dlm_send stop properly when running dlm_lowcomms_stop. Signed-off-by: Tadashi Miyauchi <miyauchi@toshiba-tops.co.jp> Signed-off-by: Tsutomu Owa <tsutomu.owa@toshiba.co.jp> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lowcomms.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index b48640709bbd..306b5fe0866f 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -106,6 +106,7 @@ struct connection {
struct mutex sock_mutex;
unsigned long flags;
#define CF_READ_PENDING 1
+#define CF_WRITE_PENDING 2
#define CF_INIT_PENDING 4
#define CF_IS_OTHERCON 5
#define CF_CLOSE 6
@@ -1599,6 +1600,7 @@ static void process_send_sockets(struct work_struct *work)
{
struct connection *con = container_of(work, struct connection, swork);
+ clear_bit(CF_WRITE_PENDING, &con->flags);
if (con->sock == NULL) /* not mutex protected so check it inside too */
con->connect_action(con);
if (!list_empty(&con->writequeue))
@@ -1642,6 +1644,7 @@ static void _stop_conn(struct connection *con, bool and_other)
{
mutex_lock(&con->sock_mutex);
set_bit(CF_READ_PENDING, &con->flags);
+ set_bit(CF_WRITE_PENDING, &con->flags);
if (con->sock && con->sock->sk)
con->sock->sk->sk_user_data = NULL;
if (con->othercon && and_other)
@@ -1681,9 +1684,13 @@ static void work_flush(void)
hlist_for_each_entry_safe(con, n,
&connection_hash[i], list) {
ok &= test_bit(CF_READ_PENDING, &con->flags);
- if (con->othercon)
+ ok &= test_bit(CF_WRITE_PENDING, &con->flags);
+ if (con->othercon) {
ok &= test_bit(CF_READ_PENDING,
&con->othercon->flags);
+ ok &= test_bit(CF_WRITE_PENDING,
+ &con->othercon->flags);
+ }
}
}
} while (!ok);