All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gfs2: remove assertion when journal_info is not empty
@ 2019-12-15 16:46 ` Aditya Pakki
  0 siblings, 0 replies; 4+ messages in thread
From: Aditya Pakki @ 2019-12-15 16:46 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Bob Peterson, Andreas Gruenbacher, cluster-devel, linux-kernel

In gfs2_trans_begin, avoid crashing when current->journal_info
is not empty. The patch fixes  the error by returning -EINVAL
instead of crashing.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 fs/gfs2/trans.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 9d4227330de4..cef8816ae0b4 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -31,7 +31,9 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
 	struct gfs2_trans *tr;
 	int error;
 
-	BUG_ON(current->journal_info);
+	if (current->journal_info)
+		return -EINVAL;
+
 	BUG_ON(blocks == 0 && revokes == 0);
 
 	if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH] gfs2: remove assertion when journal_info is not empty
@ 2019-12-15 16:46 ` Aditya Pakki
  0 siblings, 0 replies; 4+ messages in thread
From: Aditya Pakki @ 2019-12-15 16:46 UTC (permalink / raw)
  To: cluster-devel.redhat.com

In gfs2_trans_begin, avoid crashing when current->journal_info
is not empty. The patch fixes  the error by returning -EINVAL
instead of crashing.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 fs/gfs2/trans.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 9d4227330de4..cef8816ae0b4 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -31,7 +31,9 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
 	struct gfs2_trans *tr;
 	int error;
 
-	BUG_ON(current->journal_info);
+	if (current->journal_info)
+		return -EINVAL;
+
 	BUG_ON(blocks == 0 && revokes == 0);
 
 	if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gfs2: remove assertion when journal_info is not empty
  2019-12-15 16:46 ` [Cluster-devel] " Aditya Pakki
@ 2019-12-15 19:50   ` Andreas Gruenbacher
  -1 siblings, 0 replies; 4+ messages in thread
From: Andreas Gruenbacher @ 2019-12-15 19:50 UTC (permalink / raw)
  To: Aditya Pakki; +Cc: kjlu, Bob Peterson, cluster-devel, LKML

Hello Aditya,

On Sun, Dec 15, 2019 at 5:46 PM Aditya Pakki <pakki001@umn.edu> wrote:
> In gfs2_trans_begin, avoid crashing when current->journal_info
> is not empty. The patch fixes  the error by returning -EINVAL
> instead of crashing.

can you please explain when that patch is needed? Do you have a test
case to reproduce?

Thanks,
Andreas


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cluster-devel] [PATCH] gfs2: remove assertion when journal_info is not empty
@ 2019-12-15 19:50   ` Andreas Gruenbacher
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Gruenbacher @ 2019-12-15 19:50 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hello Aditya,

On Sun, Dec 15, 2019 at 5:46 PM Aditya Pakki <pakki001@umn.edu> wrote:
> In gfs2_trans_begin, avoid crashing when current->journal_info
> is not empty. The patch fixes  the error by returning -EINVAL
> instead of crashing.

can you please explain when that patch is needed? Do you have a test
case to reproduce?

Thanks,
Andreas




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-15 19:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-15 16:46 [PATCH] gfs2: remove assertion when journal_info is not empty Aditya Pakki
2019-12-15 16:46 ` [Cluster-devel] " Aditya Pakki
2019-12-15 19:50 ` Andreas Gruenbacher
2019-12-15 19:50   ` [Cluster-devel] " Andreas Gruenbacher

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.