User: | Jiri Slaby |
Error type: | Double Lock |
Error type description: | Some lock is locked twice unintentionally in a sequence |
File location: | fs/xfs/xfs_log.c |
Line in file: | 2430 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Clang Static Analyzer
(3.0)
|
Entered: | 2012-04-17 12:29:30 UTC |
2400 * sleep. We wait on the flush queue on the head iclog as that should be 2401 * the first iclog to complete flushing. Hence if all iclogs are syncing, 2402 * we will wait here and all new writes will sleep until a sync completes. 2403 * 2404 * The in-core logs are used in a circular fashion. They are not used 2405 * out-of-order even when an iclog past the head is free. 2406 * 2407 * return: 2408 * * log_offset where xlog_write() can start writing into the in-core 2409 * log's data space. 2410 * * in-core log pointer to which xlog_write() should write. 2411 * * boolean indicating this is a continued write to an in-core log. 2412 * If this is the last write, then the in-core log's offset field 2413 * needs to be incremented, depending on the amount of data which 2414 * is copied. 2415 */ 2416STATIC int 2417xlog_state_get_iclog_space(xlog_t *log, 2418 int len, 2419 xlog_in_core_t **iclogp, 2420 xlog_ticket_t *ticket, 2421 int *continued_write, 2422 int *logoffsetp) 2423{ 2424 int log_offset; 2425 xlog_rec_header_t *head; 2426 xlog_in_core_t *iclog; 2427 int error; 2428 2429restart: 2430 spin_lock(&log->l_icloglock); 2431 if (XLOG_FORCED_SHUTDOWN(log)) { 2432 spin_unlock(&log->l_icloglock); 2433 return XFS_ERROR(EIO); 2434 } 2435 2436 iclog = log->l_iclog; 2437 if (iclog->ic_state != XLOG_STATE_ACTIVE) { 2438 xlog_trace_iclog(iclog, XLOG_TRACE_SLEEP_FLUSH); 2439 XFS_STATS_INC(xs_log_noiclogs); 2440