Loading fs/xfs/libxfs/xfs_da_format.c +0 −1 Original line number Diff line number Diff line Loading @@ -270,7 +270,6 @@ xfs_dir3_data_get_ftype( { __uint8_t ftype = dep->name[dep->namelen]; ASSERT(ftype < XFS_DIR3_FT_MAX); if (ftype >= XFS_DIR3_FT_MAX) return XFS_DIR3_FT_UNKNOWN; return ftype; Loading fs/xfs/xfs_bmap_util.c +1 −1 Original line number Diff line number Diff line Loading @@ -1646,7 +1646,7 @@ xfs_swap_extents_check_format( return 0; } int static int xfs_swap_extent_flush( struct xfs_inode *ip) { Loading fs/xfs/xfs_buf_item.c +1 −1 Original line number Diff line number Diff line Loading @@ -501,7 +501,7 @@ xfs_buf_item_unpin( * buffer being bad.. */ DEFINE_RATELIMIT_STATE(xfs_buf_write_fail_rl_state, 30 * HZ, 10); static DEFINE_RATELIMIT_STATE(xfs_buf_write_fail_rl_state, 30 * HZ, 10); STATIC uint xfs_buf_item_push( Loading fs/xfs/xfs_icache.c +0 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ #include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_bmap_util.h" #include "xfs_quota.h" #include "xfs_dquot_item.h" #include "xfs_dquot.h" Loading fs/xfs/xfs_iops.c +30 −0 Original line number Diff line number Diff line Loading @@ -849,6 +849,36 @@ xfs_setattr_size( return error; truncate_setsize(inode, newsize); /* * The "we can't serialise against page faults" pain gets worse. * * If the file is mapped then we have to clean the page at the old EOF * when extending the file. Extending the file can expose changes the * underlying page mapping (e.g. from beyond EOF to a hole or * unwritten), and so on the next attempt to write to that page we need * to remap it for write. i.e. we need .page_mkwrite() to be called. * Hence we need to clean the page to clean the pte and so a new write * fault will be triggered appropriately. * * If we do it before we change the inode size, then we can race with a * page fault that maps the page with exactly the same problem. If we do * it after we change the file size, then a new page fault can come in * and allocate space before we've run the rest of the truncate * transaction. That's kinda grotesque, but it's better than have data * over a hole, and so that's the lesser evil that has been chosen here. * * The real solution, however, is to have some mechanism for locking out * page faults while a truncate is in progress. */ if (newsize > oldsize && mapping_mapped(VFS_I(ip)->i_mapping)) { error = filemap_write_and_wait_range( VFS_I(ip)->i_mapping, round_down(oldsize, PAGE_CACHE_SIZE), round_up(oldsize, PAGE_CACHE_SIZE) - 1); if (error) return error; } tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); if (error) Loading Loading
fs/xfs/libxfs/xfs_da_format.c +0 −1 Original line number Diff line number Diff line Loading @@ -270,7 +270,6 @@ xfs_dir3_data_get_ftype( { __uint8_t ftype = dep->name[dep->namelen]; ASSERT(ftype < XFS_DIR3_FT_MAX); if (ftype >= XFS_DIR3_FT_MAX) return XFS_DIR3_FT_UNKNOWN; return ftype; Loading
fs/xfs/xfs_bmap_util.c +1 −1 Original line number Diff line number Diff line Loading @@ -1646,7 +1646,7 @@ xfs_swap_extents_check_format( return 0; } int static int xfs_swap_extent_flush( struct xfs_inode *ip) { Loading
fs/xfs/xfs_buf_item.c +1 −1 Original line number Diff line number Diff line Loading @@ -501,7 +501,7 @@ xfs_buf_item_unpin( * buffer being bad.. */ DEFINE_RATELIMIT_STATE(xfs_buf_write_fail_rl_state, 30 * HZ, 10); static DEFINE_RATELIMIT_STATE(xfs_buf_write_fail_rl_state, 30 * HZ, 10); STATIC uint xfs_buf_item_push( Loading
fs/xfs/xfs_icache.c +0 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,6 @@ #include "xfs_trace.h" #include "xfs_icache.h" #include "xfs_bmap_util.h" #include "xfs_quota.h" #include "xfs_dquot_item.h" #include "xfs_dquot.h" Loading
fs/xfs/xfs_iops.c +30 −0 Original line number Diff line number Diff line Loading @@ -849,6 +849,36 @@ xfs_setattr_size( return error; truncate_setsize(inode, newsize); /* * The "we can't serialise against page faults" pain gets worse. * * If the file is mapped then we have to clean the page at the old EOF * when extending the file. Extending the file can expose changes the * underlying page mapping (e.g. from beyond EOF to a hole or * unwritten), and so on the next attempt to write to that page we need * to remap it for write. i.e. we need .page_mkwrite() to be called. * Hence we need to clean the page to clean the pte and so a new write * fault will be triggered appropriately. * * If we do it before we change the inode size, then we can race with a * page fault that maps the page with exactly the same problem. If we do * it after we change the file size, then a new page fault can come in * and allocate space before we've run the rest of the truncate * transaction. That's kinda grotesque, but it's better than have data * over a hole, and so that's the lesser evil that has been chosen here. * * The real solution, however, is to have some mechanism for locking out * page faults while a truncate is in progress. */ if (newsize > oldsize && mapping_mapped(VFS_I(ip)->i_mapping)) { error = filemap_write_and_wait_range( VFS_I(ip)->i_mapping, round_down(oldsize, PAGE_CACHE_SIZE), round_up(oldsize, PAGE_CACHE_SIZE) - 1); if (error) return error; } tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_SIZE); error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); if (error) Loading