diff options
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r-- | fs/xfs/xfs_qm.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 18ba438386ab..95aecf52475d 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -175,16 +175,21 @@ xfs_qm_dqpurge( | |||
175 | * we're unmounting, we do care, so we flush it and wait. | 175 | * we're unmounting, we do care, so we flush it and wait. |
176 | */ | 176 | */ |
177 | if (XFS_DQ_IS_DIRTY(dqp)) { | 177 | if (XFS_DQ_IS_DIRTY(dqp)) { |
178 | int error; | 178 | struct xfs_buf *bp = NULL; |
179 | int error; | ||
179 | 180 | ||
180 | /* | 181 | /* |
181 | * We don't care about getting disk errors here. We need | 182 | * We don't care about getting disk errors here. We need |
182 | * to purge this dquot anyway, so we go ahead regardless. | 183 | * to purge this dquot anyway, so we go ahead regardless. |
183 | */ | 184 | */ |
184 | error = xfs_qm_dqflush(dqp, SYNC_WAIT); | 185 | error = xfs_qm_dqflush(dqp, &bp); |
185 | if (error) | 186 | if (error) { |
186 | xfs_warn(mp, "%s: dquot %p flush failed", | 187 | xfs_warn(mp, "%s: dquot %p flush failed", |
187 | __func__, dqp); | 188 | __func__, dqp); |
189 | } else { | ||
190 | error = xfs_bwrite(bp); | ||
191 | xfs_buf_relse(bp); | ||
192 | } | ||
188 | xfs_dqflock(dqp); | 193 | xfs_dqflock(dqp); |
189 | } | 194 | } |
190 | 195 | ||
@@ -1200,6 +1205,7 @@ STATIC int | |||
1200 | xfs_qm_flush_one( | 1205 | xfs_qm_flush_one( |
1201 | struct xfs_dquot *dqp) | 1206 | struct xfs_dquot *dqp) |
1202 | { | 1207 | { |
1208 | struct xfs_buf *bp = NULL; | ||
1203 | int error = 0; | 1209 | int error = 0; |
1204 | 1210 | ||
1205 | xfs_dqlock(dqp); | 1211 | xfs_dqlock(dqp); |
@@ -1211,8 +1217,12 @@ xfs_qm_flush_one( | |||
1211 | if (!xfs_dqflock_nowait(dqp)) | 1217 | if (!xfs_dqflock_nowait(dqp)) |
1212 | xfs_dqflock_pushbuf_wait(dqp); | 1218 | xfs_dqflock_pushbuf_wait(dqp); |
1213 | 1219 | ||
1214 | error = xfs_qm_dqflush(dqp, 0); | 1220 | error = xfs_qm_dqflush(dqp, &bp); |
1221 | if (error) | ||
1222 | goto out_unlock; | ||
1215 | 1223 | ||
1224 | xfs_buf_delwri_queue(bp); | ||
1225 | xfs_buf_relse(bp); | ||
1216 | out_unlock: | 1226 | out_unlock: |
1217 | xfs_dqunlock(dqp); | 1227 | xfs_dqunlock(dqp); |
1218 | return error; | 1228 | return error; |
@@ -1479,18 +1489,23 @@ xfs_qm_dqreclaim_one( | |||
1479 | * dirty dquots. | 1489 | * dirty dquots. |
1480 | */ | 1490 | */ |
1481 | if (XFS_DQ_IS_DIRTY(dqp)) { | 1491 | if (XFS_DQ_IS_DIRTY(dqp)) { |
1492 | struct xfs_buf *bp = NULL; | ||
1493 | |||
1482 | trace_xfs_dqreclaim_dirty(dqp); | 1494 | trace_xfs_dqreclaim_dirty(dqp); |
1483 | 1495 | ||
1484 | /* | 1496 | /* |
1485 | * We flush it delayed write, so don't bother releasing the | 1497 | * We flush it delayed write, so don't bother releasing the |
1486 | * freelist lock. | 1498 | * freelist lock. |
1487 | */ | 1499 | */ |
1488 | error = xfs_qm_dqflush(dqp, 0); | 1500 | error = xfs_qm_dqflush(dqp, &bp); |
1489 | if (error) { | 1501 | if (error) { |
1490 | xfs_warn(mp, "%s: dquot %p flush failed", | 1502 | xfs_warn(mp, "%s: dquot %p flush failed", |
1491 | __func__, dqp); | 1503 | __func__, dqp); |
1504 | goto out_busy; | ||
1492 | } | 1505 | } |
1493 | 1506 | ||
1507 | xfs_buf_delwri_queue(bp); | ||
1508 | xfs_buf_relse(bp); | ||
1494 | /* | 1509 | /* |
1495 | * Give the dquot another try on the freelist, as the | 1510 | * Give the dquot another try on the freelist, as the |
1496 | * flushing will take some time. | 1511 | * flushing will take some time. |