Re: [PATCH] fat: issue flush after the writeback of FAT

2019-04-08 Thread OGAWA Hirofumi
Hou Tao writes: > fsync() needs to make sure the data & meta-data of file are persistent > after the return of fsync(), even when a power-failure occurs later. > In the case of fat-fs, the FAT belongs to the meta-data of file, > so we need to issue a flush after the writeback of FAT instead

Re: [PATCH] fat: issue flush after the writeback of FAT

2019-04-08 Thread OGAWA Hirofumi
"Darrick J. Wong" writes: >> +err = __generic_file_fsync(filp, start, end, datasync); >> +if (err) >> +return err; >> >> -res = generic_file_fsync(filp, start, end, datasync); >> err = sync_mapping_buffers(MSDOS_SB(inode->i_sb)->fat_inode->i_mapping); > > Huh. I

Re: [PATCH] fat: issue flush after the writeback of FAT

2019-04-08 Thread Darrick J. Wong
On Tue, Apr 09, 2019 at 11:01:58AM +0800, Hou Tao wrote: > fsync() needs to make sure the data & meta-data of file are persistent > after the return of fsync(), even when a power-failure occurs later. > In the case of fat-fs, the FAT belongs to the meta-data of file, > so we need to issue a flush

[PATCH] fat: issue flush after the writeback of FAT

2019-04-08 Thread Hou Tao
fsync() needs to make sure the data & meta-data of file are persistent after the return of fsync(), even when a power-failure occurs later. In the case of fat-fs, the FAT belongs to the meta-data of file, so we need to issue a flush after the writeback of FAT instead before. Also bail out early