diff options
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index e00121592632..d01745f748ac 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -261,7 +261,7 @@ xfs_file_aio_read( | |||
261 | xfs_buftarg_t *target = | 261 | xfs_buftarg_t *target = |
262 | XFS_IS_REALTIME_INODE(ip) ? | 262 | XFS_IS_REALTIME_INODE(ip) ? |
263 | mp->m_rtdev_targp : mp->m_ddev_targp; | 263 | mp->m_rtdev_targp : mp->m_ddev_targp; |
264 | if ((pos & target->bt_smask) || (size & target->bt_smask)) { | 264 | if ((pos | size) & target->bt_meta_sectormask) { |
265 | if (pos == i_size_read(inode)) | 265 | if (pos == i_size_read(inode)) |
266 | return 0; | 266 | return 0; |
267 | return -XFS_ERROR(EINVAL); | 267 | return -XFS_ERROR(EINVAL); |
@@ -641,7 +641,7 @@ xfs_file_dio_aio_write( | |||
641 | struct xfs_buftarg *target = XFS_IS_REALTIME_INODE(ip) ? | 641 | struct xfs_buftarg *target = XFS_IS_REALTIME_INODE(ip) ? |
642 | mp->m_rtdev_targp : mp->m_ddev_targp; | 642 | mp->m_rtdev_targp : mp->m_ddev_targp; |
643 | 643 | ||
644 | if ((pos & target->bt_smask) || (count & target->bt_smask)) | 644 | if ((pos | count) & target->bt_meta_sectormask) |
645 | return -XFS_ERROR(EINVAL); | 645 | return -XFS_ERROR(EINVAL); |
646 | 646 | ||
647 | if ((pos & mp->m_blockmask) || ((pos + count) & mp->m_blockmask)) | 647 | if ((pos & mp->m_blockmask) || ((pos + count) & mp->m_blockmask)) |