diff mbox series

[-next] ext4: Fix build error while CONFIG_PRINTK is n

Message ID 20200401073038.33076-1-yuehaibing@huawei.com
State Superseded
Headers show
Series [-next] ext4: Fix build error while CONFIG_PRINTK is n | expand

Commit Message

Yue Haibing April 1, 2020, 7:30 a.m. UTC
fs/ext4/balloc.c: In function ‘ext4_wait_block_bitmap’:
fs/ext4/balloc.c:519:3: error: implicit declaration of function ‘ext4_error_err’; did you mean ‘ext4_error’? [-Werror=implicit-function-declaration]
   ext4_error_err(sb, EIO, "Cannot read block bitmap - "
   ^~~~~~~~~~~~~~

Add missing stub helper and fix ext4_abort.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 2ea2fc775321 ("ext4: save all error info in save_error_info() and drop ext4_set_errno()")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/ext4/ext4.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Theodore Ts'o April 1, 2020, 9:28 p.m. UTC | #1
On Wed, Apr 01, 2020 at 03:30:38PM +0800, YueHaibing wrote:
> fs/ext4/balloc.c: In function ‘ext4_wait_block_bitmap’:
> fs/ext4/balloc.c:519:3: error: implicit declaration of function ‘ext4_error_err’; did you mean ‘ext4_error’? [-Werror=implicit-function-declaration]
>    ext4_error_err(sb, EIO, "Cannot read block bitmap - "
>    ^~~~~~~~~~~~~~
> 
> Add missing stub helper and fix ext4_abort.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 2ea2fc775321 ("ext4: save all error info in save_error_info() and drop ext4_set_errno()")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Thanks; the patch isn't quite correct, though.  This is what I merged
into my tree's version of the "save all error info..." commit.

     	       	       	      	    	      - Ted

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index eacd2f9cc833..91eb4381cae5 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2848,6 +2848,11 @@ do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
 	__ext4_error_inode(inode, "", 0, block, 0, " ");		\
 } while (0)
+#define ext4_error_inode_err(inode, func, line, block, err, fmt, ...)	\
+do {									\
+	no_printk(fmt, ##__VA_ARGS__);					\
+	__ext4_error_inode(inode, "", 0, block, err, " ");		\
+} while (0)
 #define ext4_error_file(file, func, line, block, fmt, ...)		\
 do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
@@ -2858,10 +2863,15 @@ do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
 	__ext4_error(sb, "", 0, 0, 0, " ");				\
 } while (0)
-#define ext4_abort(sb, fmt, ...)					\
+#define ext4_error_err(sb, err, fmt, ...)				\
+do {									\
+	no_printk(fmt, ##__VA_ARGS__);					\
+	__ext4_error(sb, "", 0, err, 0, " ");				\
+} while (0)
+#define ext4_abort(sb, err, fmt, ...)					\
 do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
-	__ext4_abort(sb, "", 0, " ");					\
+	__ext4_abort(sb, "", 0, err, " ");				\
 } while (0)
 #define ext4_warning(sb, fmt, ...)					\
 do {									\
Yue Haibing April 2, 2020, 2:29 a.m. UTC | #2
On 2020/4/2 5:28, Theodore Y. Ts'o wrote:
> On Wed, Apr 01, 2020 at 03:30:38PM +0800, YueHaibing wrote:
>> fs/ext4/balloc.c: In function ‘ext4_wait_block_bitmap’:
>> fs/ext4/balloc.c:519:3: error: implicit declaration of function ‘ext4_error_err’; did you mean ‘ext4_error’? [-Werror=implicit-function-declaration]
>>    ext4_error_err(sb, EIO, "Cannot read block bitmap - "
>>    ^~~~~~~~~~~~~~
>>
>> Add missing stub helper and fix ext4_abort.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Fixes: 2ea2fc775321 ("ext4: save all error info in save_error_info() and drop ext4_set_errno()")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Thanks; the patch isn't quite correct, though.  This is what I merged
> into my tree's version of the "save all error info..." commit.
> 
>      	       	       	      	    	      - Ted
> 

Ok, good to know this and thansk!

> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index eacd2f9cc833..91eb4381cae5 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -2848,6 +2848,11 @@ do {									\
>  	no_printk(fmt, ##__VA_ARGS__);					\
>  	__ext4_error_inode(inode, "", 0, block, 0, " ");		\
>  } while (0)
> +#define ext4_error_inode_err(inode, func, line, block, err, fmt, ...)	\
> +do {									\
> +	no_printk(fmt, ##__VA_ARGS__);					\
> +	__ext4_error_inode(inode, "", 0, block, err, " ");		\
> +} while (0)
>  #define ext4_error_file(file, func, line, block, fmt, ...)		\
>  do {									\
>  	no_printk(fmt, ##__VA_ARGS__);					\
> @@ -2858,10 +2863,15 @@ do {									\
>  	no_printk(fmt, ##__VA_ARGS__);					\
>  	__ext4_error(sb, "", 0, 0, 0, " ");				\
>  } while (0)
> -#define ext4_abort(sb, fmt, ...)					\
> +#define ext4_error_err(sb, err, fmt, ...)				\
> +do {									\
> +	no_printk(fmt, ##__VA_ARGS__);					\
> +	__ext4_error(sb, "", 0, err, 0, " ");				\
> +} while (0)
> +#define ext4_abort(sb, err, fmt, ...)					\
>  do {									\
>  	no_printk(fmt, ##__VA_ARGS__);					\
> -	__ext4_abort(sb, "", 0, " ");					\
> +	__ext4_abort(sb, "", 0, err, " ");				\
>  } while (0)
>  #define ext4_warning(sb, fmt, ...)					\
>  do {									\
> 
> .
>
diff mbox series

Patch

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index eacd2f9cc833..aa8466d28787 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2848,6 +2848,11 @@  do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
 	__ext4_error_inode(inode, "", 0, block, 0, " ");		\
 } while (0)
+#define ext4_error_inode_err(inode, func, line, block, err, fmt, ...)	\
+do {									\
+	no_printk(fmt, ##__VA_ARGS__);					\
+	__ext4_error_inode(inode, "", 0, block, 0, " ");		\
+} while (0)
 #define ext4_error_file(file, func, line, block, fmt, ...)		\
 do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
@@ -2858,10 +2863,15 @@  do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
 	__ext4_error(sb, "", 0, 0, 0, " ");				\
 } while (0)
-#define ext4_abort(sb, fmt, ...)					\
+#define ext4_error_err(sb, err, fmt, ...)				\
+do {									\
+	no_printk(fmt, ##__VA_ARGS__);					\
+	__ext4_error((sb), "", 0, 0, 0, " ");				\
+} while (0)
+#define ext4_abort(sb, err, fmt, ...)					\
 do {									\
 	no_printk(fmt, ##__VA_ARGS__);					\
-	__ext4_abort(sb, "", 0, " ");					\
+	__ext4_abort(sb, "", 0, 0, " ");				\
 } while (0)
 #define ext4_warning(sb, fmt, ...)					\
 do {									\