bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17470: [PATCH] sort: rotate on ENOSPC while creating tmp files


From: Pádraig Brady
Subject: bug#17470: [PATCH] sort: rotate on ENOSPC while creating tmp files
Date: Mon, 12 May 2014 00:22:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

tag 17470 wontfix
close 17470
stop

On 05/11/2014 11:25 PM, Paul Eggert 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.
> 
> 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.

Yes I agree.

Now one could use fallocate() where available to preallocate a given amount of 
space,
however allocation management can be done outside of sort(1). As a rule of 
thumb,
if it's possible to implement outside of a particular functional unit, then it
probably should be done outside.

In this case there are various schemes for coalescing multiple storage locations
to a single mount point (mhddfs, lvm, raid, ...), and since these have a more
system wide view, it would be better to avoid implementing similar but limited
logic within sort.

thanks,
Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]