From 21077c62e178e637e6291c669d2681c9570f7a08 Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Mon, 30 Nov 2020 19:02:54 +0100 Subject: cifs: Send witness register messages to userspace daemon in echo task If the daemon starts after mounting a share, or if it crashes, this provides a mechanism to register again. Signed-off-by: Samuel Cabrero Reviewed-by: Aurelien Aptel Signed-off-by: Steve French --- fs/cifs/cifs_swn.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fs/cifs/cifs_swn.c') diff --git a/fs/cifs/cifs_swn.c b/fs/cifs/cifs_swn.c index 140a53a19aa0..642c9eedc8ab 100644 --- a/fs/cifs/cifs_swn.c +++ b/fs/cifs/cifs_swn.c @@ -540,3 +540,18 @@ void cifs_swn_dump(struct seq_file *m) mutex_unlock(&cifs_swnreg_idr_mutex); seq_puts(m, "\n"); } + +void cifs_swn_check(void) +{ + struct cifs_swn_reg *swnreg; + int id; + int ret; + + mutex_lock(&cifs_swnreg_idr_mutex); + idr_for_each_entry(&cifs_swnreg_idr, swnreg, id) { + ret = cifs_swn_send_register_message(swnreg); + if (ret < 0) + cifs_dbg(FYI, "%s: Failed to send register message: %d\n", __func__, ret); + } + mutex_unlock(&cifs_swnreg_idr_mutex); +} -- cgit v1.2.3