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

files disappear after being copied from macOS #612

Open
putnam opened this issue May 20, 2024 · 5 comments
Open

files disappear after being copied from macOS #612

putnam opened this issue May 20, 2024 · 5 comments

Comments

@putnam
Copy link

putnam commented May 20, 2024

If I copy a file to a folder from my Mac, the file will seemingly copy and then vanish. I can observe it appearing on the filesystem briefly on the server side, and then something deletes it.

I am on Linux kernel 6.7 on Debian trixie/testing, which seems to be running ksmbd 3.4.2. (Why so old?)

ksmbd.conf:

[global]
        ; global parameters
        guest account = nobody
        map to guest = never
        netbios name = MYHOST

        ; the docs currently say data may get corrupted under race conditions -- TODO look into this
        server multi channel support = no
        server signing = disabled
        server string = MyHost

        ; default share parameters
        create mask = 0664
        directory mask = 0775
        hide dot files = no
        veto files = /._*/.DS_Store/.LSOverride/
        vfs objects = streams_xattr

[Scratch]
  path = /scratch
  comment = Scratch
  writable = yes
  valid users = putnam

I have tried disabling the streams_xattr vfs object and also the veto files directive. The behavior is the same either way. My user account owns the folder being written to. My username on the server is "putnam" and matches the user created with ksmbd.adduser.

I've looked at the Console log on the Mac and haven't seen anything interesting besides it trying to apply some xattr's to the file after it's already gone, which of course raises an error.

The debug output of a session is attached:

ksmbd-macos-copy.txt

@namjaejeon
Copy link
Member

I am on Linux kernel 6.7 on Debian trixie/testing, which seems to be running ksmbd 3.4.2. (Why so old?)

I didn't update ksmbd version in linux mainline. because there is version number of linux kernel. and I have remove versioning on 6.9 kernel. This issue is coming with only MacOS client ? No reproducible with windows client and linux clients ?

@putnam
Copy link
Author

putnam commented May 20, 2024

It seems to work fine on the Windows client.

I did also notice that the test file, when finally written (it seems to sometimes work after several tries which is confusing) is in a strange mode where I cannot read it. Both Mac and Windows tell me I do not have permission. The file is owned properly, can be accessed OK on the host (Linux) and has permissions set OK (664).

@namjaejeon
Copy link
Member

Can you test it after installing github ksmbd ?

git clone https://github.com/cifsd-team/ksmbd

Thanks.

@namjaejeon
Copy link
Member

because 6.7.12 kernel doesn't have this patch. It is related with MacOS client.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/smb/server?h=v6.9&id=5ed11af19e56f0434ce0959376d136005745a936

@namjaejeon
Copy link
Member

I did also notice that the test file, when finally written (it seems to sometimes work after several tries which is confusing) is in a strange mode where I cannot read it. Both Mac and Windows tell me I do not have permission.

If you give me wireshark(or tcpdump) file that captured packets on problem situation to me, I will find the clue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants