Showing error 1007

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: fs/xfs/xfs_log.c
Line in file: 3182
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:18 UTC


Source:

3152                } else {
3153                        atomic_inc(&iclog->ic_refcnt);
3154                        xlog_state_switch_iclogs(log, iclog, 0);
3155                        spin_unlock(&log->l_icloglock);
3156                        if (xlog_state_release_iclog(log, iclog))
3157                                return XFS_ERROR(EIO);
3158                        *log_flushed = 1;
3159                        spin_lock(&log->l_icloglock);
3160                }
3161        }
3162
3163        if ((flags & XFS_LOG_SYNC) && /* sleep */
3164            !(iclog->ic_state & (XLOG_STATE_ACTIVE | XLOG_STATE_DIRTY))) {
3165
3166                /*
3167                 * Don't wait on completion if we know that we've
3168                 * gotten a log write error.
3169                 */
3170                if (iclog->ic_state & XLOG_STATE_IOERROR) {
3171                        spin_unlock(&log->l_icloglock);
3172                        return XFS_ERROR(EIO);
3173                }
3174                XFS_STATS_INC(xs_log_force_sleep);
3175                sv_wait(&iclog->ic_force_wait, PSWP, &log->l_icloglock, s);
3176                /*
3177                 * No need to grab the log lock here since we're
3178                 * only deciding whether or not to return EIO
3179                 * and the memory read should be atomic.
3180                 */
3181                if (iclog->ic_state & XLOG_STATE_IOERROR)
3182                        return XFS_ERROR(EIO);
3183                *log_flushed = 1;
3184        } else {                /* just return */
3185                spin_unlock(&log->l_icloglock);
3186        }
3187        return 0;
3188
3189    } while (iclog != log->l_iclog);
3190
3191    spin_unlock(&log->l_icloglock);
3192    return 0;
Show full sources