Preparation for next patches. Signed-off-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> --- fs/fuse/dev.c | 7 +++++++ fs/fuse/fuse_i.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index dd8f019447a9..b393fbedcc1f 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2231,11 +2231,18 @@ void fuse_abort_conn(struct fuse_conn *fc) kill_fasync(&fiq->fasync, SIGIO, POLL_IN); end_polls(fc); wake_up_all(&fc->blocked_waitq); + fc->aborting = true; spin_unlock(&fc->lock); end_requests(fc, &to_end); + + spin_lock(&fc->lock); + fc->aborting = false; + spin_unlock(&fc->lock); + wake_up_all(&fc->blocked_waitq); } else { spin_unlock(&fc->lock); + wait_event(fc->blocked_waitq, !fc->aborting); } } EXPORT_SYMBOL_GPL(fuse_abort_conn); diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 033e30af519f..b5f2265c437c 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -587,6 +587,9 @@ struct fuse_conn { abort and device release */ unsigned connected; + /** Connection abort is in process */ + bool aborting; + /** Connection aborted via sysfs */ bool aborted;