Re: [PATCH 0/4] ksmbd: implement Continuously Available (CA) share support

From: Namjae Jeon

Date: Thu Aug 27 2026 - 03:55:40 EST


On Mon, Aug 24, 2026 at 9:56 AM Yunseong Kim <yunseong.kim@xxxxxxxx> wrote:
>
> Enable the Continuously Available (CA) share infrastructure in ksmbd,
> allowing SMB clients to request and use persistent handles on configured shares.
>
> Background
> ==========
>
> KSMBD already has a complete in-memory durable handle v1/v2
> implementation including the persistent handle data model
> (fp->is_persistent), protocol parsing (DH2Q with
> SMB2_DHANDLE_FLAG_PERSISTENT), and reconnect validation (DH2C). However,
> the server never advertises SMB2_GLOBAL_CAP_PERSISTENT_HANDLES or sets
> SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY, making this code path unreachable
> by clients.
>
> Per MS-SMB2, a client can only request a persistent handle on a share
> that advertises SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY. This creates a
> chicken-and-egg: we cannot test persistent handles without first
> advertising the CA capability.
This looks like a useful first step, but I don't think it provides CA
support yet.
The handle state is still kept only in memory. The existing code can
reconnect a durable handle after a connection or session loss while
the server is still running, but that state is lost when ksmbd or the
kernel is restarted. The server therefore can not reconstruct the open
from the persistent-id or CreateGuid.

I think this should be implemented in two stages:
1. Standalone CA: add a local crash-safe journal/state store and
recover the open state after a server restart, including
persistent-handle, lease/oplock, ownership, and replay state.
2. Cluster CA: make the persistent open state available to the node
that takes over the share, then add cluster ownership management,
stale-node fencing, and cross-node failover support.

Standalone CA should be implemented and validated first. Cluster CA,
including cross-node failover, should then be built on top of it.
Until standalone recovery is available, advertising the
persistent-handle and CA capabilities seems premature. It seems that
many updates will be needed to ksmbd-tools when implementing Cluster
CA.

Thanks.