Skip to content

Commit d41a1a3

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: cleanup STOP_IO bitflag set when stop io
There should no difference between setting the CF_IO_STOP flag before restore_callbacks() to do it before or afterwards. The restore_callbacks() will be sure that no callback is executed anymore when the bit wasn't set. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent f8bce79 commit d41a1a3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

fs/dlm/lowcomms.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -735,19 +735,15 @@ static void stop_connection_io(struct connection *con)
735735
if (con->othercon)
736736
stop_connection_io(con->othercon);
737737

738+
spin_lock_bh(&con->writequeue_lock);
739+
set_bit(CF_IO_STOP, &con->flags);
740+
spin_unlock_bh(&con->writequeue_lock);
741+
738742
down_write(&con->sock_lock);
739743
if (con->sock) {
740744
lock_sock(con->sock->sk);
741745
restore_callbacks(con->sock->sk);
742-
743-
spin_lock_bh(&con->writequeue_lock);
744-
set_bit(CF_IO_STOP, &con->flags);
745-
spin_unlock_bh(&con->writequeue_lock);
746746
release_sock(con->sock->sk);
747-
} else {
748-
spin_lock_bh(&con->writequeue_lock);
749-
set_bit(CF_IO_STOP, &con->flags);
750-
spin_unlock_bh(&con->writequeue_lock);
751747
}
752748
up_write(&con->sock_lock);
753749

0 commit comments

Comments
 (0)