From: Levente Kurusa <levex@linux.com>
To: Peng Tao <bergwolf@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Mikhail Pershin <mike.pershin@intel.com>,
Andreas Dilger <andreas.dilger@intel.com>
Subject: Re: [PATCH v2 02/12] staging/lustre/llog: MGC to use OSD API for backup logs
Date: Tue, 26 Nov 2013 19:33:00 +0100 [thread overview]
Message-ID: <5294E95C.7050902@linux.com> (raw)
In-Reply-To: <1385478286-5525-3-git-send-email-bergwolf@gmail.com>
Hi,
just a few comments, mostly code style.
2013-11-26 16:04, Peng Tao:
> @@ -1011,23 +1083,17 @@ int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,
> }
> if (KEY_IS(KEY_SET_FS)) {
> struct super_block *sb = (struct super_block *)val;
> - struct lustre_sb_info *lsi;
> +
> if (vallen != sizeof(struct super_block))
> return -EINVAL;
> - lsi = s2lsi(sb);
> - rc = mgc_fs_setup(exp->exp_obd, sb, lsi->lsi_srv_mnt);
> - if (rc) {
> - CERROR("set_fs got %d\n", rc);
> - }
> +
> + rc = mgc_fs_setup(exp->exp_obd, sb);
> return rc;
Why set rc when you return it on the next statement?
Wouldn't 'return mgc_fs_setup(exp->exp_obd, sb);' be better?
> }
> if (KEY_IS(KEY_CLEAR_FS)) {
> if (vallen != 0)
> return -EINVAL;
> rc = mgc_fs_cleanup(exp->exp_obd);
> - if (rc) {
> - CERROR("clear_fs got %d\n", rc);
> - }
> return rc;
Same here possibly.
> + /* Copy the setup log locally if we can. Don't mess around if we're
> + * running an MGS though (logs are already local). */
> + if (lctxt && lsi && IS_SERVER(lsi) && !IS_MGS(lsi) &&
> + cli->cl_mgc_configs_dir != NULL &&
> + lu2dt_dev(cli->cl_mgc_configs_dir->do_lu.lo_dev) ==
> + lsi->lsi_dt_dev) {
I think that is *really* ugly!
(The last comparison is separated into two lines)
--
Regards,
Levente Kurusa
next prev parent reply other threads:[~2013-11-26 18:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 15:04 [PATCH v2 00/12] staging/lustre: sync with extern tree, set 2 Peng Tao
2013-11-26 15:04 ` [PATCH v2 01/12] Revert "staging/lustre/nfs: writing to new files will return ENOENT" Peng Tao
2013-11-26 15:04 ` [PATCH v2 02/12] staging/lustre/llog: MGC to use OSD API for backup logs Peng Tao
2013-11-26 18:33 ` Levente Kurusa [this message]
2013-11-26 15:04 ` [PATCH v2 03/12] staging/lustre: constify uuid argument of obd_uuid2str Peng Tao
2013-11-26 15:04 ` [PATCH v2 04/12] staging/lustre: make obd_uuid_equals return bool Peng Tao
2013-11-26 15:04 ` [PATCH v2 05/12] staging/lustre/scrub: OI scrub on OST Peng Tao
2013-11-26 15:04 ` [PATCH v2 06/12] staging/lustre: make code align in lma_incompat Peng Tao
2013-11-26 15:04 ` [PATCH v2 07/12] staging/lustre/llite: don't check for O_CREAT in it_create_mode Peng Tao
2013-11-26 15:04 ` [PATCH v2 08/12] staging/lustre/build: clean up unused variables and dead code Peng Tao
2013-11-26 15:04 ` [PATCH v2 09/12] staging/lustre/build: fix compilation issue with is_compat_task Peng Tao
2013-11-26 15:04 ` [PATCH v2 10/12] staging/lustre/ptlrpc: Fix a crash when dereferencing NULL pointer Peng Tao
2013-11-26 15:04 ` [PATCH v2 11/12] staging/lustre/hsm: Add hsm_release feature Peng Tao
2013-11-26 15:04 ` [PATCH v2 12/12] staging/lustre/llite: extended attribute cache Peng Tao
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=5294E95C.7050902@linux.com \
--to=levex@linux.com \
--cc=andreas.dilger@intel.com \
--cc=bergwolf@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.pershin@intel.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