All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Subject: Re: [PATCH] zonefs: Fix file size of zones in full condition
Date: Wed, 17 Feb 2021 23:41:52 +0000	[thread overview]
Message-ID: <BL0PR04MB651446594B654329EE392477E7869@BL0PR04MB6514.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20210217095811.2517221-1-shinichiro.kawasaki@wdc.com

On 2021/02/17 18:58, Shin'ichiro Kawasaki wrote:
> Per ZBC/ZAC/ZNS specifications, write pointers may not have valid values
> when zones are in full condition. However, when zonefs mounts a zoned
> block device, zonefs refers write pointers to set file size even when
> the zones are in full condition. This results in wrong file size. To fix
> this, refer maximum file size in place of write pointers for zones in
> full condition.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system")
> Cc: <stable@vger.kernel.org> # 5.6+
> ---
>  fs/zonefs/super.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index bec47f2d074b..3fe933b1010c 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -250,6 +250,9 @@ static loff_t zonefs_check_zone_condition(struct inode *inode,
>  		}
>  		inode->i_mode &= ~0222;
>  		return i_size_read(inode);
> +	case BLK_ZONE_COND_FULL:
> +		/* The write pointer of full zones is invalid. */
> +		return zi->i_max_size;
>  	default:
>  		if (zi->i_ztype == ZONEFS_ZTYPE_CNV)
>  			return zi->i_max_size;
> 

Applied to for-5.12. Thanks !


-- 
Damien Le Moal
Western Digital Research

      reply	other threads:[~2021-02-17 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  9:58 [PATCH] zonefs: Fix file size of zones in full condition Shin'ichiro Kawasaki
2021-02-17 23:41 ` Damien Le Moal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BL0PR04MB651446594B654329EE392477E7869@BL0PR04MB6514.namprd04.prod.outlook.com \
    --to=damien.lemoal@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.