From: Richard Weinberger <richard@nod.at>
To: miklos@szeredi.hu
Cc: miquel.raynal@bootlin.com, vigneshr@ti.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org,
Richard Weinberger <richard@nod.at>
Subject: [PATCH 0/7] [RFC] MUSE: Userspace backed MTD v2
Date: Fri, 27 Nov 2020 00:32:53 +0100 [thread overview]
Message-ID: <20201126233300.10714-1-richard@nod.at> (raw)
First of all, sorry for sending v2 before getting a review.
I found a much better way to process IO and to get rid of all hacks
from v1.
When working with flash devices a common task is emulating them to run various
tests or inspect dumps from real hardware. To achieve that we have plenty of
emulators in the mtd subsystem: mtdram, block2mtd, nandsim.
Each of them implements a adhoc MTD and have various drawbacks.
Over the last years some developers tried to extend them but these attempts
often got rejected because they added just more adhoc feature instead of
addressing overall problems.
MUSE is a novel approach to address the need of advanced MTD emulators.
Advanced means in this context supporting different (vendor specific) image
formats, different ways for fault injection (fuzzing) and recoding/replaying
IOs to emulate power cuts.
The core goal of MUSE is having the complexity on the userspace side and
only a small MTD driver in kernelspace.
While playing with different approaches I realized that FUSE offers everything
we need. So MUSE is a little like CUSE except that it does not implement a
bare character device but an MTD.
To get early feedback I'm sending this series as RFC, so don't consider it as
ready to merge yet.
Open issues are:
1. Init parameter passing
Currently parameter passing borrowed the logic from CUSE and parameters are
passed as stringy key value pairs.
Most MTD paramerters are numbers (erase size, etc..) so passing them via
struct muse_init_out seems more natural.
But I plan to pass also pure string parameters such as an mtdparts command line.
What is the perffered way these days in FUSE?
Am I allowed to embed structs such as struct mtd_info_user (mtd-abi.h) in
muse_init_out?
2. OOB (out of band) handling
So far OOB support is not implemented. I plan to do so.
Mabye just the bare minimum to make jffs2 happy.
I'm still digging into FUSE to find a nice way how to implement
it.
Changes since v1:
- Rewrote IO path, fuse_direct_io() is no longer used.
Instead of cheating fuse_direct_io() use custom ops to implement
reading and writing. That way MUSE no longer needs a dummy file object
nor a fuse file object.
In MTD all IO is synchronous and operations on kernel buffers, this
makes IO processing simple for MUSE.
- Support for bad blocks.
- No more (ab)use of FUSE ops such as FUSE_FSYNC.
- Major code cleanup.
This series can also be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git muse_v2
Richard Weinberger (7):
fuse: Export fuse_simple_request
fuse: Export IO helpers
fuse: Make cuse_parse_one a common helper
mtd: Add MTD_MUSE flag
fuse: Add MUSE specific defines FUSE interface
fuse: Implement MUSE: MTD in userspace
MAINTAINERS: Add entry for MUSE
MAINTAINERS | 7 +
fs/fuse/Kconfig | 15 +
fs/fuse/Makefile | 2 +
fs/fuse/cuse.c | 58 +--
fs/fuse/dev.c | 1 +
fs/fuse/file.c | 16 +-
fs/fuse/fuse_i.h | 18 +
fs/fuse/helper.c | 70 ++++
fs/fuse/muse.c | 730 +++++++++++++++++++++++++++++++++++++
include/uapi/linux/fuse.h | 73 +++-
include/uapi/mtd/mtd-abi.h | 1 +
11 files changed, 920 insertions(+), 71 deletions(-)
create mode 100644 fs/fuse/helper.c
create mode 100644 fs/fuse/muse.c
--
2.26.2
next reply other threads:[~2020-11-26 23:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-26 23:32 Richard Weinberger [this message]
2020-11-26 23:32 ` [PATCH 1/7] fuse: Export fuse_simple_request Richard Weinberger
2020-11-26 23:32 ` [PATCH 2/7] fuse: Export IO helpers Richard Weinberger
2020-11-26 23:32 ` [PATCH 3/7] fuse: Make cuse_parse_one a common helper Richard Weinberger
2020-11-26 23:32 ` [PATCH 4/7] mtd: Add MTD_MUSE flag Richard Weinberger
2020-11-26 23:32 ` [PATCH 5/7] fuse: Add MUSE specific defines FUSE interface Richard Weinberger
2020-11-26 23:32 ` [PATCH 6/7] fuse: Implement MUSE: MTD in userspace Richard Weinberger
2020-11-26 23:33 ` [PATCH 7/7] MAINTAINERS: Add entry for MUSE Richard Weinberger
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=20201126233300.10714-1-richard@nod.at \
--to=richard@nod.at \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miklos@szeredi.hu \
--cc=miquel.raynal@bootlin.com \
--cc=vigneshr@ti.com \
/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;
as well as URLs for NNTP newsgroup(s).