[lustre-devel] [PATCH 8/9] lustre: statahead: skip agl for the file in restoring

James Simmons jsimmons at infradead.org
Sun Nov 25 18:09:40 PST 2018


> From: Fan Yong <fan.yong at intel.com>
> 
> In case of restore, the MDT has the right size and has already sent
> it back without granting the layout lock, inode is up-to-date. Then
> AGL (async glimpse lock) is useless.
> 
> Also to glimpse we need the layout, in case of a running restore the
> MDT holds the layout lock so the glimpse will block up to the end of
> restore (statahead/agl will block).

Reviewed-by: James Simmons <jsimmons at infradead.org>
 
> Signed-off-by: Fan Yong <fan.yong at intel.com>
> WC-bug-id: https://jira.whamcloud.com/browse/LU-9319
> Reviewed-by: Lai Siyao <lai.siyao at intel.com>
> Reviewed-by: Jinshan Xiong <jinshan.xiong at intel.com>
> Reviewed-by: John L. Hammond <john.hammond at intel.com>
> Reviewed-on: https://review.whamcloud.com/26501
> Reviewed-by: Oleg Drokin <oleg.drokin at intel.com>
> Signed-off-by: NeilBrown <neilb at suse.com>
> ---
>  drivers/staging/lustre/lustre/llite/statahead.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
> index 28e85bfb9b82..3d71322aa1c7 100644
> --- a/drivers/staging/lustre/lustre/llite/statahead.c
> +++ b/drivers/staging/lustre/lustre/llite/statahead.c
> @@ -504,6 +504,19 @@ static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai)
>  		return;
>  	}
>  
> +	/* In case of restore, the MDT has the right size and has already
> +	 * sent it back without granting the layout lock, inode is up-to-date.
> +	 * Then AGL (async glimpse lock) is useless.
> +	 * Also to glimpse we need the layout, in case of a runninh restore
> +	 * the MDT holds the layout lock so the glimpse will block up to the
> +	 * end of restore (statahead/agl will block)
> +	 */
> +	if (test_bit(LLIF_FILE_RESTORING, &lli->lli_flags)) {
> +		lli->lli_agl_index = 0;
> +		iput(inode);
> +		return;
> +	}
> +
>  	/* Someone is in glimpse (sync or async), do nothing. */
>  	rc = down_write_trylock(&lli->lli_glimpse_sem);
>  	if (rc == 0) {
> 
> 
> 


More information about the lustre-devel mailing list