forkables: About hardlink creation and NTFS transaction in rename()

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Nov 28 09:48:00 GMT 2016


On Nov 25 15:03, Michael Haubenwallner wrote:
> On 11/21/2016 04:19 PM, Michael Haubenwallner wrote:
> > Hi Corinna,
> > 
> > now working with the cygfork patches (hardlinks to retain forkability
> > beyond exe/dll update): when creating the forkable hardlink using the
> > earlier opened file handle I may get STATUS_TRANSACTION_NOT_ACTIVE.
> > 
> > It turns out that when loaded 'some.dll' was readonly, then
> > rename("new/some.dll", "some.dll") uses an NTFS-transaction to drop
> > the readonly attribute, breaking the subsequent hardlink creation
> > of "/var/run/cygfork/.../soname.dll" via the original file handle.
> 
> I've been wrong here about the readonly flag:
> The transaction is started in rename() where the initial
> NtSetInformationFile (Rename) returns STATUS_ACCESS_DENIED,
> simply because the target "some.dll" is in use.

No, wait.  If the DLL is in use, the return code should be
STATUS_SHARING_VIOLATION.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20161128/ba9099bb/attachment.sig>


More information about the Cygwin-developers mailing list