linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs-progs: convert: do not clear nodatasum flag in inode item
@ 2017-06-28 21:29 Liu Bo
  2017-06-29  4:37 ` Lakshmipathi.G
  2017-06-30  7:59 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Bo @ 2017-06-28 21:29 UTC (permalink / raw)
  To: linux-btrfs

With the current btrfs-convert, if we convert a ext4 without data checksum,
it'd not set nodatasum flag in inode item, nor create csum item, reading
file ends up with checksum errors.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 convert/source-ext2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/convert/source-ext2.c b/convert/source-ext2.c
index 1b0576b..64b95c5 100644
--- a/convert/source-ext2.c
+++ b/convert/source-ext2.c
@@ -742,7 +742,7 @@ static int ext2_check_state(struct btrfs_convert_context *cctx)
 static void ext2_convert_inode_flags(struct btrfs_inode_item *dst,
 				     struct ext2_inode *src)
 {
-	u64 flags = 0;
+	u64 flags = btrfs_stack_inode_flags(dst);
 
 	COPY_ONE_EXT2_FLAG(flags, src, APPEND);
 	COPY_ONE_EXT2_FLAG(flags, src, SYNC);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Btrfs-progs: convert: do not clear nodatasum flag in inode item
  2017-06-28 21:29 [PATCH] Btrfs-progs: convert: do not clear nodatasum flag in inode item Liu Bo
@ 2017-06-29  4:37 ` Lakshmipathi.G
  2017-06-30  7:59 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Lakshmipathi.G @ 2017-06-29  4:37 UTC (permalink / raw)
  To: Liu Bo; +Cc: btrfs

Could you please add also a test-script for this interesting issue
under tests/convert-tests
(If its not already there)?. thanks.

----
Cheers,
Lakshmipathi.G
http://www.giis.co.in http://www.webminal.org


On Thu, Jun 29, 2017 at 2:59 AM, Liu Bo <bo.li.liu@oracle.com> wrote:
> With the current btrfs-convert, if we convert a ext4 without data checksum,
> it'd not set nodatasum flag in inode item, nor create csum item, reading
> file ends up with checksum errors.
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  convert/source-ext2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/convert/source-ext2.c b/convert/source-ext2.c
> index 1b0576b..64b95c5 100644
> --- a/convert/source-ext2.c
> +++ b/convert/source-ext2.c
> @@ -742,7 +742,7 @@ static int ext2_check_state(struct btrfs_convert_context *cctx)
>  static void ext2_convert_inode_flags(struct btrfs_inode_item *dst,
>                                      struct ext2_inode *src)
>  {
> -       u64 flags = 0;
> +       u64 flags = btrfs_stack_inode_flags(dst);
>
>         COPY_ONE_EXT2_FLAG(flags, src, APPEND);
>         COPY_ONE_EXT2_FLAG(flags, src, SYNC);
> --
> 2.5.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Btrfs-progs: convert: do not clear nodatasum flag in inode item
  2017-06-28 21:29 [PATCH] Btrfs-progs: convert: do not clear nodatasum flag in inode item Liu Bo
  2017-06-29  4:37 ` Lakshmipathi.G
@ 2017-06-30  7:59 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2017-06-30  7:59 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Wed, Jun 28, 2017 at 03:29:49PM -0600, Liu Bo wrote:
> With the current btrfs-convert, if we convert a ext4 without data checksum,
> it'd not set nodatasum flag in inode item, nor create csum item, reading
> file ends up with checksum errors.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-30  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28 21:29 [PATCH] Btrfs-progs: convert: do not clear nodatasum flag in inode item Liu Bo
2017-06-29  4:37 ` Lakshmipathi.G
2017-06-30  7:59 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).