public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBI: Can we handle -EINTR differently in erase/write path???
@ 2007-07-13  6:07 Vinit Agnihotri
  2007-07-13 13:06 ` Josh Boyer
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Vinit Agnihotri @ 2007-07-13  6:07 UTC (permalink / raw)
  To: linux-mtd

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
straight way marks entire device as Read only & its really painful
because then you cant even delete that volume as UBI is read only.
Which I guess its not good way. If use cases are considered it is
highly likely that user can hit "Ctrl+c" , like he want to cancel
erase at that time or something like that. So we can handle -EINTR
differently by following way

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.
         */
        if (err == -EINTR) {
            schedule_erase(ubi, e, 0);
            return err;
        }
        else {
            ubi_ro_mode(ubi);
            return err;
        }
    }
i.e. we can again put that perticular peb to erase & can return
without making ubi RO mode.
same can be achieved in write path. If write as interrupted then we
can return error to user & can put that peb back to erase  list.

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.

Thanks & Regards
Vinit.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-18  8:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13  6:07 UBI: Can we handle -EINTR differently in erase/write path??? Vinit Agnihotri
2007-07-13 13:06 ` Josh Boyer
2007-07-14 11:59   ` Vinit Agnihotri
2007-07-17  8:16 ` Artem Bityutskiy
2007-07-17 10:36 ` Artem Bityutskiy
2007-07-17 10:48   ` Vinit Agnihotri
2007-07-18  8:52 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox