[PATCH v2 0/6] ksmbd: add macOS Time Machine / AAPL SMB2 extension support

"Gaël Blivet-Bailly" <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <[email protected]>
From: Gael Blivet <[email protected]>

Link to v1:
https://lore.kernel.org/linux-cifs/[email protected]/

v2 addresses the CHANGE_NOTIFY CANCEL concern raised on v1:
smb2_cancel() calls each async request's cancel_fn() while holding
conn->request_lock, so cancel_fn must not sleep. Patch 4 now splits
this into inline lock-protected list/state manipulation (matching
every other cancel_fn in this file) plus a workqueue-deferred send of
the actual STATUS_CANCELLED response, which is the one part that
sleeps.

Separately: the corresponding ksmbd-tools userspace patch (aapl_model
field, "time machine"/"aapl model" config options) has been sent to
that project directly, since it's a different repository from this
kernel series.

New since v1: patch 6, AAPL READDIR_ATTR V2 support -- real macOS
clients negotiate V2 over V1 when both are offered, so v1-only left a
gap for current macOS versions.

Also new: patches 1, 3, and 6 are now additionally cross-checked
against Apple's published SMBClient kernel source
(apple-oss-distributions/SMBClient, smb_smb_2.c) -- everything matched
the network-derived understanding v1 was built on, except one
inaccurate assumption in patch 3, now corrected.

Patch 5 also gets a correctness fix: the synthesized ChunkCount=0
full-copy response was reporting ChunksWritten=1/ChunkBytesWritten=
<file size>, describing a chunk the client never actually sent (it
sent zero). Now reports 0/0, matching what's actually been validated
against a real client; only TotalBytesWritten carries a value.

Patches 1-4 are otherwise unchanged in substance from v1, re-derived
against the current tree (this branch has moved since v1).

Gael Blivet (6):
  ksmbd: add Apple AAPL kAAPL_SERVER_QUERY create context support
  ksmbd: synthesize empty AFP_AfpInfo xattr on first probe
  ksmbd: send inline FinderInfo in FIND responses when READDIR_ATTR
    negotiated
  ksmbd: defer CHANGE_NOTIFY completion instead of
    STATUS_NOT_IMPLEMENTED
  ksmbd: implement full-file copy for AAPL ChunkCount=0 COPYCHUNK
  ksmbd: add AAPL READDIR_ATTR V2 support

 fs/smb/common/smb2pdu.h       |   8 +
 fs/smb/common/smbglob.h       |   1 +
 fs/smb/server/connection.h    |   2 +
 fs/smb/server/ksmbd_netlink.h |   4 +-
 fs/smb/server/ksmbd_work.c    |   1 +
 fs/smb/server/ksmbd_work.h    |   2 +
 fs/smb/server/oplock.c        |  85 +++++++
 fs/smb/server/oplock.h        |   2 +
 fs/smb/server/server.h        |   2 +
 fs/smb/server/smb2ops.c       |   4 +
 fs/smb/server/smb2pdu.c       | 442 ++++++++++++++++++++++++++++++++--
 fs/smb/server/smb2pdu.h       |  76 ++++++
 fs/smb/server/transport_ipc.c |   9 +
 fs/smb/server/vfs.c           |  88 +++++++
 fs/smb/server/vfs.h           |   1 +
 fs/smb/server/vfs_cache.c     |  48 ++++
 fs/smb/server/vfs_cache.h     |   6 +
 17 files changed, 758 insertions(+), 23 deletions(-)

-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.