On Wed, Jun 15, 2016 at 7:27 AM, Phil Cameron <pcame...@redhat.com> wrote:

> On 06/15/2016 05:16 AM, Emmanuel Seyman wrote:
>
>> * Ade [15/06/2016 10:14] :
>>
>>> Id be interested in the original rationale behind this change, as I say,
>>> I
>>>
>> I believe the rationale is that there was no sane way to update running
>> applications (firefox, at least, would start not working in interesting
>> ways when you update it after having launched it).
>>
>> Emmanuel
>> --
>> devel mailing list
>> devel@lists.fedoraproject.org
>> https://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org
>>
> I think you misunderstand. A file remains in the system until it is no
> longer needed. The file and its name are two separate things. The name can
> be unlinked from a file and linked to another file ( as is done by update).
> The file remains around until all of it's names are unlinked and no process
> has it open. The reference count is incremented every time the file gets a
> name or is opened by some process. It is decremented every time a name is
> unlinked and every time it is closed. It is quietly deleted when the
> reference count finally goes to zero.
>
> So when you update an application that is running all you do is unlink the
> file name from the old file and link it to the new file. The old file does
> not go away because it is open by the running program. When the program
> exits, the file is deleted (only if the reference count is 0). The next
> time the program is run it will use the new file.


I think you're referring to VFS tracking open files, and assumes the update
process is entirely atomic, i.e. when updating a binary, an entirely new
binary is written to disk rather than overwriting the old one. If the old
one is overwritten then the VFS is going to point to the new one, the old
one is simply gone. I have no idea if dnf/rpm binary updates files
themselves atomically (the entire update process is definitely not atomic)
or if they're overwritten. I'm pretty sure they're overwritten.

-- 
Chris Murphy
--
devel mailing list
devel@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org

Reply via email to