[Devel] [PATCH rh7] ve/fs/sync: sync detached inodes with dirty metadata

Konstantin Khorenko khorenko at virtuozzo.com
Thu Feb 18 02:55:20 PST 2016


On 02/17/2016 11:40 AM, Andrey Ryabinin wrote:
> Inodes with dirty metadata could be detached from UB
> (mapping->dirtied_ub == NULL). So sync() will skip such inodes.
> With this patch sync() will skip inodes with dirty data only.
>
> https://jira.sw.ru/browse/PSBM-44125
>
> Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
> ---
>   fs/fs-writeback.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index b6b33d0..11c44d8 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -657,6 +657,12 @@ static long writeback_chunk_size(struct backing_dev_info *bdi,
>   	return pages;
>   }
>
> +static inline bool sync_should_skip_inode(struct inode *inode)
> +{
> +	return inode->i_mapping->dirtied_ub ||
> +		((inode->i_state & I_DIRTY) == I_DIRTY_PAGES);
> +}
> +

We forgot about 2 cases:
1) bindmount from host into a CT => dirtied_ub will be set, but not "ours",
    but we still want to sync inodes with dirty metadata because of the single journal

2) simfs case: again a single journal => we should commit inodes with dirty metadata even in case they (inodes) do not belong to "our" Container.

=> i'm dropping this patch, but applying previously sent one:

-------- Forwarded Message --------
Subject: [PATCH rh7 v3 3/3] ve/fs/sync: don't skip dirty metatdata on filtered sync
Date: Wed, 3 Feb 2016 19:46:12 +0300
From: Andrey Ryabinin <aryabinin at virtuozzo.com>
To: devel at openvz.org
CC: vdavydov at virtuozzo.com, khorenko at virtuozzo.com, Andrey Ryabinin <aryabinin at virtuozzo.com>

Port of diff-ubc-dont-skip-dirty-metadata-on-filtered-sync patch
from PCS6.

Don't skip dirty metadata during per container sync[fs].

https://jira.sw.ru/browse/PSBM-39583

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>

>   /*
>    * Write a portion of b_io inodes which belong to @sb.
>    *
> @@ -714,7 +720,9 @@ static long writeback_sb_inodes(struct super_block *sb,
>   			continue;
>   		}
>   		if ((work->ub || work->filter_ub) &&
> -		     ub_should_skip_writeback(work->ub, inode)) {
> +		     ub_should_skip_writeback(work->ub, inode) &&
> +		     (work->reason != WB_REASON_SYNC ||
> +			     sync_should_skip_inode(inode))) {
>   			spin_unlock(&inode->i_lock);
>   			redirty_tail(inode, wb);
>   			continue;
> @@ -1411,7 +1419,8 @@ static void wait_sb_inodes(struct super_block *sb, struct user_beancounter *ub)
>   			spin_unlock(&inode->i_lock);
>   			continue;
>   		}
> -		if (ub && (mapping->dirtied_ub != ub)) {
> +		if (ub && (mapping->dirtied_ub != ub) &&
> +		    sync_should_skip_inode(inode)) {
>   			spin_unlock(&inode->i_lock);
>   			continue;
>   		}
>


More information about the Devel mailing list