Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacific: cephfs: Add ceph-dokan, providing Windows support #40069

Merged
merged 8 commits into from Mar 25, 2021

Conversation

petrutlucian94
Copy link
Contributor

backport tracker: https://tracker.ceph.com/issues/49634


backport of #38819
parent tracker: https://tracker.ceph.com/issues/49623

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/master/src/script/ceph-backport.sh

cephfs will use fake inodes when sizeof(ino_t) < 8. On Windows,
ino_t is defined as unsigned short (2B), which isn't enough.

On the other hand, most "native" Windows structures, including the
Dokan ones, are using 64b identifiers.

That being considered, we'll disable inode emulation on Windows.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 618a340)
We're adding a new libcephfs function: ceph_may_delete. It checks
if the mount permissions allow deleting a file or directory, without
actually deleting it.

This will allow us to drop the redundant permission checks at
ceph-dokan level, saving about 1500 LOC.

Note that the "DeleteFile" Dokan callback expects us to say if a
delete operation is allowed. The "Cleanup" callback is supposed
to perform the actual file or directory deletion.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 439add6)
In order to expose ceph filesystems to Windows hosts, we propose
including ceph-dokan[1][2] in the Ceph tree, while updating it to
work with the latest CephFS and Dokany APIs.

Dokany is a well maintained project (fork of the original Dokan
project), allowing filesystems to be implemented in userspace,
even providing a Fuse compatibility layer.

One reason for not using the FUSE compatibility layer is that it's
only covering the high level API while Ceph is using the low level
FUSE API, which among other things is inode centric.

Changes made by this patch compared to the upstream ceph-dokan:

* support latest stable Dokany API. The upstream version relies on
  the legacy unmaintained Dokan API
* return proper error codes, converting standard errno.h values to
  NTSTATUS
* minor changes to support latest cephfs API
* drop duplicated ceph code, no longer needed if we're to include it
  in tree. This makes it much easier to maintain.
* drop redundant permission checks, leaving it up to libcephfs
* use ceph argparse helpers
* use ceph logging and daemon initialization
* fixed unicode handling
* switched to ceph coding style
* made ceph.conf param optional, using the default path if available
* enabled setting file timestamps
* append support
* configurable timeouts set once per mount
* ensure that the error code is always logged
* various cleanups (removed unused entry points, checks that have
  been moved to dokany, simplified conditional statements,
  unnecessary conversions in the hot path, etc).

[1] https://github.com/ketor/ceph-dokan
[2] https://github.com/ceph/ceph-dokan

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit af6b373)
This change documents ceph-dokan, describing the prerequisites,
usage and limitations.

Some of this was mentioned in README.windows.rst but is now being
moved to the Ceph doc pages.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit eaa415f)
@petrutlucian94
Copy link
Contributor Author

I've also included https://tracker.ceph.com/issues/49608 #39354 since we're using those error codes here.

Please let me know if those should be two separate PRs.

petrutlucian94 and others added 3 commits March 17, 2021 07:09
In order to avoid overcomplicating the ceph cmake files, we're
picking make targets individually.

This is quite inefficient. Ninja can improve the build concurrency,
reducing the build duration by almost 50%.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit fca903f)
Replace system errno macros with cephfs aliases

Fixes: https://tracker.ceph.com/issues/48802
Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit 7e7d9e4)
Most of the Windows documentation is currently included in the
README.windows.rst file.

To make it more accessible, we're moving most of it to the
"doc/" folder, adding the following pages:

* Installing Ceph on Windows
* RBD on Windows
* Windows troubleshooting

We'll keep the build and manual install instructions in
README.windows.rst. Note that ceph-dokan already has a separate
doc page.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 76a38a6)
Instead of having a direct download link, we'll point to the
download page, which will eventually contain other MSI versions as
well (e.g. Quincy).

While at it, we're simplifying the document a bit, dropping
information that's also included in the manual install guide.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
@dillaman
Copy link

Includes backport of #40114 and #40177

@yuriw yuriw merged commit bab615d into ceph:pacific Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants