:\’
for which both of these functions return ‘ERROR_ACCESS_DENIED’
We could call NtCreateFile with 'FILE_OPEN_IF' instead of 'FILE_CREATE' but
since that's an internal function we better always check for existence
ourselves.
Signed-off-by: Ben Wijen
---
winsup/cygwin/dir.cc
When creating a directory which already exists, NtCreateFile will correctly
return 'STATUS_OBJECT_NAME_COLLISION'.
However when creating a directory and all its parents a normal use would
be to start with mkdir(‘/cygdrive/c’) which translates to ‘C:\’ for
which it'll
instead return ‘STATUS_ACCE
Hi Corinna,
Please see the attachment for my patch.
My MUA indeed replaced the tabs with spaces.
I did notice that the indentation was mixed tabs and spaces,
but as stated on the website I have kept the surrounding indentation.
Ben...
On 04-06-2019 09:41, Corinna Vinschen wrote:
Hi Ben,
On
Hi,
After reiterating over my patches, I see this must come after
implementing the 'poor mans cache' commit.
I will reorder in a new patch-set.
Sorry about that.
Ben...
On 15-01-2021 14:45, Ben Wijen wrote:
> Implement _unlink_nt: wich does not depend on patch_conv
> ---
wincap.has_posix_rename_semantics so I didn't bother adding
it.
Ben...
trump speed
> here...
>
> What's your stance?
>
While I could do without:
In an earlier version I had changed remove and missed remove_r.
So, this commit is more about de-duplication rather than speed.
Ben...
e);
- syscall_printf ("%R = remove(%s)", res, ourname);
- return res;
+ return _remove_r (__getreent (), ourname);
}
extern "C" pid_t
Ben...
On 18-01-2021 13:22, Corinna Vinschen via Cygwin-patches wrote:
> On Jan 18 13:11, Ben wrote:
>>
>>
>> On 18-01-2021 11:45, Corinna Vinschen via Cygwin-patches wrote:
>>> Rather than calling NtSetInformationFile here again, we should rather
>>> just skip
On 18-01-2021 12:08, Corinna Vinschen via Cygwin-patches wrote:
> On Jan 15 14:45, Ben Wijen wrote:
>> Move post-dir unlink check from
>> fhandler_disk_file::rmdir to _unlink_nt
>
> Why? It's not much of a problem, codewise, but the commit message
> could be improved
On 18-01-2021 15:49, Corinna Vinschen via Cygwin-patches wrote:
>
> Care to send the resulting patch?
>
Will send with next patch-set.
Ben...
>
> I'm sure, but that code path is called on non-remote ntfs only anyway.
>
Ofcourse, I was thinking about the new _unlink_nt...
On 18-01-2021 13:13, Corinna Vinschen via Cygwin-patches wrote:
>
> Your code is skipping the safety checks and the has_dot_last_component()
> check. The latter implements a check required by POSIX. Skipping
> it introduces an incompatibility, see man 2 rmdir.
>
Yes, I missed has_dot_last_c
On 18-01-2021 12:36, Corinna Vinschen via Cygwin-patches wrote:
> On Jan 15 14:45, Ben Wijen wrote:
>
> Without any code setting the flag, this doesn't seem to make any
> sense. At least the commit message should reflect on the reasons
> for this change.
>
Something
On 18-01-2021 18:07, Ben wrote:
>
> Have I missed something else?
>
Alright, I now see unlink uses isproc_dev and rmdir uses isdev_dev.
Is this correct?
Why are files and directories handled differently?
Anyway, I will add isdev_dev to the new unlink_nt
Ben...
On 26-01-2021 12:46, Corinna Vinschen via Cygwin-patches wrote:
>
> So what about /dev, /proc, etc?
>
The idea was to catch them with pc.isspecial() in unlink_nt.
>> + NTSTATUS status = _unlink_nt (&attr, eflags);
>
> Sorry, but I don't grok that. You already have a path_conv, so what's
> the advantage of calling the unlink version without path_conv and thus,
> without certain check, like the reparse point check, or checks for
> filesystems with quirks, like MVFS? What about remote filesystems of
> which you don't know nothing, e. g., a Win7 NTFS? Did you check the
> error codes in this case?
>
The idea is to - eventually - replace/incorporate the fallback unlink_nt.
But, because I indeed don't know the quirks of all filesystems, I left the
fallback scenario intact, for now.
No, I have not checked all error codes, I simply don't have all filesystems at
my disposal, again the reason for keeping the fallback.
The general idea is to forgo path_conv's filesystem checks and just try to
delete the file,
if it fails, remember and fallback. After these series of commits, some will
follow
to try and see if we can remove/incorporate the fallback scenario completely.
Ben...
On 18-01-2021 12:51, Corinna Vinschen via Cygwin-patches wrote:
> Ok, so hash_prefix reduces the path to a drive letter or the UNC path
> prefix and hashes it. However, what about partitions mounted to a
> subdir of, say, drive C? In that case the hashing goes awry, because
> you're comparing
---
winsup/cygwin/ntdll.h | 3 ++-
winsup/cygwin/syscalls.cc | 20
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index d4f6aaf45..7eee383dd 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -4
The _remove_r code is already in the remove function.
Therefore, just call the remove function and make
sure errno is set correctly in the reent struct.
---
winsup/cygwin/syscalls.cc | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/winsup/cygwin/syscalls.cc b/win
first five patches are trivial,
I would really like some feedback on the last six.
Also, I'd like to state: I provide my patches to
the Cygwin sources under the 2-clause BSD license
Thank you,
Ben Wijen (11):
syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
firs
This is the non-POSIX value returned by Linux since 2.1.132.
---
winsup/cygwin/syscalls.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 227d1a911..043ccdb99 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin
NtQueryInformationFile on fh_ro needs FILE_READ_ATTRIBUTES
to succeed.
---
winsup/cygwin/syscalls.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 0e89b4f44..227d1a911 100644
--- a/winsup/cygwin/syscalls.cc
+++
Move post-dir unlink check from
fhandler_disk_file::rmdir to _unlink_nt
---
winsup/cygwin/fhandler_disk_file.cc | 20
winsup/cygwin/syscalls.cc | 21 +
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/winsup/cygwin/fhandler_disk_fi
The old implementation for __cxa_guard_acquire did not return 1,
therefore dynamic initialization was never performed.
If concurrent-safe dynamic initialisation is ever needed, CXX ABI
must be followed when re-implementing __cxa_guard_acquire (et al.)
---
winsup/cygwin/Makefile.in | 2 +-
winsup
Implement _unlink_nt: wich does not depend on patch_conv
---
winsup/cygwin/fhandler_disk_file.cc | 4 +-
winsup/cygwin/forkable.cc | 4 +-
winsup/cygwin/syscalls.cc | 239 ++--
3 files changed, 228 insertions(+), 19 deletions(-)
diff --git a/winsup/
When file attributes are of no concern,
there is no point to query them.
---
winsup/cygwin/path.cc | 3 +++
winsup/cygwin/path.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index abd3687df..f00707e86 100644
--- a/winsup/cygwin/path.cc
+++ b/
Try to avoid NtQueryVolumeInformationFile.
---
winsup/cygwin/mount.cc | 78 --
winsup/cygwin/mount.h | 2 +-
winsup/cygwin/path.cc | 2 +-
winsup/cygwin/path.h | 1 +
4 files changed, 56 insertions(+), 27 deletions(-)
diff --git a/winsup/cygwin/mount
Not having to query file information improves unlink speed.
---
winsup/cygwin/syscalls.cc | 68 ---
1 file changed, 42 insertions(+), 26 deletions(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 79e4a4422..8aecdf453 100644
--- a/wins
Speedup deletion of directories.
---
winsup/cygwin/dir.cc | 6 ++
1 file changed, 6 insertions(+)
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index f912a9e47..2e7da3638 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -22,6 +22,8 @@ details. */
#include "cygtls.h"
Hi,
I think I got all remarks, please let me know if I missed something.
I'm still thinking on a better way to use fs_info::update cache,
but it requires more testing.
Thank you,
Ben Wijen (8):
syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
syscalls.cc: Dedupl
Implement wincap.has_posix_unlink_semantics_with_ignore_readonly and when set
skip setting/clearing of READONLY attribute and instead use
FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
---
winsup/cygwin/ntdll.h | 3 ++-
winsup/cygwin/syscalls.cc | 14 +-
winsup/cygwin/wincap.cc | 11 +++
The remove code is already in the _remove_r function.
So, just call the _remove_r function.
---
winsup/cygwin/syscalls.cc | 17 -
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 2e50ad7d5..54b065733 100644
-
Move post-dir unlink check from fhandler_disk_file::rmdir to
_unlink_nt_post_dir_check
If a directory is not removed through fhandler_disk_file::rmdir
we can now make sure the post dir check is performed.
---
winsup/cygwin/fhandler_disk_file.cc | 20
winsup/cygwin/syscalls.cc
Implement _unlink_nt: wich does not depend on patch_conv
---
winsup/cygwin/fhandler_disk_file.cc | 4 +-
winsup/cygwin/forkable.cc | 4 +-
winsup/cygwin/syscalls.cc | 211 ++--
3 files changed, 200 insertions(+), 19 deletions(-)
diff --git a/winsup/
When file attributes are of no concern, there is no point to query them.
This can greatly speedup code which doesn't need it.
The idea is to have a shallow path conversion with only minimal information.
The upcoming unlink_nt for example, first tries a path without filesystem
checks, then - if ne
Speedup deletion of directories.
---
winsup/cygwin/dir.cc | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index 7762557d6..470f83aee 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -22,6 +22,8 @@ details.
path_conv already knows the IndexNumber, so just use it.
This commit also fixes the potential handle leak.
---
winsup/cygwin/fhandler_disk_file.cc | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/winsup/cygwin/fhandler_disk_file.cc
b/winsup/cygwin/fha
Not having to query file information improves unlink speed.
---
winsup/cygwin/syscalls.cc | 78 ++-
1 file changed, 52 insertions(+), 26 deletions(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index ab0c4c2d6..b5ab6ac5e 100644
--- a/wins
I think we don't need an extra flag as we can utilize: access &
FILE_WRITE_ATTRIBUTES
What do you think?
Ben Wijen (1):
syscalls.cc: unlink_nt: Try FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE
winsup/cygwin/ntdll.h | 3 ++-
winsup/cygwin/syscalls.cc | 22 +++
wins
The remove code is already in the _remove_r function.
So, just call the _remove_r function.
---
winsup/cygwin/syscalls.cc | 17 -
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 8651cfade..e6ff0fd7a 100644
-
40 matches
Mail list logo