diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-13 02:50:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-13 02:50:13 -0400 |
commit | 54ef76f37bcccf8c16fbaaed13c3c40825195958 (patch) | |
tree | 59afdb95e68f2fbac2550aa42135921086649c38 /fs/xfs/xfs_log.c | |
parent | 032f82786f9be4635acaa5f77feca175a4ac5fe1 (diff) | |
parent | 9df2fe986770bc4c76e8fe72c20b71268eec39a7 (diff) |
Merge branch 'linus' into sched/devel
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; |