diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-12 01:29:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-12 01:29:02 -0400 |
commit | ae94b8075a2ed58d2318ef03827b25bc844f844e (patch) | |
tree | 7211f558d841cb40e1015d0b7527643ad55cb8e7 /fs/xfs/xfs_log.c | |
parent | eca91e7838ec92e8c12122849ec7539c4765b689 (diff) | |
parent | a26929fb489188ff959b1715ee67f0c9f84405b5 (diff) |
Merge branch 'linus' into x86/core
Conflicts:
arch/x86/mm/ioremap.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index afaee301b0ee..ad3d26ddfe31 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -2427,13 +2427,20 @@ restart: | |||
2427 | if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { | 2427 | if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { |
2428 | xlog_state_switch_iclogs(log, iclog, iclog->ic_size); | 2428 | xlog_state_switch_iclogs(log, iclog, iclog->ic_size); |
2429 | 2429 | ||
2430 | /* If I'm the only one writing to this iclog, sync it to disk */ | 2430 | /* |
2431 | if (atomic_read(&iclog->ic_refcnt) == 1) { | 2431 | * If I'm the only one writing to this iclog, sync it to disk. |
2432 | * We need to do an atomic compare and decrement here to avoid | ||
2433 | * racing with concurrent atomic_dec_and_lock() calls in | ||
2434 | * xlog_state_release_iclog() when there is more than one | ||
2435 | * reference to the iclog. | ||
2436 | */ | ||
2437 | if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { | ||
2438 | /* we are the only one */ | ||
2432 | spin_unlock(&log->l_icloglock); | 2439 | spin_unlock(&log->l_icloglock); |
2433 | if ((error = xlog_state_release_iclog(log, iclog))) | 2440 | error = xlog_state_release_iclog(log, iclog); |
2441 | if (error) | ||
2434 | return error; | 2442 | return error; |
2435 | } else { | 2443 | } else { |
2436 | atomic_dec(&iclog->ic_refcnt); | ||
2437 | spin_unlock(&log->l_icloglock); | 2444 | spin_unlock(&log->l_icloglock); |
2438 | } | 2445 | } |
2439 | goto restart; | 2446 | goto restart; |