CEPH filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jeff Layton <jlayton@kernel.org>, David Howells <dhowells@redhat.com>
Cc: Xiubo Li <xiubli@redhat.com>, Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] ceph: uninitialized variable in debug output
Date: Mon, 7 Mar 2022 17:21:21 +0300	[thread overview]
Message-ID: <20220307142121.GB19660@kili> (raw)

If read_mapping_folio() fails then "inline_version" is printed without
being initialized.

Fixes: 083db6fd3e73 ("ceph: uninline the data on a file opened for writing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/ceph/addr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 3c1257b09775..0d4120297ede 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1632,9 +1632,10 @@ int ceph_uninline_data(struct file *file)
 	struct ceph_osd_request *req;
 	struct ceph_cap_flush *prealloc_cf;
 	struct folio *folio = NULL;
+	u64 inline_version = -1;
 	struct page *pages[1];
-	u64 len, inline_version;
 	int err = 0;
+	u64 len;
 
 	prealloc_cf = ceph_alloc_cap_flush();
 	if (!prealloc_cf)
-- 
2.20.1


             reply	other threads:[~2022-03-07 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 14:21 Dan Carpenter [this message]
2022-03-08  0:11 ` [PATCH] ceph: uninitialized variable in debug output Xiubo Li
2022-03-08  9:36 ` David Howells
2022-03-08 13:24   ` Jeff Layton
2022-03-08 13:28     ` Jeff Layton
2022-03-08 13:30       ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220307142121.GB19660@kili \
    --to=dan.carpenter@oracle.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=xiubli@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox