Re: [PATCH v4 08/11] cifs: Send witness register messages to userspace daemon in echo task

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tentatively merged into cifs-2.6.git for-next. Let me know if any
changes need to be made to it

On Mon, Nov 30, 2020 at 12:06 PM Samuel Cabrero <scabrero@xxxxxxx> wrote:
>
> If the daemon starts after mounting a share, or if it crashes, this
> provides a mechanism to register again.
>
> Signed-off-by: Samuel Cabrero <scabrero@xxxxxxx>
> ---
>  fs/cifs/cifs_swn.c | 15 +++++++++++++++
>  fs/cifs/cifs_swn.h |  2 ++
>  fs/cifs/connect.c  |  5 +++++
>  3 files changed, 22 insertions(+)
>
> 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);
> +}
> diff --git a/fs/cifs/cifs_swn.h b/fs/cifs/cifs_swn.h
> index 13b25cdc9295..236ecd4959d5 100644
> --- a/fs/cifs/cifs_swn.h
> +++ b/fs/cifs/cifs_swn.h
> @@ -20,4 +20,6 @@ extern int cifs_swn_notify(struct sk_buff *skb, struct genl_info *info);
>
>  extern void cifs_swn_dump(struct seq_file *m);
>
> +extern void cifs_swn_check(void);
> +
>  #endif /* _CIFS_SWN_H */
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 7fbb201b42c3..a298518bebb2 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -613,6 +613,11 @@ cifs_echo_request(struct work_struct *work)
>                 cifs_dbg(FYI, "Unable to send echo request to server: %s\n",
>                          server->hostname);
>
> +#ifdef CONFIG_CIFS_SWN_UPCALL
> +       /* Check witness registrations */
> +       cifs_swn_check();
> +#endif
> +
>  requeue_echo:
>         queue_delayed_work(cifsiod_wq, &server->echo, server->echo_interval);
>  }
> --
> 2.29.2
>


-- 
Thanks,

Steve



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux