diff mbox series

[misc-next] btrfs: fix compilation error in btree_write_cache_pages()

Message ID 20200224202251.37787-1-johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series [misc-next] btrfs: fix compilation error in btree_write_cache_pages() | expand

Commit Message

Johannes Thumshirn Feb. 24, 2020, 8:22 p.m. UTC
CC [M]  fs/btrfs/extent_io.o
fs/btrfs/extent_io.c: In function ‘btree_write_cache_pages’:
fs/btrfs/extent_io.c:3959:34: error: ‘tree’ undeclared (first use in this function); did you mean ‘true’?
 3959 |  struct btrfs_fs_info *fs_info = tree->fs_info;
      |                                  ^~~~
      |                                  true
fs/btrfs/extent_io.c:3959:34: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:268: fs/btrfs/extent_io.o] Error 1
make[1]: *** [scripts/Makefile.build:505: fs/btrfs] Error 2
make: *** [Makefile:1681: fs] Error 2

Fixes: 75c39607eb0a ("btrfs: Don't submit any btree write bio if the fs has errors")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/extent_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcos Paulo de Souza Feb. 24, 2020, 9:30 p.m. UTC | #1
On Tue, 2020-02-25 at 05:22 +0900, Johannes Thumshirn wrote:
> CC [M]  fs/btrfs/extent_io.o
> fs/btrfs/extent_io.c: In function ‘btree_write_cache_pages’:
> fs/btrfs/extent_io.c:3959:34: error: ‘tree’ undeclared (first use in
> this function); did you mean ‘true’?
>  3959 |  struct btrfs_fs_info *fs_info = tree->fs_info;
>       |                                  ^~~~
>       |                                  true
> fs/btrfs/extent_io.c:3959:34: note: each undeclared identifier is
> reported only once for each function it appears in
> make[2]: *** [scripts/Makefile.build:268: fs/btrfs/extent_io.o] Error
> 1
> make[1]: *** [scripts/Makefile.build:505: fs/btrfs] Error 2
> make: *** [Makefile:1681: fs] Error 2
> 
> Fixes: 75c39607eb0a ("btrfs: Don't submit any btree write bio if the
> fs has errors")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Indeed, it fixes the build of misc-next.
Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com>

> ---
>  fs/btrfs/extent_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 903a85d8fbe3..837262d54e28 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3956,7 +3956,7 @@ int btree_write_cache_pages(struct
> address_space *mapping,
>  		.extent_locked = 0,
>  		.sync_io = wbc->sync_mode == WB_SYNC_ALL,
>  	};
> -	struct btrfs_fs_info *fs_info = tree->fs_info;
> +	struct btrfs_fs_info *fs_info = BTRFS_I(mapping->host)->root-
> >fs_info;
>  	int ret = 0;
>  	int done = 0;
>  	int nr_to_write_done = 0;
David Sterba Feb. 24, 2020, 11:28 p.m. UTC | #2
On Tue, Feb 25, 2020 at 05:22:51AM +0900, Johannes Thumshirn wrote:
> CC [M]  fs/btrfs/extent_io.o
> fs/btrfs/extent_io.c: In function ‘btree_write_cache_pages’:
> fs/btrfs/extent_io.c:3959:34: error: ‘tree’ undeclared (first use in this function); did you mean ‘true’?
>  3959 |  struct btrfs_fs_info *fs_info = tree->fs_info;
>       |                                  ^~~~
>       |                                  true
> fs/btrfs/extent_io.c:3959:34: note: each undeclared identifier is reported only once for each function it appears in
> make[2]: *** [scripts/Makefile.build:268: fs/btrfs/extent_io.o] Error 1
> make[1]: *** [scripts/Makefile.build:505: fs/btrfs] Error 2
> make: *** [Makefile:1681: fs] Error 2
> 
> Fixes: 75c39607eb0a ("btrfs: Don't submit any btree write bio if the fs has errors")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Folded, thanks.
Qu Wenruo Feb. 24, 2020, 11:54 p.m. UTC | #3
On 2020/2/25 上午4:22, Johannes Thumshirn wrote:
> CC [M]  fs/btrfs/extent_io.o
> fs/btrfs/extent_io.c: In function ‘btree_write_cache_pages’:
> fs/btrfs/extent_io.c:3959:34: error: ‘tree’ undeclared (first use in this function); did you mean ‘true’?
>  3959 |  struct btrfs_fs_info *fs_info = tree->fs_info;
>       |                                  ^~~~
>       |                                  true
> fs/btrfs/extent_io.c:3959:34: note: each undeclared identifier is reported only once for each function it appears in
> make[2]: *** [scripts/Makefile.build:268: fs/btrfs/extent_io.o] Error 1
> make[1]: *** [scripts/Makefile.build:505: fs/btrfs] Error 2
> make: *** [Makefile:1681: fs] Error 2
> 
> Fixes: 75c39607eb0a ("btrfs: Don't submit any btree write bio if the fs has errors")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Just for reference, that @tree is removed in commit 0bad2c5142ee
("btrfs: remove extent_page_data::tree").

Thanks for the fix,
Qu
> ---
>  fs/btrfs/extent_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 903a85d8fbe3..837262d54e28 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3956,7 +3956,7 @@ int btree_write_cache_pages(struct address_space *mapping,
>  		.extent_locked = 0,
>  		.sync_io = wbc->sync_mode == WB_SYNC_ALL,
>  	};
> -	struct btrfs_fs_info *fs_info = tree->fs_info;
> +	struct btrfs_fs_info *fs_info = BTRFS_I(mapping->host)->root->fs_info;
>  	int ret = 0;
>  	int done = 0;
>  	int nr_to_write_done = 0;
>
diff mbox series

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 903a85d8fbe3..837262d54e28 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3956,7 +3956,7 @@  int btree_write_cache_pages(struct address_space *mapping,
 		.extent_locked = 0,
 		.sync_io = wbc->sync_mode == WB_SYNC_ALL,
 	};
-	struct btrfs_fs_info *fs_info = tree->fs_info;
+	struct btrfs_fs_info *fs_info = BTRFS_I(mapping->host)->root->fs_info;
 	int ret = 0;
 	int done = 0;
 	int nr_to_write_done = 0;