f2fs: cover f2fs_lock_op in expand_inode_data case
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: cover f2fs_lock_op in expand_inode_data case
We were missing to cover f2fs_lock_op in this case.
Signed-off-by Jaegeuk Kim <[email protected]>
--- fs/f2fs/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/f2fs/file.c +4 -1
@@ -1646,12 +1646,13 @@ static int expand_inode_data(struct inode *inode, loff_t offset,if (err && err != -ENODATA && err != -EAGAIN ) goto out_err; } - +f2fs_lock_op (sbi);down_write (&sbi->pin_sem); map.m_seg_type =CURSEG_COLD_DATA_PINNED ;f2fs_allocate_new_segments (sbi,CURSEG_COLD_DATA ); err =f2fs_map_blocks (inode, &map,1 ,F2FS_GET_BLOCK_PRE_DIO );up_write (&sbi->pin_sem); +f2fs_unlock_op (sbi); done += map.m_len; len -= map.m_len;
@@ -1661,7 +1662,9 @@ static int expand_inode_data(struct inode *inode, loff_t offset, map.m_len = done; }else { +f2fs_lock_op (sbi); err =f2fs_map_blocks (inode, &map,1 ,F2FS_GET_BLOCK_PRE_AIO ); +f2fs_unlock_op (sbi); } out_err:if (err) {
Signature · 1 line
2.24.0.525.g8f36a354ae-goog
Quoted 3 lines · Jaegeuk Kim
We were missing to cover
f2fs_lock_opin this case.Signed-off-by Jaegeuk Kim <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
Quoted 1 line · Jaegeuk Kim
We were missing to cover
f2fs_lock_opin this case.
Jaegeuk,
generic/269 will hang with this patch, and also bugzilla reports android with last code will hang with the same stack.
Could you check this patch?
Thanks,
Quoted 36 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/file.c +4
-1@@ -1646,12 +1646,13 @@ static int expand_inode_data(struct inode *inode, loff_t offset,if (err && err != -ENODATA && err != -EAGAIN ) goto out_err; } - +f2fs_lock_op (sbi);down_write (&sbi->pin_sem); map.m_seg_type =CURSEG_COLD_DATA_PINNED ;f2fs_allocate_new_segments (sbi,CURSEG_COLD_DATA ); err =f2fs_map_blocks (inode, &map,1 ,F2FS_GET_BLOCK_PRE_DIO );up_write (&sbi->pin_sem); +f2fs_unlock_op (sbi); done += map.m_len; len -= map.m_len;@@ -1661,7 +1662,9 @@ static int expand_inode_data(struct inode *inode, loff_t offset, map.m_len = done; }else { +f2fs_lock_op (sbi); err =f2fs_map_blocks (inode, &map,1 ,F2FS_GET_BLOCK_PRE_AIO ); +f2fs_unlock_op (sbi); } out_err:if (err) {