ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: fix uninitialized variable in ocfs2_dio_wr_get_block()
@ 2021-11-30 10:40 Dan Carpenter via Ocfs2-devel
  2021-12-01  2:24 ` Joseph Qi via Ocfs2-devel
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter via Ocfs2-devel @ 2021-11-30 10:40 UTC (permalink / raw)
  To: Mark Fasheh, Wengang Wang
  Cc: Sunil Mushran, kernel-janitors, linux-kernel, ocfs2-devel

The callers assume that "*fsdata" is set on the success path, but
that's not necessarily true on this path.

Fixes: 5cffff9e2986 ("ocfs2: Fix ocfs2_page_mkwrite()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Please review this one EXTRA CAREFULLY.  It's from static analysis and
the truth is I'm not 100% sure it's correct.  I'm also not sure that
it's a complete fix.

Especially, please review how this is called from ocfs2_write_begin()
to make sure that this doesn't break anything.


 fs/ocfs2/aops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 68d11c295dd3..a74a370f16f0 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1813,6 +1813,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
 	if (ret == -EAGAIN) {
 		BUG_ON(wc->w_target_page);
 		ret = 0;
+		*fsdata = wc;
 		goto out_quota;
 	}
 
-- 
2.20.1


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

end of thread, other threads:[~2021-12-06  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 10:40 [Ocfs2-devel] [PATCH] ocfs2: fix uninitialized variable in ocfs2_dio_wr_get_block() Dan Carpenter via Ocfs2-devel
2021-12-01  2:24 ` Joseph Qi via Ocfs2-devel
2021-12-06  6:03   ` Joseph Qi via Ocfs2-devel

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).