All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: axboe@kernel.dk, chaitanyak@nvidia.com, dlemoal@kernel.org,
	hare@suse.de, hch@lst.de, john.g.garry@oracle.com,
	linux-block@vger.kernel.org, linux-btrace@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	martin.petersen@oracle.com, mathieu.desnoyers@efficios.com,
	mhiramat@kernel.org, naohiro.aota@wdc.com, rostedt@goodmis.org,
	shinichiro.kawasaki@wdc.com
Subject: Re: [PATCH v3 16/16] blktrace: handle BLKTRACESETUP2 ioctl
Date: Thu, 16 Oct 2025 09:11:15 +0200	[thread overview]
Message-ID: <20251016071115.GH1417@lst.de> (raw)
In-Reply-To: <20251015105435.527088-17-johannes.thumshirn@wdc.com>

> +static int blk_trace_setup2(struct request_queue *q, char *name, dev_t dev,
> +			    struct block_device *bdev, char __user *arg)
> +{
> +	struct blk_user_trace_setup2 buts2;
> +	struct blk_trace *bt;
> +	int ret;
> +
> +	ret = copy_from_user(&buts2, arg, sizeof(buts2));
> +	if (ret)
> +		return -EFAULT;

You can simplify this to the more usual:

	if (copy_from_user(&buts2, arg, sizeof(buts2)))
		return -EFAULT;

> +
> +	if (!buts2.buf_size || !buts2.buf_nr)
> +		return -EINVAL;

This should probably also check that nothing is set in the flags field
so that it can be used for backwards compatible extensions?


      reply	other threads:[~2025-10-16  7:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 10:54 [PATCH v3 00/16] block: add blktrace support for zoned block devi Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 01/16] blktrace: only calculate trace length once Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 02/16] blktrace: factor out recording a blktrace event Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 03/16] blktrace: split out relaying " Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 04/16] blktrace: untangle if/else sequence in __blk_add_trace Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 05/16] blktrace: change the internal action to 64bit Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 06/16] blktrace: split do_blk_trace_setup into two functions Johannes Thumshirn
2025-10-16  7:01   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 07/16] blktrace: add definitions for blk_user_trace_setup2 Johannes Thumshirn
2025-10-16  7:05   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 08/16] blktrace: pass blk_user_trace2 to setup functions Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 09/16] blktrace: add definitions for struct blk_io_trace2 Johannes Thumshirn
2025-10-16  7:06   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 10/16] blktrace: differentiate between blk_io_trace versions Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 11/16] blktrace: move trace_note to blk_io_trace2 Johannes Thumshirn
2025-10-16  7:06   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 12/16] blktrace: move ftrace blk_io_tracer " Johannes Thumshirn
2025-10-16  7:07   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 13/16] blktrace: add block trace commands for zone operations Johannes Thumshirn
2025-10-16  7:08   ` Christoph Hellwig
2025-10-20 10:57     ` Johannes Thumshirn
2025-10-15 10:54 ` [PATCH v3 14/16] blktrace: expose ZONE APPEND completions to blktrace Johannes Thumshirn
2025-10-16  7:09   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 15/16] blktrace: trace zone write plugging operations Johannes Thumshirn
2025-10-16  7:09   ` Christoph Hellwig
2025-10-15 10:54 ` [PATCH v3 16/16] blktrace: handle BLKTRACESETUP2 ioctl Johannes Thumshirn
2025-10-16  7:11   ` Christoph Hellwig [this message]

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=20251016071115.GH1417@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=chaitanyak@nvidia.com \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrace@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=rostedt@goodmis.org \
    --cc=shinichiro.kawasaki@wdc.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 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.