From: Christoph Hellwig <hch@lst.de>
To: Anthony Iliopoulos <ailiop@suse.com>
Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
Christoph Hellwig <hch@lst.de>,
Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH] nvmet: add revalidation support to bdev and file backed namespaces
Date: Fri, 3 Apr 2020 08:43:31 +0200 [thread overview]
Message-ID: <20200403064331.GA23270@lst.de> (raw)
In-Reply-To: <20200402193052.19935-1-ailiop@suse.com>
On Thu, Apr 02, 2020 at 09:30:52PM +0200, Anthony Iliopoulos wrote:
> Add support for detecting capacity changes on nvmet blockdev and file
> backed namespaces. This allows for emulating and testing online resizing
> of nvme devices and filesystems on top.
>
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
I vaguely remember seeing a very similar patch before, is this a repost?
> +void nvmet_bdev_ns_revalidate(struct nvmet_ns *ns)
> +{
> + loff_t size;
> +
> + size = i_size_read(ns->bdev->bd_inode);
> +
> + if (ns->size != size)
> + ns->size = size;
This can be:
ns->size = i_size_read(ns->bdev->bd_inode);
> +void nvmet_file_ns_revalidate(struct nvmet_ns *ns)
> +{
> + struct kstat stat;
> +
> + if (!ns->file)
> + return;
Shouldn't this always be non-NULL?
> +
> + if (vfs_getattr(&ns->file->f_path,
> + &stat, STATX_SIZE, AT_STATX_FORCE_SYNC))
> + return;
Use up the full line:
if (vfs_getattr(&ns->file->f_path, &stat, STATX_SIZE,
AT_STATX_FORCE_SYNC))
Also shouldn't there be error handling? If we can't stat the file
the namespace is toast.
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Anthony Iliopoulos <ailiop@suse.com>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmet: add revalidation support to bdev and file backed namespaces
Date: Fri, 3 Apr 2020 08:43:31 +0200 [thread overview]
Message-ID: <20200403064331.GA23270@lst.de> (raw)
In-Reply-To: <20200402193052.19935-1-ailiop@suse.com>
On Thu, Apr 02, 2020 at 09:30:52PM +0200, Anthony Iliopoulos wrote:
> Add support for detecting capacity changes on nvmet blockdev and file
> backed namespaces. This allows for emulating and testing online resizing
> of nvme devices and filesystems on top.
>
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
I vaguely remember seeing a very similar patch before, is this a repost?
> +void nvmet_bdev_ns_revalidate(struct nvmet_ns *ns)
> +{
> + loff_t size;
> +
> + size = i_size_read(ns->bdev->bd_inode);
> +
> + if (ns->size != size)
> + ns->size = size;
This can be:
ns->size = i_size_read(ns->bdev->bd_inode);
> +void nvmet_file_ns_revalidate(struct nvmet_ns *ns)
> +{
> + struct kstat stat;
> +
> + if (!ns->file)
> + return;
Shouldn't this always be non-NULL?
> +
> + if (vfs_getattr(&ns->file->f_path,
> + &stat, STATX_SIZE, AT_STATX_FORCE_SYNC))
> + return;
Use up the full line:
if (vfs_getattr(&ns->file->f_path, &stat, STATX_SIZE,
AT_STATX_FORCE_SYNC))
Also shouldn't there be error handling? If we can't stat the file
the namespace is toast.
next prev parent reply other threads:[~2020-04-03 6:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 19:30 [PATCH] nvmet: add revalidation support to bdev and file backed namespaces Anthony Iliopoulos
2020-04-02 19:30 ` Anthony Iliopoulos
2020-04-02 22:14 ` Sagi Grimberg
2020-04-02 22:14 ` Sagi Grimberg
2020-04-03 6:43 ` Christoph Hellwig [this message]
2020-04-03 6:43 ` Christoph Hellwig
2020-04-06 8:03 ` Anthony Iliopoulos
2020-04-06 8:03 ` Anthony Iliopoulos
2020-04-03 20:23 ` Chaitanya Kulkarni
2020-04-03 20:23 ` Chaitanya Kulkarni
2020-04-03 20:28 ` Chaitanya Kulkarni
2020-04-03 20:28 ` Chaitanya Kulkarni
2020-04-03 20:29 ` Chaitanya Kulkarni
2020-04-03 20:29 ` Chaitanya Kulkarni
2020-04-03 20:32 ` Chaitanya Kulkarni
2020-04-03 20:32 ` Chaitanya Kulkarni
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=20200403064331.GA23270@lst.de \
--to=hch@lst.de \
--cc=ailiop@suse.com \
--cc=chaitanya.kulkarni@wdc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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.