Re: [PATCH 2/9] xfs: XLOG_STATE_IOERROR must die

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

 



>  	else
>  		ASSERT(iclog->ic_state == XLOG_STATE_WANT_SYNC ||
> -		       iclog->ic_state == XLOG_STATE_IOERROR);
> +			xlog_is_shutdown(log));

Nit:  think doing this as:

	else if (!xlog_is_shutdown(log))
		ASSERT(iclog->ic_state == XLOG_STATE_WANT_SYNC);

would be a tad cleaner.

>  		else
>  			ASSERT(iclog->ic_state == XLOG_STATE_WANT_SYNC ||
> -			       iclog->ic_state == XLOG_STATE_IOERROR);
> +				xlog_is_shutdown(log));

Same here.

> @@ -2765,12 +2755,13 @@ xlog_state_do_callback(
>  	struct xlog_in_core	*iclog;
>  	struct xlog_in_core	*first_iclog;
>  	bool			cycled_icloglock;
> -	bool			ioerror;
>  	int			flushcnt = 0;
>  	int			repeats = 0;
>  
>  	spin_lock(&log->l_icloglock);
>  	do {
> +		repeats++;
> +
>  		/*
>  		 * Scan all iclogs starting with the one pointed to by the
>  		 * log.  Reset this starting point each time the log is
> @@ -2779,23 +2770,21 @@ xlog_state_do_callback(
>  		 * Keep looping through iclogs until one full pass is made
>  		 * without running any callbacks.
>  		 */
> -		first_iclog = log->l_iclog;
> -		iclog = log->l_iclog;
>  		cycled_icloglock = false;
> -		ioerror = false;
> -		repeats++;
> -
> -		do {
> +		first_iclog = NULL;
> +		for (iclog = log->l_iclog;
> +		     iclog != first_iclog;
> +		     iclog = iclog->ic_next) {
>  			LIST_HEAD(cb_list);
>  
> -			if (xlog_state_iodone_process_iclog(log, iclog,
> -							&ioerror))
> -				break;
> +			if (!first_iclog)
> +				first_iclog = iclog;
>  
> -			if (iclog->ic_state != XLOG_STATE_CALLBACK &&
> -			    iclog->ic_state != XLOG_STATE_IOERROR) {
> -				iclog = iclog->ic_next;
> -				continue;
> +			if (!xlog_is_shutdown(log)) {
> +				if (xlog_state_iodone_process_iclog(log, iclog))
> +					break;
> +				if (iclog->ic_state != XLOG_STATE_CALLBACK)
> +					continue;
>  			}
>  			list_splice_init(&iclog->ic_callbacks, &cb_list);
>  			spin_unlock(&log->l_icloglock);
> @@ -2810,8 +2799,7 @@ xlog_state_do_callback(
>  				wake_up_all(&iclog->ic_force_wait);
>  			else
>  				xlog_state_clean_iclog(log, iclog);
> -			iclog = iclog->ic_next;
> -		} while (first_iclog != iclog);
> +		};

I don't think swiching to a random other iteration style here helps
to review.  Please keep the old in in this otherwise pretty mechnical
change and clean it up later if you strongly prefer the new style.
(which I'm really not sold on, btw - yes it makes the continiue easier
but otherwise isn't all that great either).

Otherwise looks fine and long overdue.



[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