From: Artem Bityutskiy <dedekind1@gmail.com>
To: Phil Carmody <ext-phil.2.carmody@nokia.com>,
MTD list <linux-mtd@lists.infradead.org>
Subject: [PATCH 1/2] UBIFS: unify error path dbg_debugfs_init_fs
Date: Fri, 1 Apr 2011 10:25:29 +0300 [thread overview]
Message-ID: <1301642730-9582-2-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1301642730-9582-1-git-send-email-dedekind1@gmail.com>
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This is just a small clean-up patch which simlifies and unifies the
error path in the dbg_debugfs_init_fs(). We have common error path
for all failure cases in this function except of the very first
case. And this patch makes the first failure case use the same
error path as the other cases by using the 'fname' and 'dent'
variables.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
fs/ubifs/debug.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 68cc992..4abaf72 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2807,13 +2807,11 @@ int dbg_debugfs_init_fs(struct ubifs_info *c)
struct ubifs_debug_info *d = c->dbg;
sprintf(d->dfs_dir_name, "ubi%d_%d", c->vi.ubi_num, c->vi.vol_id);
- d->dfs_dir = debugfs_create_dir(d->dfs_dir_name, dfs_rootdir);
- if (IS_ERR(d->dfs_dir)) {
- err = PTR_ERR(d->dfs_dir);
- ubifs_err("cannot create \"%s\" debugfs directory, error %d\n",
- d->dfs_dir_name, err);
+ fname = d->dfs_dir_name;
+ dent = debugfs_create_dir(fname, dfs_rootdir);
+ if (IS_ERR(dent))
goto out;
- }
+ d->dfs_dir = dent;
fname = "dump_lprops";
dent = debugfs_create_file(fname, S_IWUSR, d->dfs_dir, c, &dfs_fops);
@@ -2836,11 +2834,11 @@ int dbg_debugfs_init_fs(struct ubifs_info *c)
return 0;
out_remove:
+ debugfs_remove_recursive(d->dfs_dir);
+out:
err = PTR_ERR(dent);
ubifs_err("cannot create \"%s\" debugfs directory, error %d\n",
fname, err);
- debugfs_remove_recursive(d->dfs_dir);
-out:
return err;
}
--
1.7.2.3
next prev parent reply other threads:[~2011-04-01 7:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 7:25 [PATCH 0/2] UBIFS: fix error path in dbg_debugfs_init_fs Artem Bityutskiy
2011-04-01 7:25 ` Artem Bityutskiy [this message]
2011-04-01 7:25 ` [PATCH 2/2] " Artem Bityutskiy
2011-04-01 10:00 ` [PATCH 0/2] " Phil Carmody
2011-04-04 7:07 ` Artem Bityutskiy
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=1301642730-9582-2-git-send-email-dedekind1@gmail.com \
--to=dedekind1@gmail.com \
--cc=ext-phil.2.carmody@nokia.com \
--cc=linux-mtd@lists.infradead.org \
/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