GNU bug report logs -
#17470
[PATCH] sort: rotate on ENOSPC while creating tmp files
Previous Next
Reported by: Azat Khuzhin <a3at.mail <at> gmail.com>
Date: Sun, 11 May 2014 20:45:02 UTC
Severity: normal
Tags: patch, wontfix
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 12 May 2014 02:26, "Paul Eggert" <eggert <at> cs.ucla.edu> wrote:
>
> Azat Khuzhin wrote:
>
>> + fd = mkstemp (file);
>> +
>> + if (errno != ENOSPC || temp_dir_index == start_dir_index)
>
>
> This assumes that when mkstemp succeeds then errno != ENOSPC, which is
not necessarily true.
Why that could be, only if there will be an old value?
End even if it is true it will not go to the next iteration because fd >= 0
>
> More generally, it appears that with the patch 'sort' checks whether one
can create a file, but 'sort' will still respond poorly if a write to a
temp file fails due to filesystem space exhaustion.
The only thing that will slow down 'sort' is going through tmp dirs where
there is no enough space, and I personally don't think that this will
meaningful, since most generic use case to use tmp dirs is to sort data
that will not fit into memory and if this sort will fail because of enospc
you must to restart the sort, which can be running for day or weak already,
and this is more expensive.
Or I misunderstood something?
And now I realize that this is not enough, since we only checking on
creation, and unfortunately I didn't check how write(2) handle errors, if
it try to create another file than it will work.
We also could use fallocate here.
Thanks.
Azat.
[Message part 2 (text/html, inline)]
This bug report was last modified 11 years and 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.