Skip to content

Commit

Permalink
xfs: set buf types when converting extent formats
Browse files Browse the repository at this point in the history
Conversion from local to extent format does not set the buffer type
correctly on the new extent buffer when a symlink data is moved out
of line.

Fix the symlink code and leave a comment in the generic bmap code
reminding us that the format-specific data copy needs to set the
destination buffer type appropriately.

cc: <stable@vger.kernel.org> # 3.10 to current
Tested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
  • Loading branch information
Dave Chinner authored and Dave Chinner committed Jan 21, 2015
1 parent f19b872 commit fe22d55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/xfs/libxfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,11 @@ xfs_bmap_local_to_extents(
*firstblock = args.fsbno;
bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0);

/* initialise the block and copy the data */
/*
* Initialise the block and copy the data
*
* Note: init_fn must set the buffer log item type correctly!
*/
init_fn(tp, bp, ip, ifp);

/* account for the change in fork size and log everything */
Expand Down
2 changes: 2 additions & 0 deletions fs/xfs/libxfs/xfs_symlink_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ xfs_symlink_local_to_remote(
struct xfs_mount *mp = ip->i_mount;
char *buf;

xfs_trans_buf_set_type(tp, bp, XFS_BLFT_SYMLINK_BUF);

if (!xfs_sb_version_hascrc(&mp->m_sb)) {
bp->b_ops = NULL;
memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes);
Expand Down

0 comments on commit fe22d55

Please sign in to comment.