diff mbox

[1/2] xfs: report zeroed or not correctly in xfs_zero_range()

Message ID 20170907034254.7180-1-eguan@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Eryu Guan Sept. 7, 2017, 3:42 a.m. UTC
The 'did_zero' param of xfs_zero_range() was not passed to
iomap_zero_range() correctly. This was introduced by commit
7bb41db3ea16 ("xfs: handle 64-bit length in xfs_iozero"), and found
by code inspection.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 fs/xfs/xfs_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Carlos Maiolino Sept. 7, 2017, 8:49 a.m. UTC | #1
On Thu, Sep 07, 2017 at 11:42:53AM +0800, Eryu Guan wrote:
> The 'did_zero' param of xfs_zero_range() was not passed to
> iomap_zero_range() correctly. This was introduced by commit
> 7bb41db3ea16 ("xfs: handle 64-bit length in xfs_iozero"), and found
> by code inspection.
> 

Looks good,

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>  fs/xfs/xfs_file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index c4893e226fd8..812cd17b331f 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -58,7 +58,7 @@ xfs_zero_range(
>  	xfs_off_t		count,
>  	bool			*did_zero)
>  {
> -	return iomap_zero_range(VFS_I(ip), pos, count, NULL, &xfs_iomap_ops);
> +	return iomap_zero_range(VFS_I(ip), pos, count, did_zero, &xfs_iomap_ops);
>  }
>  
>  int
> -- 
> 2.13.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Sept. 8, 2017, 7:37 a.m. UTC | #2
On Thu, Sep 07, 2017 at 11:42:53AM +0800, Eryu Guan wrote:
> The 'did_zero' param of xfs_zero_range() was not passed to
> iomap_zero_range() correctly. This was introduced by commit
> 7bb41db3ea16 ("xfs: handle 64-bit length in xfs_iozero"), and found
> by code inspection.

Looks good.  Although this makes me wonder why we pass the
argument at all, given that it doesn't seem to matter :)

Joking aside: xfs_setattr_size seems to care to write out
the buffer cache zeroed byes, so this looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darrick J. Wong Sept. 18, 2017, 6:40 p.m. UTC | #3
On Thu, Sep 07, 2017 at 11:42:53AM +0800, Eryu Guan wrote:
> The 'did_zero' param of xfs_zero_range() was not passed to
> iomap_zero_range() correctly. This was introduced by commit
> 7bb41db3ea16 ("xfs: handle 64-bit length in xfs_iozero"), and found
> by code inspection.
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>

Both look ok,

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

> ---
>  fs/xfs/xfs_file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index c4893e226fd8..812cd17b331f 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -58,7 +58,7 @@ xfs_zero_range(
>  	xfs_off_t		count,
>  	bool			*did_zero)
>  {
> -	return iomap_zero_range(VFS_I(ip), pos, count, NULL, &xfs_iomap_ops);
> +	return iomap_zero_range(VFS_I(ip), pos, count, did_zero, &xfs_iomap_ops);
>  }
>  
>  int
> -- 
> 2.13.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index c4893e226fd8..812cd17b331f 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -58,7 +58,7 @@  xfs_zero_range(
 	xfs_off_t		count,
 	bool			*did_zero)
 {
-	return iomap_zero_range(VFS_I(ip), pos, count, NULL, &xfs_iomap_ops);
+	return iomap_zero_range(VFS_I(ip), pos, count, did_zero, &xfs_iomap_ops);
 }
 
 int