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

2014-05-26 Thread Azat Khuzhin
On Wed, May 14, 2014 at 07:48:39AM -0700, Paul Eggert wrote: Pádraig Brady wrote: Also do we always know how much to fallocate? Not if we're using compression on the temporaries, no. I think a patch along these lines could be worthwhile, if it was simple and if it actually worked (the

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

2014-05-26 Thread Paul Eggert
Azat Khuzhin wrote: The current patch only look while files is created, but this is not enough `I agree with you, it must check write(2) and fallback to creating when write(2) will fail with ENOSPC. This is what you mean? Yes. when we have ENOSPC it means that we already won't create any

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

2014-05-14 Thread Azat Khuzhin
On Mon, May 12, 2014 at 12:22:45AM +0100, Pádraig Brady wrote: 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

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

2014-05-14 Thread Pádraig Brady
On 05/14/2014 12:07 PM, Azat Khuzhin wrote: On Mon, May 12, 2014 at 12:22:45AM +0100, Pádraig Brady wrote: 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 ==

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

2014-05-14 Thread Paul Eggert
Pádraig Brady wrote: Also do we always know how much to fallocate? Not if we're using compression on the temporaries, no. I think a patch along these lines could be worthwhile, if it was simple and if it actually worked (the current one doesn't). Something along the following lines, say.

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

2014-05-11 Thread Azat Khuzhin
This can be useful in case you use partitions with different free space on them. It will better to go to the next partition if we don't have space on current one, instead of fail. * src/sort.c (create_temp_file): Go through all available tmp dirs if we got ENOSPC for the first one, and fail on

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

2014-05-11 Thread Paul Eggert
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

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

2014-05-11 Thread Pádraig Brady
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.

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

2014-05-11 Thread Azat Khuzhin
On 12 May 2014 02:26, Paul Eggert egg...@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,