* [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return
@ 2017-05-25 10:39 Jeff Layton
2017-05-26 17:08 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2017-05-25 10:39 UTC (permalink / raw)
To: Chris Mason, Josef Bacik, David Sterba; +Cc: linux-btrfs, Jan Kara, Liu Bo
Nothing checks its return value.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
---
fs/btrfs/disk-io.c | 6 +++---
fs/btrfs/disk-io.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 8685d67185d0..17acb72fed0f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1222,10 +1222,10 @@ int btrfs_write_tree_block(struct extent_buffer *buf)
buf->start + buf->len - 1);
}
-int btrfs_wait_tree_block_writeback(struct extent_buffer *buf)
+void btrfs_wait_tree_block_writeback(struct extent_buffer *buf)
{
- return filemap_fdatawait_range(buf->pages[0]->mapping,
- buf->start, buf->start + buf->len - 1);
+ filemap_fdatawait_range(buf->pages[0]->mapping,
+ buf->start, buf->start + buf->len - 1);
}
struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
index 21f1ceb85b76..f92f3e177d70 100644
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@ -127,7 +127,7 @@ int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode,
extent_submit_bio_hook_t *submit_bio_done);
unsigned long btrfs_async_submit_limit(struct btrfs_fs_info *info);
int btrfs_write_tree_block(struct extent_buffer *buf);
-int btrfs_wait_tree_block_writeback(struct extent_buffer *buf);
+void btrfs_wait_tree_block_writeback(struct extent_buffer *buf);
int btrfs_init_log_root_tree(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info);
int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
--
2.9.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return
2017-05-25 10:39 [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return Jeff Layton
@ 2017-05-26 17:08 ` David Sterba
2017-05-26 19:49 ` Liu Bo
0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2017-05-26 17:08 UTC (permalink / raw)
To: Jeff Layton
Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs, Jan Kara,
Liu Bo
On Thu, May 25, 2017 at 06:39:52AM -0400, Jeff Layton wrote:
> Nothing checks its return value.
I think we don't need to check the return value of
filemap_fdatawait_range, because the errors are tracked by other means
(attached to the btree_inode mapping that represents the metadata), in
set_btree_ioerr.
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
To Liu Bo:
May I ask if you did a review that matches the above understanding? It's
trivial to see that nothing really checks the return value of
btrfs_wait_tree_block_writeback but my question is if it's really safe
not to so. Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return
2017-05-26 17:08 ` David Sterba
@ 2017-05-26 19:49 ` Liu Bo
2017-05-29 13:30 ` David Sterba
0 siblings, 1 reply; 4+ messages in thread
From: Liu Bo @ 2017-05-26 19:49 UTC (permalink / raw)
To: dsterba, Jeff Layton, Chris Mason, Josef Bacik, David Sterba,
linux-btrfs, Jan Kara
On Fri, May 26, 2017 at 07:08:31PM +0200, David Sterba wrote:
> On Thu, May 25, 2017 at 06:39:52AM -0400, Jeff Layton wrote:
> > Nothing checks its return value.
>
> I think we don't need to check the return value of
> filemap_fdatawait_range, because the errors are tracked by other means
> (attached to the btree_inode mapping that represents the metadata), in
> set_btree_ioerr.
>
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > Reviewed-by: Jan Kara <jack@suse.cz>
> > Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
>
> To Liu Bo:
>
> May I ask if you did a review that matches the above understanding? It's
> trivial to see that nothing really checks the return value of
> btrfs_wait_tree_block_writeback but my question is if it's really safe
> not to so. Thanks.
About the question if it's safe not to do so, I think yes, it's used in
walk_log_tree which is called in two places, free_log_tree and log replay. For
free_log_tree, it waits for any running writeback of the extent buffer under
freeing to finish in case we need to access the eb pointer from page->private,
and it's OK to not check the return value, while for log replay, it's doesn't
wait because wc->wait is not set. So neither cares about the writeback error.
thanks,
-liubo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return
2017-05-26 19:49 ` Liu Bo
@ 2017-05-29 13:30 ` David Sterba
0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2017-05-29 13:30 UTC (permalink / raw)
To: Liu Bo
Cc: dsterba, Jeff Layton, Chris Mason, Josef Bacik, David Sterba,
linux-btrfs, Jan Kara
On Fri, May 26, 2017 at 12:49:25PM -0700, Liu Bo wrote:
> On Fri, May 26, 2017 at 07:08:31PM +0200, David Sterba wrote:
> > On Thu, May 25, 2017 at 06:39:52AM -0400, Jeff Layton wrote:
> > > Nothing checks its return value.
> >
> > I think we don't need to check the return value of
> > filemap_fdatawait_range, because the errors are tracked by other means
> > (attached to the btree_inode mapping that represents the metadata), in
> > set_btree_ioerr.
> >
> > > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > > Reviewed-by: Jan Kara <jack@suse.cz>
> > > Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
> >
> > To Liu Bo:
> >
> > May I ask if you did a review that matches the above understanding? It's
> > trivial to see that nothing really checks the return value of
> > btrfs_wait_tree_block_writeback but my question is if it's really safe
> > not to so. Thanks.
>
> About the question if it's safe not to do so, I think yes, it's used in
> walk_log_tree which is called in two places, free_log_tree and log replay. For
> free_log_tree, it waits for any running writeback of the extent buffer under
> freeing to finish in case we need to access the eb pointer from page->private,
> and it's OK to not check the return value, while for log replay, it's doesn't
> wait because wc->wait is not set. So neither cares about the writeback error.
Thanks, I'll update the changelog.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-29 13:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-25 10:39 [PATCH] btrfs: btrfs_wait_tree_block_writeback can be void return Jeff Layton
2017-05-26 17:08 ` David Sterba
2017-05-26 19:49 ` Liu Bo
2017-05-29 13:30 ` 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).