On Wed, Aug 10, 2011 at 02:58:07PM -0500, Jonathan Nieder wrote:
> Niko Tyni wrote:
> 
> > Looks like dpkg tries to sync /usr/bin/perl5.12.4.dpkg-new when a hard
> > link has already been renamed to /usr/bin/perl and presumably gotten
> > executed by someone else.

> Does this help?

> +  * Open extracted files for reading, not writing, in order to fsync() them.
> +    Otherwise the open can error out when preparing to rename a binary into
> +    place that has a hard link already in use. Regression introduced in
> +    1.15.6.1. Closes: #635683

Yes, it seems to help.

I can reproduce the issue reliably with dpkg 1.16.0.3 and
perl-base_5.12.4-4_amd64.deb from current sid by doing

 inotifywait /usr/bin/perl; for i in $(seq 1 200); do perl -e sleep &; done

and then unpacking the .deb in another shell.

With a patched dpkg, the error is completely gone.

However, are sync_file_range() and fsync() effective with an O_RDONLY
file descriptor? From fsync(2):

       EBADF  fd is not a valid file descriptor open for writing.

but https://bugzilla.kernel.org/show_bug.cgi?id=29972 suggests this is
misleading...
-- 
Niko Tyni   [email protected]



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to