Re: [patch 7/7] uml ubd: handle readonly status

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [patch 7/7] uml ubd: handle readonly status

Jens Axboe
On Sun, Apr 24 2005, [hidden email] wrote:
> @@ -1099,6 +1104,7 @@ static int prepare_request(struct reques
>   if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
>   printk("Write attempted on readonly ubd device %s\n",
>         disk->disk_name);
> + WARN_ON(1); /* This should be impossible now */
>   end_request(req, 0);
>   return(1);
>   }

I don't think that's a sound change. The WARN_ON() is strictly only
really useful for when you need the stack trace for something
interesting. As the io happens async, you will get a boring trace that
doesn't contain any valuable information.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Reply | Threaded
Open this post in threaded view
|

Re: [patch 7/7] uml ubd: handle readonly status

Paolo 'Blaisorblade' Giarrusso
On Monday 25 April 2005 12:16, Jens Axboe wrote:

> On Sun, Apr 24 2005, [hidden email] wrote:
> > @@ -1099,6 +1104,7 @@ static int prepare_request(struct reques
> >   if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
> >   printk("Write attempted on readonly ubd device %s\n",
> >         disk->disk_name);
> > + WARN_ON(1); /* This should be impossible now */
> >   end_request(req, 0);
> >   return(1);
> >   }
>
> I don't think that's a sound change. The WARN_ON() is strictly only
> really useful for when you need the stack trace for something
> interesting. As the io happens async, you will get a boring trace that
> doesn't contain any valuable information.
Ok, removed, and resending the patch, is the rest ok? I.e. is that supposed to
work? I gave a walk around and it seemed that the code handles
set_{disk,device}_ro() even during the open, but I'm no block layer expert.

Thanks for the review.
--
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Reply | Threaded
Open this post in threaded view
|

Re: [patch 7/7] uml ubd: handle readonly status

Jens Axboe
On Mon, Apr 25 2005, Blaisorblade wrote:

> On Monday 25 April 2005 12:16, Jens Axboe wrote:
> > On Sun, Apr 24 2005, [hidden email] wrote:
> > > @@ -1099,6 +1104,7 @@ static int prepare_request(struct reques
> > >   if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
> > >   printk("Write attempted on readonly ubd device %s\n",
> > >         disk->disk_name);
> > > + WARN_ON(1); /* This should be impossible now */
> > >   end_request(req, 0);
> > >   return(1);
> > >   }
> >
> > I don't think that's a sound change. The WARN_ON() is strictly only
> > really useful for when you need the stack trace for something
> > interesting. As the io happens async, you will get a boring trace that
> > doesn't contain any valuable information.
> Ok, removed, and resending the patch, is the rest ok? I.e. is that
> supposed to work? I gave a walk around and it seemed that the code
> handles set_{disk,device}_ro() even during the open, but I'm no block
> layer expert.

I'd keep the checks for sanity. Although the set_disk/device_ro prevents
regular fs write mounts, a buggy layered drive could still send down a
write by accident.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/