Re: [f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-09 Thread Chao Yu
Hi Sheng, On 2018/7/10 9:53, Sheng Yong wrote: > Hi, Chao, > > On 2018/7/9 23:14, Chao Yu wrote: >> On 2018/7/4 17:50, Sheng Yong wrote: >>> If the block device is opened by tools, F2FS should not be mounted. >>> Especially when fsck is running, errors unexpected may happen. So if >>> tools open

Re: [f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-09 Thread Sheng Yong
Hi, Chao, On 2018/7/9 23:14, Chao Yu wrote: On 2018/7/4 17:50, Sheng Yong wrote: If the block device is opened by tools, F2FS should not be mounted. Especially when fsck is running, errors unexpected may happen. So if tools open a block device, we give it the O_EXCL flag to make sure the block

Re: [f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-09 Thread Chao Yu
On 2018/7/4 17:50, Sheng Yong wrote: > If the block device is opened by tools, F2FS should not be mounted. > Especially when fsck is running, errors unexpected may happen. So if > tools open a block device, we give it the O_EXCL flag to make sure > the block device is opened exclusivly. Should we

[f2fs-dev] [PATCH] f2fs-tools: avoid mounting f2fs if tools already open the device

2018-07-04 Thread Sheng Yong
If the block device is opened by tools, F2FS should not be mounted. Especially when fsck is running, errors unexpected may happen. So if tools open a block device, we give it the O_EXCL flag to make sure the block device is opened exclusivly. Signed-off-by: Sheng Yong --- lib/libf2fs.c | 27