Re: [OpenWrt-Devel] [RFC] fstools/overlayfs race condition

2016-03-07 Thread John Crispin
On 07/03/2016 14:40, Luiz Angelo Daros de Luca wrote: > > Em seg, 7 de mar de 2016 às 10:10, John Crispin > escreveu: > > > > On 07/03/2016 14:03, Roman Yeryomin wrote: > > There is a race between `cp -a /tmp/root/* /rom/overlay` from

Re: [OpenWrt-Devel] [RFC] fstools/overlayfs race condition

2016-03-07 Thread Luiz Angelo Daros de Luca
Maybe fsfreeze can avoid the race condition. (if this works with the involved FS) http://linux.die.net/man/8/fsfreeze https://github.com/karelzak/util-linux/blob/master/sys-utils/fsfreeze.c Or just temporary remount source fs as ro. It might make some writing process unhappy but I'll keep file

Re: [OpenWrt-Devel] [RFC] fstools/overlayfs race condition

2016-03-07 Thread John Crispin
On 07/03/2016 14:34, Roman Yeryomin wrote: > On 7 March 2016 at 15:09, John Crispin wrote: >> >> >> On 07/03/2016 14:03, Roman Yeryomin wrote: >>> There is a race between `cp -a /tmp/root/* /rom/overlay` from >>> libfstools/overlay.c and a process creating new file(s) before

Re: [OpenWrt-Devel] [RFC] fstools/overlayfs race condition

2016-03-07 Thread Roman Yeryomin
On 7 March 2016 at 15:09, John Crispin wrote: > > > On 07/03/2016 14:03, Roman Yeryomin wrote: >> There is a race between `cp -a /tmp/root/* /rom/overlay` from >> libfstools/overlay.c and a process creating new file(s) before >> pivot(/rom, /mnt) occured. >> That is a process

Re: [OpenWrt-Devel] [RFC] fstools/overlayfs race condition

2016-03-07 Thread John Crispin
On 07/03/2016 14:03, Roman Yeryomin wrote: > There is a race between `cp -a /tmp/root/* /rom/overlay` from > libfstools/overlay.c and a process creating new file(s) before > pivot(/rom, /mnt) occured. > That is a process can create a file and it will not be copied. > > Currently I do additional

[OpenWrt-Devel] [RFC] fstools/overlayfs race condition

2016-03-07 Thread Roman Yeryomin
There is a race between `cp -a /tmp/root/* /rom/overlay` from libfstools/overlay.c and a process creating new file(s) before pivot(/rom, /mnt) occured. That is a process can create a file and it will not be copied. Currently I do additional copy after jffs2 is ready, which is kind of cumbersome