-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol… #2253
Conversation
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.
Thank you so much.
I added a couple of suggestions how to get this production-ready, and I think we're really, really close to having a solution. Great work, @naatje80!
compat/mingw.c
Outdated
return errno = err_win_to_posix(GetLastError()), -1; | ||
|
||
if (handle == INVALID_HANDLE_VALUE) { | ||
|
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.
Please lose the extra empty line.
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.
Sure
compat/mingw.c
Outdated
|
||
DWORD err = GetLastError(); | ||
|
||
// Some network storage solutions (e.g. Isilon) might return ERROR_INVALID_PARAMETER |
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.
In Git's source code, there are only /* ... */
style comments, not C++/C99 ones. Please change this comment accordingly.
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 indeed should have used the same style that was already used in the existing code
@@ -661,8 +661,18 @@ static int mingw_open_append(wchar_t const *wfilename, int oflags, ...) | |||
handle = CreateFileW(wfilename, FILE_APPEND_DATA, |
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.
The commit message needs a little bit of work... Just imagine that you yourself stumble over this commit in six months from now, not remembering what you did, but wanting to figure it out.
To that end, the Git project tries to enforce very informative commit messages, in a somewhat idiomatic form.
In particular, the commit message should focus a bit more on the "Why?" and to a lesser extent the "What?" than the "How?".
In this case, I would strongly suggest something along those lines:
mingw: cope with the Isilon network file system
On certain network filesystems (*cough* Isilon), when the directory in
question is missing, `raceproof_create_file()` fails with an
`ERROR_INVALID_PARAMETER` instead of an `ERROR_PATH_NOT_FOUND`.
Since it is highly unlikely that we produce such an error by mistake
(the parameters we pass are fairly benign), we can be relatively certain
that the directory is missing in this instance. So let's just translate
that error automagically.
This fixes https://github.com/git-for-windows/git/issues/1345.
Signed-off-by: ...
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 will reuse most of your example, if you are fine by that. I do not what to re-invent the wheel as we say in Dutch :). I personally only work on small scale projects, but I fully understand the more verbose commit.
The requested changes should have been pushed. |
Could you please squash the two commits into one, using the second commits' message? The easiest will be using Thank you! |
Done |
Would you kindly use your real name in the Signed-off-by: line? It is required by the Git project, and I won't be able to upstream this patch without it. Thanks. |
I admire your patience with me. Done again. |
On certain network filesystems (currently encounterd with Isilon, but in theory more network storage solutions could be causing the same issue), when the directory in question is missing, `raceproof_create_file()` fails with an `ERROR_INVALID_PARAMETER` instead of an `ERROR_PATH_NOT_FOUND`. Since it is highly unlikely that we produce such an error by mistake (the parameters we pass are fairly benign), we can be relatively certain that the directory is missing in this instance. So let's just translate that error automagically. This fixes #1345. Signed-off-by: Nathan Sanders <spekbukkem@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
May I return the compliment? You analyzed this really well, and I have seen few Git for Windows contributors with your amount of grit.
Thank you. I amended this with my Sign-off after aligning the white-space, and will merge now. Thanks so much! |
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Resolving ERROR_INVALID_PARAMETER issue with some network storage sol…
Fix for unexpected error (ERROR_INVALID_PARAMETER) instead of ERROR_PATH_NOT_FOUND on certain network storage during creation of files for which the full path does not exist yet.