Re: [PATCH 9/9] xfs: log head and tail aren't reliable during shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	if (tail_cycle == head_cycle && head_bytes >= tail_bytes) {
> +		return log->l_logsize - (head_bytes - tail_bytes);
> +	} else if (tail_cycle + 1 < head_cycle) {
>  		return 0;
> +	} else if (xlog_is_shutdown(log)) {
> +		/* Ignore potential inconsistency when shutdown. */
> +		return log->l_logsize;
> +	} else if (tail_cycle < head_cycle) {
>  		ASSERT(tail_cycle == (head_cycle - 1));
> +		return tail_bytes - head_bytes;
>  	}

Drop the else after the returns to make this a little easier to follow:

	if (tail_cycle == head_cycle && head_bytes >= tail_bytes)
		return log->l_logsize - (head_bytes - tail_bytes);
	if (tail_cycle + 1 < head_cycle)
		return 0;

	/* Ignore potential inconsistency when shutdown. */
	if (xlog_is_shutdown(log)) {
		return log->l_logsize;

	if (tail_cycle < head_cycle) {
		ASSERT(tail_cycle == (head_cycle - 1));
		return tail_bytes - head_bytes;
	}

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux