* [PATCH] btrfs-porgs: fix xfstest btrfs/023 random failure
@ 2014-07-17 9:28 Anand Jain
2014-07-29 12:57 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Anand Jain @ 2014-07-17 9:28 UTC (permalink / raw)
To: linux-btrfs
xfstest btrfs/023 which does the following tests
create_group_profile "raid0"
check_group_profile "RAID0"
create_group_profile "raid1"
check_group_profile "RAID1"
create_group_profile "raid10"
check_group_profile "RAID10"
create_group_profile "raid5"
check_group_profile "RAID5"
create_group_profile "raid6"
check_group_profile "RAID6"
fails randomly with the error as below
ERROR: device scan failed '/dev/sde' - Invalid argument
since failure is at random group profile it indicates to me that
btrfs kernel did not see the newly created btrfs on the device
To note: I have the following patch on the kernel which
is not yet integrated, but its not related to this bug.
btrfs: RFC: code optimize use btrfs_get_bdev_and_sb() at btrfs_scan_one_device
btrfs: looping 'mkfs.btrfs -f <dev>' may fail with EBUSY
btrfs: check generation as replace duplicates devid+uuid
This patch calls fsync() at btrfs_prepare_device().
With this btrfs/023 has NOT failed consistently for several long
iterations.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
utils.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/utils.c b/utils.c
index fbc5bde..e144dfd 100644
--- a/utils.c
+++ b/utils.c
@@ -741,6 +741,8 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
}
*block_count_ret = block_count;
+ fsync(fd);
+
zero_dev_error:
if (ret < 0) {
fprintf(stderr, "ERROR: failed to zero device '%s' - %s\n",
--
2.0.0.153.g79dcccc
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs-porgs: fix xfstest btrfs/023 random failure
2014-07-17 9:28 [PATCH] btrfs-porgs: fix xfstest btrfs/023 random failure Anand Jain
@ 2014-07-29 12:57 ` David Sterba
2014-07-31 7:07 ` Anand Jain
0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2014-07-29 12:57 UTC (permalink / raw)
To: Anand Jain; +Cc: linux-btrfs
On Thu, Jul 17, 2014 at 05:28:24PM +0800, Anand Jain wrote:
> xfstest btrfs/023 which does the following tests
>
> create_group_profile "raid0"
> check_group_profile "RAID0"
>
> create_group_profile "raid1"
> check_group_profile "RAID1"
>
> create_group_profile "raid10"
> check_group_profile "RAID10"
>
> create_group_profile "raid5"
> check_group_profile "RAID5"
>
> create_group_profile "raid6"
> check_group_profile "RAID6"
>
> fails randomly with the error as below
>
> ERROR: device scan failed '/dev/sde' - Invalid argument
>
> since failure is at random group profile it indicates to me that
> btrfs kernel did not see the newly created btrfs on the device
>
> To note: I have the following patch on the kernel which
> is not yet integrated, but its not related to this bug.
>
> btrfs: RFC: code optimize use btrfs_get_bdev_and_sb() at btrfs_scan_one_device
I guess the error was caused by this patch, and the fsync just made the
race window smaller. If you still think the fsync is useful, please
update the changelog.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs-porgs: fix xfstest btrfs/023 random failure
2014-07-29 12:57 ` David Sterba
@ 2014-07-31 7:07 ` Anand Jain
2014-07-31 12:01 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Anand Jain @ 2014-07-31 7:07 UTC (permalink / raw)
To: dsterba, linux-btrfs
On 29/07/2014 20:57, David Sterba wrote:
> On Thu, Jul 17, 2014 at 05:28:24PM +0800, Anand Jain wrote:
>> xfstest btrfs/023 which does the following tests
>>
>> create_group_profile "raid0"
>> check_group_profile "RAID0"
>>
>> create_group_profile "raid1"
>> check_group_profile "RAID1"
>>
>> create_group_profile "raid10"
>> check_group_profile "RAID10"
>>
>> create_group_profile "raid5"
>> check_group_profile "RAID5"
>>
>> create_group_profile "raid6"
>> check_group_profile "RAID6"
>>
>> fails randomly with the error as below
>>
>> ERROR: device scan failed '/dev/sde' - Invalid argument
>>
>> since failure is at random group profile it indicates to me that
>> btrfs kernel did not see the newly created btrfs on the device
>>
>> To note: I have the following patch on the kernel which
>> is not yet integrated, but its not related to this bug.
>>
>> btrfs: RFC: code optimize use btrfs_get_bdev_and_sb() at btrfs_scan_one_device
>
> I guess the error was caused by this patch,
Yep. I got that understanding when you mentioned about the patch
btrfs: access superblock via pagecache in scan_one_device
> and the fsync just made the race window smaller. If you still think
> the fsync is useful, please update the changelog.
You mean I should put fsync at more correct places ?
Thanks, Anand
> --
> 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] 4+ messages in thread
* Re: [PATCH] btrfs-porgs: fix xfstest btrfs/023 random failure
2014-07-31 7:07 ` Anand Jain
@ 2014-07-31 12:01 ` David Sterba
0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2014-07-31 12:01 UTC (permalink / raw)
To: Anand Jain; +Cc: dsterba, linux-btrfs
On Thu, Jul 31, 2014 at 03:07:39PM +0800, Anand Jain wrote:
> > and the fsync just made the race window smaller. If you still think
> > the fsync is useful, please update the changelog.
>
> You mean I should put fsync at more correct places ?
The fsync should not be necessary, but I haven't looked very closely.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-31 12:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-17 9:28 [PATCH] btrfs-porgs: fix xfstest btrfs/023 random failure Anand Jain
2014-07-29 12:57 ` David Sterba
2014-07-31 7:07 ` Anand Jain
2014-07-31 12:01 ` 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).