>>>>> Stephen C Tweedie (SCT) writes: >> journal_dirty_metadata(handle, bh) >> { >> transaction->t_reserved--; >> handle->h_buffer_credits--; >> if (jh->b_tcount > 0) { >> /* modifed, no need to track it any more */ >> transaction-> t_outstanding_credits++; >> jh-> b_tcount = -1; >> } >> }
SCT> Actually, the whole thing can be wrapped in if (jh->b_tcount > 0) {}, I SCT> think. If we have already charged the transaction for this buffer, then SCT> there's no need to charge the handle for it again. That's going to be SCT> particularly important for truncate(), where we are continually updating SCT> the same blocks (eg. bitmap, indirect blocks), so we want to make sure SCT> that after the first journal_dirty_metadata() call, no further charge is SCT> made. the idea is: 1) the sooner we drop reservation, the higher probability to cover many changes by single transaction 1) having h_buffer_credits being decremented for each modification could help us to debug handle overflow situations SCT> If we do that, do we in fact need t_reserved at all? hmm. if t_outstanding_credits holds number of modified buffers, then we need sum of all running h_buffer_credits to protect from transaction overflow. t_reserved is sum of h_buffer_credits. thanks, Alex - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/