All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: ceph-devel@vger.kernel.org
Cc: idryomov@gmail.com, dan.carpenter@oracle.com, sage@redhat.com
Subject: [PATCH 2/2] ceph: initialize base and pathlen variables in async dirops cb's
Date: Wed,  8 Apr 2020 10:21:25 -0400	[thread overview]
Message-ID: <20200408142125.52908-3-jlayton@kernel.org> (raw)
In-Reply-To: <20200408142125.52908-1-jlayton@kernel.org>

Ensure that the pr_warn messages look sane even if ceph_mdsc_build_path
fails.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/dir.c  | 4 ++--
 fs/ceph/file.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 10d528a455d5..93476d447a4b 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1057,8 +1057,8 @@ static void ceph_async_unlink_cb(struct ceph_mds_client *mdsc,
 
 	/* If op failed, mark everyone involved for errors */
 	if (result) {
-		int pathlen;
-		u64 base;
+		int pathlen = 0;
+		u64 base = 0;
 		char *path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
 						  &base, 0);
 
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 3a1bd13de84f..160644ddaeed 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -529,8 +529,8 @@ static void ceph_async_create_cb(struct ceph_mds_client *mdsc,
 
 	if (result) {
 		struct dentry *dentry = req->r_dentry;
-		int pathlen;
-		u64 base;
+		int pathlen = 0;
+		u64 base = 0;
 		char *path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
 						  &base, 0);
 
-- 
2.25.2

      parent reply	other threads:[~2020-04-08 14:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 14:21 [PATCH 0/2] ceph: fix error handling bugs in async dirops callbacks Jeff Layton
2020-04-08 14:21 ` [PATCH 1/2] ceph: have ceph_mdsc_free_path ignore ERR_PTR values Jeff Layton
2020-04-13  8:09   ` Ilya Dryomov
2020-04-13 11:15     ` Jeff Layton
2020-04-13 12:35       ` Ilya Dryomov
2020-04-13 13:23         ` Jeff Layton
2020-04-13 15:48           ` Ilya Dryomov
2020-04-13 16:03             ` Jeff Layton
2020-04-13 19:41           ` Dan Carpenter
2020-04-14 10:43             ` Jeff Layton
2020-04-08 14:21 ` Jeff Layton [this message]

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=20200408142125.52908-3-jlayton@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=idryomov@gmail.com \
    --cc=sage@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 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.