aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_lrw.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_lrw.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 46b61a859af4..acab58c48043 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -280,10 +280,11 @@ xfs_read(
280 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && 280 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) &&
281 !(ioflags & IO_INVIS)) { 281 !(ioflags & IO_INVIS)) {
282 vrwlock_t locktype = VRWLOCK_READ; 282 vrwlock_t locktype = VRWLOCK_READ;
283 int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags);
283 284
284 ret = -XFS_SEND_DATA(mp, DM_EVENT_READ, 285 ret = -XFS_SEND_DATA(mp, DM_EVENT_READ,
285 BHV_TO_VNODE(bdp), *offset, size, 286 BHV_TO_VNODE(bdp), *offset, size,
286 FILP_DELAY_FLAG(file), &locktype); 287 dmflags, &locktype);
287 if (ret) { 288 if (ret) {
288 xfs_iunlock(ip, XFS_IOLOCK_SHARED); 289 xfs_iunlock(ip, XFS_IOLOCK_SHARED);
289 goto unlock_isem; 290 goto unlock_isem;
@@ -843,11 +844,15 @@ retry:
843 !(ioflags & IO_INVIS)) { 844 !(ioflags & IO_INVIS)) {
844 845
845 xfs_rwunlock(bdp, locktype); 846 xfs_rwunlock(bdp, locktype);
847 if (need_isem)
848 up(&inode->i_sem);
846 error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, 849 error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp,
847 DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL, 850 DM_RIGHT_NULL, vp, DM_RIGHT_NULL, NULL, NULL,
848 0, 0, 0); /* Delay flag intentionally unused */ 851 0, 0, 0); /* Delay flag intentionally unused */
849 if (error) 852 if (error)
850 goto out_unlock_isem; 853 goto out_nounlocks;
854 if (need_isem)
855 down(&inode->i_sem);
851 xfs_rwlock(bdp, locktype); 856 xfs_rwlock(bdp, locktype);
852 pos = xip->i_d.di_size; 857 pos = xip->i_d.di_size;
853 ret = 0; 858 ret = 0;
@@ -962,6 +967,7 @@ retry:
962 out_unlock_isem: 967 out_unlock_isem:
963 if (need_isem) 968 if (need_isem)
964 up(&inode->i_sem); 969 up(&inode->i_sem);
970 out_nounlocks:
965 return -error; 971 return -error;
966} 972}
967 973