On 2017-12-12 11:19, John Crispin wrote:
> 
> 
> On 02/12/17 00:26, Roman Yeryomin wrote:
>> Moving a file between tmpfs and other fs is neither
>> faster nor safer, thus no point in doing it in two steps.
>>
>> Signed-off-by: Roman Yeryomin <ro...@advem.lv>
> 
> Hi Roman,
> 
> The code needs to stay like this. the moment you start the command with 
> redirection, the shell will truncate the target file and wont write it 
> until a flush() or close() is called. this would leave a window where 
> the file is 0 bytes. doing this in 2 steps mitigates that problem.
I think Roman has a point that even now it's unsafe and leaves a time
window where the file is incomplete. That said, it's not a good reason
to make this window even bigger. We could easily fix this entirely by
storing the intermediate file in /etc instead of /tmp to ensure that
it's on the same filesystem as the target file.

- Felix

_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to