* [PATCH] btrfs-progs: use btrfs_pwrite in place of pwrite
@ 2021-10-20 6:57 Naohiro Aota
2021-10-20 13:48 ` Josef Bacik
2021-10-20 17:01 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Naohiro Aota @ 2021-10-20 6:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba, Naohiro Aota
We need to use btrfs_pwrite instead of pwrite to ensure the writing to
O_DIRECT file works.
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
mkfs/common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkfs/common.c b/mkfs/common.c
index 5c8d6ac13a3b..ca5393d56f3f 100644
--- a/mkfs/common.c
+++ b/mkfs/common.c
@@ -181,8 +181,8 @@ static int create_free_space_tree(int fd, struct btrfs_mkfs_config *cfg,
btrfs_set_header_nritems(buf, nritems);
csum_tree_block_size(buf, btrfs_csum_type_size(cfg->csum_type), 0,
cfg->csum_type);
- ret = pwrite(fd, buf->data, cfg->nodesize,
- cfg->blocks[MKFS_FREE_SPACE_TREE]);
+ ret = btrfs_pwrite(fd, buf->data, cfg->nodesize,
+ cfg->blocks[MKFS_FREE_SPACE_TREE], cfg->zone_size);
if (ret != cfg->nodesize)
return ret < 0 ? -errno : -EIO;
return 0;
--
2.33.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs-progs: use btrfs_pwrite in place of pwrite
2021-10-20 6:57 [PATCH] btrfs-progs: use btrfs_pwrite in place of pwrite Naohiro Aota
@ 2021-10-20 13:48 ` Josef Bacik
2021-10-20 17:01 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2021-10-20 13:48 UTC (permalink / raw)
To: Naohiro Aota; +Cc: linux-btrfs, David Sterba
On Wed, Oct 20, 2021 at 03:57:01PM +0900, Naohiro Aota wrote:
> We need to use btrfs_pwrite instead of pwrite to ensure the writing to
> O_DIRECT file works.
>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Thanks,
Josef
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs-progs: use btrfs_pwrite in place of pwrite
2021-10-20 6:57 [PATCH] btrfs-progs: use btrfs_pwrite in place of pwrite Naohiro Aota
2021-10-20 13:48 ` Josef Bacik
@ 2021-10-20 17:01 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2021-10-20 17:01 UTC (permalink / raw)
To: Naohiro Aota; +Cc: linux-btrfs, David Sterba
On Wed, Oct 20, 2021 at 03:57:01PM +0900, Naohiro Aota wrote:
> We need to use btrfs_pwrite instead of pwrite to ensure the writing to
> O_DIRECT file works.
>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Added to devel, though it does not fix the problem with creating zoned
on a file image.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-20 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 6:57 [PATCH] btrfs-progs: use btrfs_pwrite in place of pwrite Naohiro Aota
2021-10-20 13:48 ` Josef Bacik
2021-10-20 17:01 ` David Sterba
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.