UBI: Can we handle -EINTR differently in erase/write path???

Josh Boyer jwboyer at linux.vnet.ibm.com
Fri Jul 13 09:06:03 EDT 2007


On Fri, 2007-07-13 at 11:37 +0530, Vinit Agnihotri wrote:
> Hi heres few code snip from erase_worker(); from wl.c
> if (err != -EIO) {
>         /*
>          * If this is not %-EIO, we have no idea what to do. Scheduling
>          * this physical eraseblock for erasure again would cause
>          * errors again and again. Well, lets switch to RO mode.
>          */
>         ubi_ro_mode(ubi);
>         return err;
>     }
> 
> Suppose while erasure in progress & someone pressed "Ctrl+C" then UBI

This is the kernel...  the erase_worker function is called from a kernel
thread that doesn't allow signals.  How would it get a "Ctrl+C" event?

> This is my initial understanding about handling -EINTR, however I
> would like to know views of others. If all agrees I can post patch for
> same.

That is how you handle the EINTR errno in userspace.  I think you'd need
to show how -EINTR could show up in this code path in the kernel before
worrying about how to handle it.

josh




More information about the linux-mtd mailing list