-
Notifications
You must be signed in to change notification settings - Fork 43
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
mountinfo: GetMountsFromReader() remove workaround for kernel < 3.10 #83
base: main
Are you sure you want to change the base?
Conversation
mountinfo/mountinfo_linux_test.go
Outdated
@@ -504,66 +499,6 @@ func TestParseFedoraMountinfoFilterFields(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestParseMountinfoWithSpaces(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how removing this test is relevant to this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reiterate the comment above -- this test case is NOT about pre-3.10 bug of having extra spaces in a cifs mount entry where share name has spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah ^^^ (or do we have other tests where we test fields with spaces)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test case is NOT about pre-3.10 bug of having extra spaces in a cifs mount entry where share name has spaces.
Oh! Right, only the second entry is about the unc=<path with spaces>
issue; the others are escaped
IIUC from the comment, kernel 3.10-rc1 should ignore that unc
option, so I can just remove that part.
Do we know of other ways for spaces to get into the last column, or should 3.10-rc1 and up guarantee there not to be?
(or do we have other tests where we test fields with spaces)?
@kolyshkin hm.. not sure if we have; I'll add back this test, but update it to only remove the unc=
bits.
8832f96
to
955e12d
Compare
We should probably do this once Go < 1.23 (which raises the Linux kernel requirement to >= 3.16 or so) is no longer supported. |
955e12d
to
ea3f2d8
Compare
In Linux <= 3.9 mounting a cifs with spaces in a share name (like "//srv/My Docs") _may_ end up having a space in the last field of mountinfo (like "unc=//serv/My Docs"). Since kernel 3.10-rc1, cifs option "unc=" is ignored, so spaces should not appear. Given that all major distros are now on at least kernel 3.10, and (e.g.) docker has not supported older kernel versions for 5 Years [1], it should be save to remove this special handling. [1]: moby/moby@51b23d8 Signed-off-by: Sebastiaan van Stijn <[email protected]>
ea3f2d8
to
1456f0a
Compare
Slightly wondering if we need to wait for that; Kernel 3.9 (or older) means;
|
follow-up to #81
In Linux <= 3.9 mounting a cifs with spaces in a share name (like "//srv/My Docs")
may end up having a space in the last field of mountinfo (like "unc=//serv/My Docs").
Since kernel 3.10-rc1, cifs option "unc=" is ignored, so spaces should not appear.
Given that all major distros are now on at least kernel 3.10, and (e.g.) docker
has not supported older kernel versions for 5 Years 1, it should be save to
remove this special handling.