Skip to content

lib/fs: use file clone ioctl wrappers and types from golang.org/x/sys/unix - #7000

Merged
calmh merged 2 commits into
syncthing:mainfrom
tklauser:ioctl-clone-x-sys-unix
Sep 24, 2020
Merged

calmh merged 2 commits into
syncthing:mainfrom
tklauser:ioctl-clone-x-sys-unix

Conversation

@tklauser

@tklauser tklauser commented Sep 23, 2020 •

Copy link
Copy Markdown
Contributor

Purpose

Use the IoctlFileClone and IoctlFileCloneRange ioctl wrappers and the
FileCloneRange type provided by golang.org/x/sys/unix instead of
locally implementing them. This also allows to re-enable the code for
ppc/ppc64/ppc64le again (see commit 758a1a6 ("lib/fs: Disable ioctl
on ppc (fixes #6898) (#6901)")) since golang.org/x/sys/unix internally
uses the correct FICLONE and FICLONERANGE values depending on $GOARCH.

This PR also bumps the version of golang.org/x/sys

Testing

Ran unit tests in lib/fs using go test -v ./lib/fs

@tklauser tklauser changed the title Use file clone ioctl wrappers and types from golang.org/x/sys/unix lib/fs: use file clone ioctl wrappers and types from golang.org/x/sys/unix Sep 23, 2020
Updated by running `go get golang.org/x/sys@latest && go mod tidy`
@tklauser
tklauser force-pushed the ioctl-clone-x-sys-unix branch 2 times, most recently from 8b374f8 to 2691c8f Compare September 23, 2020 08:42
calmh
calmh previously approved these changes Sep 23, 2020
@AudriusButkevicius

Copy link
Copy Markdown
Member

I'll have a look this evening

Comment thread lib/fs/basicfs_copy_range_ioctl.go Resolved
Comment thread lib/fs/basicfs_copy_range_ioctl.go Resolved
…/unix

Use the IoctlFileClone and IoctlFileCloneRange ioctl wrappers and the
FileCloneRange type provided by golang.org/x/sys/unix instead of
locally implementing them. This also allows to re-enable the code for
ppc/ppc64/ppc64le again (see commit 758a1a6 ("lib/fs: Disable ioctl
on ppc (fixes syncthing#6898) (syncthing#6901)")) since golang.org/x/sys/unix internally
uses the correct FICLONE and FICLONERANGE values depending on $GOARCH.
@calmh
calmh merged commit c390565 into syncthing:main Sep 24, 2020
@tklauser
tklauser deleted the ioctl-clone-x-sys-unix branch September 24, 2020 08:39
@calmh calmh added this to the v1.10.1 milestone Sep 28, 2020
calmh added a commit to calmh/syncthing that referenced this pull request Sep 29, 2020
* main:
  lib/fs: Add COM0 and LPT0 to invalid Windows file names (ref syncthing#7008) (syncthing#7013)
  lib/fs: Be even more strict about Windows names (ref syncthing#7008) (syncthing#7012)
  lib/fs: Be more clear about invalid file names (ref syncthing#7010) (syncthing#7011)
  lib/model: Disallow reserved names, and names ending with period on Windows (fixes syncthing#7008) (syncthing#7010)
  lib/model, lib/scanner: Prevent races aborting scans (fixes syncthing#6994) (syncthing#6997)
  lib/fs: Use file clone ioctl wrappers and types from golang.org/x/sys/unix (syncthing#7000)
  Update config.yml
  gui, man, authors: Update docs, translations, and contributors
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Sep 25, 2021
@syncthing syncthing locked and limited conversation to collaborators Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests in TestCopyRange fail on ppc64le with "inappropriate ioctl for device"

4 participants