From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
To: Tarun Sahu <tsahu@linux.ibm.com>, nvdimm@lists.linux.dev
Cc: dan.j.williams@intel.com, vishal.l.verma@intel.com,
aneesh.kumar@linux.ibm.com, vaibhav@linux.ibm.com
Subject: Re: [PATCH 1/2] ndctl/namespace:Fix multiple issues with write-infoblock
Date: Mon, 25 Apr 2022 18:07:00 +0530 [thread overview]
Message-ID: <9eb7c528-3a7c-4e60-822a-57f7f673e215@linux.ibm.com> (raw)
In-Reply-To: <20220413035252.161527-2-tsahu@linux.ibm.com>
On 4/13/22 09:22, Tarun Sahu wrote:
> Write-infoblock command-
> 1. update the alignment to default value if not passed as parameter
> 2. convert any type of namespace to fsdax if parameter -m is not
> specified
> 3. Incorrectly updating the uuid and parent_uuid if corresponding
> parameter is not specified
>
May be rephrased to,
Write-infoblock command has the below issues,
1 - Oerwriting the existing alignment value with the default value when
not passed as parameter.
2 - Changing the mode of the namespace to fsdax when -m not specified
3 - Incorrectly updating the uuid and parent_uuid if corresponding
parameter is not specified
> Considering the above three issues, we first needed to read the
> original infoblock if available, and update the align, uuid, parent_uuid
> to its original value while writing the infoblock if corresponding
> parameter is not passed.
>
<snip>
>
> This patch change the declaration of following functions to pass
> ns_info,
>
> file_read_infoblock()
> file_write_infoblock()
> parse_namespace_infoblock()
> write_pfn_sb()
>
> Before and after the patch results:
The test results bloat up the commit log, just keep the "after" OR may
be move it below "---". Few of the implementation explanations from the
description summary can be moved down too. The commit log that way
will have crisp summary, and details being moved to the bottom of "---".
<snip>
> + ns_info_destroy(&ns_info);
> return rc;
> }
>
> @@ -2447,3 +2530,5 @@ int cmd_write_infoblock(int argc, const char **argv, struct ndctl_ctx *ctx)
> fprintf(stderr, "wrote %d infoblock%s\n", write, write == 1 ? "" : "s");
> return rc;
> }
> +
> +
Blank line insertions
> diff --git a/ndctl/namespace.h b/ndctl/namespace.h
> index 57735eb..a406c18 100644
> --- a/ndctl/namespace.h
> +++ b/ndctl/namespace.h
> @@ -8,6 +8,7 @@
> #include <util/fletcher.h>
> #include <ccan/endian/endian.h>
> #include <ccan/short_types/short_types.h>
> +#include <ndctl/libndctl.h>
>
> enum {
> NSINDEX_SIG_LEN = 16,
> @@ -233,6 +234,12 @@ union info_block {
> struct btt_sb btt_sb;
> };
>
> +struct ns_info {
> + void *ns_sb_buf;
> + enum ndctl_namespace_mode mode;
> + size_t offset;
> +};
> +
This structure is used only inside the namespace.c. Can be defined
in the namaespace.c itself instead of the header.
> static inline bool verify_infoblock_checksum(union info_block *sb)
> {
> uint64_t sum;
next prev parent reply other threads:[~2022-04-25 12:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 3:52 [PATCH 0/2] ndctl/namespace:Fix and improve write-infoblock Tarun Sahu
2022-04-13 3:52 ` [PATCH 1/2] ndctl/namespace:Fix multiple issues with write-infoblock Tarun Sahu
2022-04-25 12:37 ` Shivaprasad G Bhat [this message]
2022-04-13 3:52 ` [PATCH 2/2] ndctl/namespace:Implement write-infoblock for sector mode namespaces Tarun Sahu
2022-04-25 12:37 ` Shivaprasad G Bhat
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=9eb7c528-3a7c-4e60-822a-57f7f673e215@linux.ibm.com \
--to=sbhat@linux.ibm.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=dan.j.williams@intel.com \
--cc=nvdimm@lists.linux.dev \
--cc=tsahu@linux.ibm.com \
--cc=vaibhav@linux.ibm.com \
--cc=vishal.l.verma@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