mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Gadi Oxman <gadio@netvision.net.il>, Jens Axboe <axboe@suse.de>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH][2/2] ide-tape: small cleanups - handle copy_to|from_user() failures
Date: Sun, 28 Nov 2004 17:34:28 +0000	[thread overview]
Message-ID: <1101663266.16761.43.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.61.0411281731050.3389@dragon.hygekrogen.localhost>

On Sul, 2004-11-28 at 16:32, Jesper Juhl wrote:
>  #endif /* IDETAPE_DEBUG_BUGS */
>  		count = min((unsigned int)(bh->b_size - atomic_read(&bh->b_count)), (unsigned int)n);
> -		copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count);
> +		if (copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count))
> +			return -EFAULT;
>  		n -= count;
>  		atomic_add(count, &bh->b_count);
>  		buf += count;

If you do this then you don't fix up tape->bh for further operations.
Have you tested these changes including the I/O errors ?


  reply	other threads:[~2004-11-28 18:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-28 16:32 Jesper Juhl
2004-11-28 17:34 ` Alan Cox [this message]
2004-11-28 19:39   ` Jesper Juhl
2004-11-28 21:16     ` Jesper Juhl
2004-11-29 22:47   ` Bill Davidsen
2004-11-29 23:23     ` Jesper Juhl
2004-11-30 12:03       ` Alan Cox

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=1101663266.16761.43.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=gadio@netvision.net.il \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®