Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jörn <joern@...>
Cc: <linux-kernel@...>, <linux-mtd@...>
Date: Tuesday, February 12, 2008 - 12:10 pm

2008-02-12 16:21:24 +0100, Jörn Engel:

Hi Jörn,

OK, I can do that. Would the "simple" fix go to the
trivial@kernel.org Trivial Patch Monkey?


Well, yes that raised a concern to me, the "exit" function
returns "void". If the del_mtd_device fails with EBUSY at the
moment (such as when a /dev/mtdblock<x> is mounted), we ignore
it and go on with freeing everything leaving a dangling mtd.

Is there a way around that?

Another problem is that it's not easy to check whether a mtd
creation was successful or not. Basically, you have to write to
a /sys file and then parse /proc/mtd to get the result.

What about having a /dev/block2mtd (with owner/permissions that
could allow non-root users to use it), with 2 ioctls:

- one to "link" a block dev to a mtd that would take as
  parameter a fd to an open block dev (again allowing for
  flexible permissions) and would return the number of the
  allocated mtd and success/failure in errno. Upon sucess it
  would increase the refcnt of block2mtd.

- and one to "release" the link. That would fail if the mtd is
  in use and decrease block2mtd's refcnt upon success.

A bit like the loop devices (or /dev/ptmx) actually. What do you
think?

(also, with the /sys interface, isn't there a potential problem
with chroots wrt the path given to the /sys file?)

[...]

I'll dig a little deeper, but I think I'll need some advice/help
at some point, I'm not a Linux kernel expert.

Regards,
Stephane
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Tue Feb 12, 9:47 am)
Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Tue Feb 12, 12:10 pm)
Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Wed Feb 20, 10:36 am)
Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Wed Feb 20, 12:55 pm)
Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Wed Feb 20, 10:43 am)
Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Wed Feb 20, 1:02 pm)
Re: [PATCH 2.6.24] block2mtd: removing a device and typo fixes, Stephane Chazelas, (Wed Feb 20, 1:30 pm)