[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] tla: file descriptor leak, causes panic when removing t
From: |
Sergio Gelato |
Subject: |
[Gnu-arch-users] tla: file descriptor leak, causes panic when removing temporary directory |
Date: |
Tue, 31 Mar 2009 18:31:39 +0200 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Package: tla
Version: 1.3.5+dfsg-14
Tags: patch
When computing a changeset (e.g. for the "tla changes --diffs" command), tla
creates a temporary directory with a name that begins in ,,what-changed.
This directory is cleaned up at the end of the operation.
Symbolic links are compared by writing the target of the link into a
text file under that directory, then relying on usual "diff" behaviour.
Unfortunately, tla doesn't explicitly close this text file. As a result:
(1) it uses more file descriptors than necessary;
(2) on some filesystems (e.g., OpenAFS 1.4.8 and newer) tla dies with
an I/O panic as the rmdir() operation on the parent directory fails with
ENOTEMPTY, even though the unlink() of the file itself succeeded, because
the file is still open.
The attached patch has been tested and gets rid of symptom (2). I expect
it to help with (1) as well. The variables that hold the file descriptor
numbers go out of scope shortly afterwards.
07-changeset-fd-leak.dpatch
Description: Text document
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnu-arch-users] tla: file descriptor leak, causes panic when removing temporary directory,
Sergio Gelato <=