[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017043157.GB30271@lst.de>
Date: Fri, 17 Oct 2025 06:31:57 +0200
From: Christoph Hellwig <hch@....de>
To: alistair23@...il.com
Cc: chuck.lever@...cle.com, hare@...nel.org,
kernel-tls-handshake@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-nfs@...r.kernel.org,
kbusch@...nel.org, axboe@...nel.dk, hch@....de, sagi@...mberg.me,
kch@...dia.com, hare@...e.de,
Alistair Francis <alistair.francis@....com>
Subject: Re: [PATCH v4 6/7] nvme-tcp: Allow userspace to trigger a
KeyUpdate with debugfs
On Fri, Oct 17, 2025 at 02:23:11PM +1000, alistair23@...il.com wrote:
> +#ifdef CONFIG_NVME_TCP_TLS
> +#define NVME_DEBUGFS_RW_ATTR(field) \
> + static int field##_open(struct inode *inode, struct file *file) \
> + { return single_open(file, field##_show, inode->i_private); } \
Please use normal indentation in the macro, but do not add an extra
level of indentation just for being inside a macro.
Then again the macro is only used once anyway, so why add it at all?
> +static ssize_t nvme_ctrl_key_update_write(struct file *file, const char __user *buf,
Please avoid the overly long line.
> + size_t count, loff_t *ppos)
> +{
> + struct seq_file *m = file->private_data;
> + struct nvme_ctrl *nctrl = m->private;
> + struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
> + char kbuf[16] = {0};
> + int queue_nr, rc;
> + struct nvme_tcp_queue *queue;
> +
> + if (count > sizeof(kbuf) - 1)
> + return -EINVAL;
> + if (copy_from_user(kbuf, buf, count))
> + return -EFAULT;
> + kbuf[count] = 0;
> +
> + rc = kstrtouint(kbuf, 10, &queue_nr);
> + if (rc)
> + return rc;
kstrtoint_from_user?
Powered by blists - more mailing lists