diff mbox series

[5/9] lustre: llite: clear LLIF_FILE_RESTORING when done

Message ID 154295732800.2850.8303806531168774380.stgit@noble (mailing list archive)
State New, archived
Headers show
Series Assorted lustre patches - mostly from OpenSFS | expand

Commit Message

NeilBrown Nov. 23, 2018, 7:15 a.m. UTC
From: Bruno Faccini <bruno.faccini@intel.com>

Clear LLIF_FILE_RESTORING if restore done to ensure to start again
to glimpse new attrs.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-6560
Reviewed-on: http://review.whamcloud.com/14609
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

James Simmons Nov. 26, 2018, 1:34 a.m. UTC | #1
> From: Bruno Faccini <bruno.faccini@intel.com>
> 
> Clear LLIF_FILE_RESTORING if restore done to ensure to start again
> to glimpse new attrs.

Reviewed-by: James Simmons <jsimmons@infradead.org>
 
> Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
> WC-bug-id: https://jira.whamcloud.com/browse/LU-6560
> Reviewed-on: http://review.whamcloud.com/14609
> Reviewed-by: John L. Hammond <john.hammond@intel.com>
> Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  drivers/staging/lustre/lustre/llite/llite_lib.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
> index fac65845526a..b8693049f3b6 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_lib.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
> @@ -1905,8 +1905,14 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
>  	}
>  
>  	if (body->mbo_valid & OBD_MD_TSTATE) {
> +		/* Set LLIF_FILE_RESTORING if restore ongoing and
> +		 * clear it when done to ensure to start again
> +		 * glimpsing updated attrs
> +		 */
>  		if (body->mbo_t_state & MS_RESTORE)
>  			set_bit(LLIF_FILE_RESTORING, &lli->lli_flags);
> +		else
> +			clear_bit(LLIF_FILE_RESTORING, &lli->lli_flags);
>  	}
>  
>  	return 0;
> 
> 
>
diff mbox series

Patch

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index fac65845526a..b8693049f3b6 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1905,8 +1905,14 @@  int ll_update_inode(struct inode *inode, struct lustre_md *md)
 	}
 
 	if (body->mbo_valid & OBD_MD_TSTATE) {
+		/* Set LLIF_FILE_RESTORING if restore ongoing and
+		 * clear it when done to ensure to start again
+		 * glimpsing updated attrs
+		 */
 		if (body->mbo_t_state & MS_RESTORE)
 			set_bit(LLIF_FILE_RESTORING, &lli->lli_flags);
+		else
+			clear_bit(LLIF_FILE_RESTORING, &lli->lli_flags);
 	}
 
 	return 0;