Commit cb8fb432 authored by Nathan Scott's avatar Nathan Scott Committed by Nathan Scott

[XFS] Fix a blocksize-smaller-than-pagesize hang when writing buffers

with a shared page.

SGI Modid: xfs-linux:xfs-kern:176412a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 1a1a99df
...@@ -1522,9 +1522,12 @@ xfs_mapping_buftarg( ...@@ -1522,9 +1522,12 @@ xfs_mapping_buftarg(
xfs_buftarg_t *btp, xfs_buftarg_t *btp,
struct block_device *bdev) struct block_device *bdev)
{ {
struct backing_dev_info *bdi;
struct inode *inode; struct inode *inode;
struct address_space *mapping; struct address_space *mapping;
struct backing_dev_info *bdi; static struct address_space_operations mapping_aops = {
.sync_page = block_sync_page,
};
inode = new_inode(bdev->bd_inode->i_sb); inode = new_inode(bdev->bd_inode->i_sb);
if (!inode) { if (!inode) {
...@@ -1536,10 +1539,11 @@ xfs_mapping_buftarg( ...@@ -1536,10 +1539,11 @@ xfs_mapping_buftarg(
inode->i_mode = S_IFBLK; inode->i_mode = S_IFBLK;
inode->i_bdev = bdev; inode->i_bdev = bdev;
inode->i_rdev = bdev->bd_dev; inode->i_rdev = bdev->bd_dev;
mapping = &inode->i_data;
bdi = blk_get_backing_dev_info(bdev); bdi = blk_get_backing_dev_info(bdev);
if (!bdi) if (!bdi)
bdi = &default_backing_dev_info; bdi = &default_backing_dev_info;
mapping = &inode->i_data;
mapping->a_ops = &mapping_aops;
mapping->backing_dev_info = bdi; mapping->backing_dev_info = bdi;
mapping_set_gfp_mask(mapping, GFP_KERNEL); mapping_set_gfp_mask(mapping, GFP_KERNEL);
btp->pbr_mapping = mapping; btp->pbr_mapping = mapping;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment