Re: [PATCH] btrfs-progs: Fix a typo which causes super_copy corrupted

2015-10-21 Thread David Sterba
On Tue, Oct 20, 2015 at 10:20:44AM +0800, Qu Wenruo wrote:
> In btrfs_read_dev_super(), a wrong parameter for memcpy will copy wrong
> address of a stack pointer to super_copy.
> Which will cause a lot of unpredictable error.
> 
> What a stupid typo from myself!
> 
> Signed-off-by: Qu Wenruo 

Thanks.  I'd rather fold the change to the original patch as it seems to
break a few things. This would make any future bisecting hard, failing
tests etc. I'm glad you found it quickly.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] btrfs-progs: Fix a typo which causes super_copy corrupted

2015-10-19 Thread Qu Wenruo
In btrfs_read_dev_super(), a wrong parameter for memcpy will copy wrong
address of a stack pointer to super_copy.
Which will cause a lot of unpredictable error.

What a stupid typo from myself!

Signed-off-by: Qu Wenruo 
---
 disk-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk-io.c b/disk-io.c
index f7e6c41..139bc80 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -1480,7 +1480,7 @@ int btrfs_read_dev_super(int fd, struct btrfs_super_block 
*sb, u64 sb_bytenr,
 
if (check_super(buf))
return -1;
-   memcpy(sb, , BTRFS_SUPER_INFO_SIZE);
+   memcpy(sb, buf, BTRFS_SUPER_INFO_SIZE);
return 0;
}
 
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html