diff options
author | David Chinner <dgc@sgi.com> | 2008-04-09 22:20:24 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 21:56:55 -0400 |
commit | 3c56836f92683cb871ebbf44c512069b0d48a08f (patch) | |
tree | ac0ef5d76e086aa6e2542fb5548db26af5967297 /fs/xfs/quota | |
parent | 4b8879df8c21bed3efd1eb2da5d72501199aba29 (diff) |
[XFS] Check for dquot flush errors
xfs_qm_dqflush() can fail, but the return is not checked anywhere. Hence
we never know if we've failed to flush a dquot to disk. Propagate the
error and warn to the syslog if a flush ever fails.
SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30787a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 10 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_dquot_item.c | 7 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 14 |
3 files changed, 24 insertions, 7 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index 665babcca6a6..15214fbb9aa7 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -1439,9 +1439,7 @@ xfs_qm_dqpurge( | |||
1439 | uint flags) | 1439 | uint flags) |
1440 | { | 1440 | { |
1441 | xfs_dqhash_t *thishash; | 1441 | xfs_dqhash_t *thishash; |
1442 | xfs_mount_t *mp; | 1442 | xfs_mount_t *mp = dqp->q_mount; |
1443 | |||
1444 | mp = dqp->q_mount; | ||
1445 | 1443 | ||
1446 | ASSERT(XFS_QM_IS_MPLIST_LOCKED(mp)); | 1444 | ASSERT(XFS_QM_IS_MPLIST_LOCKED(mp)); |
1447 | ASSERT(XFS_DQ_IS_HASH_LOCKED(dqp->q_hash)); | 1445 | ASSERT(XFS_DQ_IS_HASH_LOCKED(dqp->q_hash)); |
@@ -1485,6 +1483,7 @@ xfs_qm_dqpurge( | |||
1485 | * we're unmounting, we do care, so we flush it and wait. | 1483 | * we're unmounting, we do care, so we flush it and wait. |
1486 | */ | 1484 | */ |
1487 | if (XFS_DQ_IS_DIRTY(dqp)) { | 1485 | if (XFS_DQ_IS_DIRTY(dqp)) { |
1486 | int error; | ||
1488 | xfs_dqtrace_entry(dqp, "DQPURGE ->DQFLUSH: DQDIRTY"); | 1487 | xfs_dqtrace_entry(dqp, "DQPURGE ->DQFLUSH: DQDIRTY"); |
1489 | /* dqflush unlocks dqflock */ | 1488 | /* dqflush unlocks dqflock */ |
1490 | /* | 1489 | /* |
@@ -1495,7 +1494,10 @@ xfs_qm_dqpurge( | |||
1495 | * We don't care about getting disk errors here. We need | 1494 | * We don't care about getting disk errors here. We need |
1496 | * to purge this dquot anyway, so we go ahead regardless. | 1495 | * to purge this dquot anyway, so we go ahead regardless. |
1497 | */ | 1496 | */ |
1498 | (void) xfs_qm_dqflush(dqp, XFS_QMOPT_SYNC); | 1497 | error = xfs_qm_dqflush(dqp, XFS_QMOPT_SYNC); |
1498 | if (error) | ||
1499 | xfs_fs_cmn_err(CE_WARN, mp, | ||
1500 | "xfs_qm_dqpurge: dquot %p flush failed", dqp); | ||
1499 | xfs_dqflock(dqp); | 1501 | xfs_dqflock(dqp); |
1500 | } | 1502 | } |
1501 | ASSERT(dqp->q_pincount == 0); | 1503 | ASSERT(dqp->q_pincount == 0); |
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index 1800e8d1f646..3dedce1d9cde 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c | |||
@@ -146,6 +146,7 @@ xfs_qm_dquot_logitem_push( | |||
146 | xfs_dq_logitem_t *logitem) | 146 | xfs_dq_logitem_t *logitem) |
147 | { | 147 | { |
148 | xfs_dquot_t *dqp; | 148 | xfs_dquot_t *dqp; |
149 | int error; | ||
149 | 150 | ||
150 | dqp = logitem->qli_dquot; | 151 | dqp = logitem->qli_dquot; |
151 | 152 | ||
@@ -161,7 +162,11 @@ xfs_qm_dquot_logitem_push( | |||
161 | * lock without sleeping, then there must not have been | 162 | * lock without sleeping, then there must not have been |
162 | * anyone in the process of flushing the dquot. | 163 | * anyone in the process of flushing the dquot. |
163 | */ | 164 | */ |
164 | xfs_qm_dqflush(dqp, XFS_B_DELWRI); | 165 | error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); |
166 | if (error) | ||
167 | xfs_fs_cmn_err(CE_WARN, dqp->q_mount, | ||
168 | "xfs_qm_dquot_logitem_push: push error %d on dqp %p", | ||
169 | error, dqp); | ||
165 | xfs_dqunlock(dqp); | 170 | xfs_dqunlock(dqp); |
166 | } | 171 | } |
167 | 172 | ||
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 04b29c672141..0ed3c8277fcd 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -2094,12 +2094,17 @@ xfs_qm_shake_freelist( | |||
2094 | * dirty dquots. | 2094 | * dirty dquots. |
2095 | */ | 2095 | */ |
2096 | if (XFS_DQ_IS_DIRTY(dqp)) { | 2096 | if (XFS_DQ_IS_DIRTY(dqp)) { |
2097 | int error; | ||
2097 | xfs_dqtrace_entry(dqp, "DQSHAKE: DQDIRTY"); | 2098 | xfs_dqtrace_entry(dqp, "DQSHAKE: DQDIRTY"); |
2098 | /* | 2099 | /* |
2099 | * We flush it delayed write, so don't bother | 2100 | * We flush it delayed write, so don't bother |
2100 | * releasing the mplock. | 2101 | * releasing the mplock. |
2101 | */ | 2102 | */ |
2102 | (void) xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); | 2103 | error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); |
2104 | if (error) { | ||
2105 | xfs_fs_cmn_err(CE_WARN, dqp->q_mount, | ||
2106 | "xfs_qm_dqflush_all: dquot %p flush failed", dqp); | ||
2107 | } | ||
2103 | xfs_dqunlock(dqp); /* dqflush unlocks dqflock */ | 2108 | xfs_dqunlock(dqp); /* dqflush unlocks dqflock */ |
2104 | dqp = dqp->dq_flnext; | 2109 | dqp = dqp->dq_flnext; |
2105 | continue; | 2110 | continue; |
@@ -2266,12 +2271,17 @@ xfs_qm_dqreclaim_one(void) | |||
2266 | * dirty dquots. | 2271 | * dirty dquots. |
2267 | */ | 2272 | */ |
2268 | if (XFS_DQ_IS_DIRTY(dqp)) { | 2273 | if (XFS_DQ_IS_DIRTY(dqp)) { |
2274 | int error; | ||
2269 | xfs_dqtrace_entry(dqp, "DQRECLAIM: DQDIRTY"); | 2275 | xfs_dqtrace_entry(dqp, "DQRECLAIM: DQDIRTY"); |
2270 | /* | 2276 | /* |
2271 | * We flush it delayed write, so don't bother | 2277 | * We flush it delayed write, so don't bother |
2272 | * releasing the freelist lock. | 2278 | * releasing the freelist lock. |
2273 | */ | 2279 | */ |
2274 | (void) xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); | 2280 | error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); |
2281 | if (error) { | ||
2282 | xfs_fs_cmn_err(CE_WARN, dqp->q_mount, | ||
2283 | "xfs_qm_dqreclaim: dquot %p flush failed", dqp); | ||
2284 | } | ||
2275 | xfs_dqunlock(dqp); /* dqflush unlocks dqflock */ | 2285 | xfs_dqunlock(dqp); /* dqflush unlocks dqflock */ |
2276 | continue; | 2286 | continue; |
2277 | } | 2287 | } |