* [PATCH 1/3] reiser4: fix filesystem init error path.
@ 2015-09-13 23:08 Ivan Shapovalov
2015-09-13 23:08 ` [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code Ivan Shapovalov
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ivan Shapovalov @ 2015-09-13 23:08 UTC (permalink / raw)
To: reiserfs-devel; +Cc: Edward Shishkin, Ivan Shapovalov
Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
---
fs/reiser4/super_ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/reiser4/super_ops.c b/fs/reiser4/super_ops.c
index 76c16af..2afaf3b 100644
--- a/fs/reiser4/super_ops.c
+++ b/fs/reiser4/super_ops.c
@@ -623,9 +623,9 @@ static int fill_super(struct super_block *super, void *data, int silent)
reiser4_done_txnmgr(&sbinfo->tmgr);
failed_init_read_super:
failed_init_super_data:
+ failed_init_csum_tfm:
reiser4_done_fs_info(super);
failed_init_sinfo:
- failed_init_csum_tfm:
reiser4_exit_context(&ctx);
return result;
}
--
2.5.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code.
2015-09-13 23:08 [PATCH 1/3] reiser4: fix filesystem init error path Ivan Shapovalov
@ 2015-09-13 23:08 ` Ivan Shapovalov
2015-09-14 7:52 ` Edward Shishkin
2015-09-13 23:08 ` [PATCH 3/3] reiser4: report an error on checksum engine load failure Ivan Shapovalov
2015-09-14 7:51 ` [PATCH 1/3] reiser4: fix filesystem init error path Edward Shishkin
2 siblings, 1 reply; 6+ messages in thread
From: Ivan Shapovalov @ 2015-09-13 23:08 UTC (permalink / raw)
To: reiserfs-devel; +Cc: Edward Shishkin, Ivan Shapovalov
Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
---
This is responsible for the oops on mount reported by Jose (also experienced
by me). The problem is that IS_ERR() works only for negative error codes,
so somewhere in the VFS an error path is incorrectly not taken.
fs/reiser4/checksum.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/reiser4/checksum.c b/fs/reiser4/checksum.c
index a5052b0..73d40f0 100644
--- a/fs/reiser4/checksum.c
+++ b/fs/reiser4/checksum.c
@@ -4,11 +4,13 @@
int reiser4_init_csum_tfm(struct crypto_shash **tfm)
{
- *tfm = crypto_alloc_shash("crc32c", 0, 0);
- if (IS_ERR(*tfm)) {
- *tfm = NULL;
- return 1;
- }
+ struct crypto_shash *new_tfm;
+
+ new_tfm = crypto_alloc_shash("crc32c", 0, 0);
+ if (IS_ERR(new_tfm))
+ return PTR_ERR(new_tfm);
+
+ *tfm = new_tfm;
return 0;
}
--
2.5.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] reiser4: report an error on checksum engine load failure.
2015-09-13 23:08 [PATCH 1/3] reiser4: fix filesystem init error path Ivan Shapovalov
2015-09-13 23:08 ` [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code Ivan Shapovalov
@ 2015-09-13 23:08 ` Ivan Shapovalov
2015-09-14 7:53 ` Edward Shishkin
2015-09-14 7:51 ` [PATCH 1/3] reiser4: fix filesystem init error path Edward Shishkin
2 siblings, 1 reply; 6+ messages in thread
From: Ivan Shapovalov @ 2015-09-13 23:08 UTC (permalink / raw)
To: reiserfs-devel; +Cc: Edward Shishkin, Ivan Shapovalov
It is apparently not possible to specify explicit module dependencies.
For well-formed setups this is not a problem because
crypto_alloc_shash() uses request_module() internally, but if one needs
reiser4, say, in initramfs, then the checksum module must be added
manually.
Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
---
fs/reiser4/checksum.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/reiser4/checksum.c b/fs/reiser4/checksum.c
index 73d40f0..2a35f42 100644
--- a/fs/reiser4/checksum.c
+++ b/fs/reiser4/checksum.c
@@ -7,8 +7,10 @@ int reiser4_init_csum_tfm(struct crypto_shash **tfm)
struct crypto_shash *new_tfm;
new_tfm = crypto_alloc_shash("crc32c", 0, 0);
- if (IS_ERR(new_tfm))
+ if (IS_ERR(new_tfm)) {
+ warning("intelfx-81", "Could not load crc32c driver");
return PTR_ERR(new_tfm);
+ }
*tfm = new_tfm;
return 0;
--
2.5.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] reiser4: fix filesystem init error path.
2015-09-13 23:08 [PATCH 1/3] reiser4: fix filesystem init error path Ivan Shapovalov
2015-09-13 23:08 ` [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code Ivan Shapovalov
2015-09-13 23:08 ` [PATCH 3/3] reiser4: report an error on checksum engine load failure Ivan Shapovalov
@ 2015-09-14 7:51 ` Edward Shishkin
2 siblings, 0 replies; 6+ messages in thread
From: Edward Shishkin @ 2015-09-14 7:51 UTC (permalink / raw)
To: Ivan Shapovalov, reiserfs-devel
OK
On 09/14/2015 01:08 AM, Ivan Shapovalov wrote:
> Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
> ---
> fs/reiser4/super_ops.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/reiser4/super_ops.c b/fs/reiser4/super_ops.c
> index 76c16af..2afaf3b 100644
> --- a/fs/reiser4/super_ops.c
> +++ b/fs/reiser4/super_ops.c
> @@ -623,9 +623,9 @@ static int fill_super(struct super_block *super, void *data, int silent)
> reiser4_done_txnmgr(&sbinfo->tmgr);
> failed_init_read_super:
> failed_init_super_data:
> + failed_init_csum_tfm:
> reiser4_done_fs_info(super);
> failed_init_sinfo:
> - failed_init_csum_tfm:
> reiser4_exit_context(&ctx);
> return result;
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code.
2015-09-13 23:08 ` [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code Ivan Shapovalov
@ 2015-09-14 7:52 ` Edward Shishkin
0 siblings, 0 replies; 6+ messages in thread
From: Edward Shishkin @ 2015-09-14 7:52 UTC (permalink / raw)
To: Ivan Shapovalov, reiserfs-devel
OK.
Thanks!
On 09/14/2015 01:08 AM, Ivan Shapovalov wrote:
> Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
> ---
>
> This is responsible for the oops on mount reported by Jose (also experienced
> by me). The problem is that IS_ERR() works only for negative error codes,
> so somewhere in the VFS an error path is incorrectly not taken.
>
> fs/reiser4/checksum.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/fs/reiser4/checksum.c b/fs/reiser4/checksum.c
> index a5052b0..73d40f0 100644
> --- a/fs/reiser4/checksum.c
> +++ b/fs/reiser4/checksum.c
> @@ -4,11 +4,13 @@
>
> int reiser4_init_csum_tfm(struct crypto_shash **tfm)
> {
> - *tfm = crypto_alloc_shash("crc32c", 0, 0);
> - if (IS_ERR(*tfm)) {
> - *tfm = NULL;
> - return 1;
> - }
> + struct crypto_shash *new_tfm;
> +
> + new_tfm = crypto_alloc_shash("crc32c", 0, 0);
> + if (IS_ERR(new_tfm))
> + return PTR_ERR(new_tfm);
> +
> + *tfm = new_tfm;
> return 0;
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] reiser4: report an error on checksum engine load failure.
2015-09-13 23:08 ` [PATCH 3/3] reiser4: report an error on checksum engine load failure Ivan Shapovalov
@ 2015-09-14 7:53 ` Edward Shishkin
0 siblings, 0 replies; 6+ messages in thread
From: Edward Shishkin @ 2015-09-14 7:53 UTC (permalink / raw)
To: Ivan Shapovalov, reiserfs-devel
OK
On 09/14/2015 01:08 AM, Ivan Shapovalov wrote:
> It is apparently not possible to specify explicit module dependencies.
> For well-formed setups this is not a problem because
> crypto_alloc_shash() uses request_module() internally, but if one needs
> reiser4, say, in initramfs, then the checksum module must be added
> manually.
>
> Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
> ---
> fs/reiser4/checksum.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/reiser4/checksum.c b/fs/reiser4/checksum.c
> index 73d40f0..2a35f42 100644
> --- a/fs/reiser4/checksum.c
> +++ b/fs/reiser4/checksum.c
> @@ -7,8 +7,10 @@ int reiser4_init_csum_tfm(struct crypto_shash **tfm)
> struct crypto_shash *new_tfm;
>
> new_tfm = crypto_alloc_shash("crc32c", 0, 0);
> - if (IS_ERR(new_tfm))
> + if (IS_ERR(new_tfm)) {
> + warning("intelfx-81", "Could not load crc32c driver");
> return PTR_ERR(new_tfm);
> + }
>
> *tfm = new_tfm;
> return 0;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-14 7:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-13 23:08 [PATCH 1/3] reiser4: fix filesystem init error path Ivan Shapovalov
2015-09-13 23:08 ` [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code Ivan Shapovalov
2015-09-14 7:52 ` Edward Shishkin
2015-09-13 23:08 ` [PATCH 3/3] reiser4: report an error on checksum engine load failure Ivan Shapovalov
2015-09-14 7:53 ` Edward Shishkin
2015-09-14 7:51 ` [PATCH 1/3] reiser4: fix filesystem init error path Edward Shishkin
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).