Message ID | 4ec8c36a910942be8d6d4745385f3cce@SGPMBX1004.APAC.bosch.com |
---|---|
State | New, archived |
Headers | show |
On Wed 16-03-16 02:30:13, HUANG Weller (CM/ESW12-CN) wrote: > > > > > > > OK, I have something - Huang, can you check whether the attached > > > patches also fix your data exposure issues please? The first patch is > > > the original fix, patch two is a cleanup, patches 3 and 4 implement > > > the speedup suggested by Ted. Patches are only lightly tested so far. > > > I'll run more comprehensive tests later and in particular I want to > > > check whether the additional complexity actually brings us some > > > advantage at least for workloads which redirty pages in addition to > > > writing some new ones using delayed allocation. > > > > OK, there was a bug in patch 3. Attached is a new version of patches 3 and 4. > > > > Patches are applied on my kernel. Basically it is working. > Power loss test is running now. Need some days to give you test result. Thank you! > At same time, Some conflicts need your confirm: The resolution of the conflicts looks good. Honza
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index e48bd5a..03017a9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -751,6 +751,19 @@ has_zeroout: int ret = check_block_validity(inode, map); if (ret != 0) return ret; + + /* + * Inodes with freshly allocated blocks where contents will be + * visible after transaction commit must be on transaction's + * ordered data list. + */ + if (map->m_flags & EXT4_MAP_NEW && + !(map->m_flags & EXT4_MAP_UNWRITTEN) && + ext4_should_order_data(inode)) { + ret = ext4_jbd2_file_inode(handle, inode); + if (ret) + return ret; + } } return retval; }