From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "miguel.ojeda.sandonis@gmail.com" <miguel.ojeda.sandonis@gmail.com>
Cc: "frank.li@vivo.com" <frank.li@vivo.com>,
"glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"lossin@kernel.org" <lossin@kernel.org>,
"slava@dubeyko.com" <slava@dubeyko.com>,
"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>
Subject: RE: [RFC] Should we consider to re-write HFS/HFS+ in Rust?
Date: Fri, 20 Jun 2025 18:10:20 +0000 [thread overview]
Message-ID: <dc52fb4df4f1a54ece43c27245606b80c2b75ded.camel@ibm.com> (raw)
In-Reply-To: <CANiq72nF+Hn-vPttAYDEjRvKa+-C=pGkkAKjMQmWB78Afq4HBg@mail.gmail.com>
On Fri, 2025-06-20 at 10:17 +0200, Miguel Ojeda wrote:
> On Thu, Jun 19, 2025 at 11:49 PM Viacheslav Dubeyko
> <Slava.Dubeyko@ibm.com> wrote:
> >
> > But I would like to implement the step-by-step approach.
>
> Like Benno mentions, it is hard to say how it will look with your
> description, i.e. how you plan to "cut" things.
>
> On one hand, it sounds like you don't plan to write VFS abstractions
> -- did you check Wedson's work?
>
I don't have plans to re-write the whole Linux kernel. :) Because, any
particular file system driver needs to interact with VFS, memory subsystem and
block layer. So, pure Rust implementation means that everything should be re-
written in Rust. But it's mission impossible any time soon. :)
> https://lore.kernel.org/rust-for-linux/20240514131711.379322-1-wedsonaf@gmail.com/
>
> i.e. it sounds like you want to replace parts of e.g. HFS with Rust
> code while still going through C interfaces at some places inside HFS,
> and that has downsides.
> On the other hand, you mention "abstractions" around VFS concepts too,
> so you may have something else in mind.
>
I am considering of re-writing HFS/HFS+ in Rust but still surviving in the C
implemented environment. I don't think that even VFS will be completely re-
written in Rust and adopted any time soon. So, I am talking only about HFS/HFS+
"abstractions" now.
> > Frankly speaking, I don't see how Read-Only version can be easier. :) Because,
> > even Read-Only version requires to operate by file system's metadata. And it's
> > around 80% - 90% of the whole file system driver functionality. From my point of
> > view, it is much easier to convert every metadata structure implementation step
> > by step into Rust.
>
> Well, apart from having to write more operations/code, as soon as
> there may be writers, you have to take care of that possibility in
> everything you do, no?
>
> Worst of all, I imagine you have to test (and generally treat the
> project) way more carefully, because now your users could lose real
> data.
>
>
Even if you have bugs in read path only, then end user will not have access to
data. As a result, end-user will think that data is lost anyway because the data
cannot be accessed.
Any modification or bug fix in file system driver could result in real data loss
even for C implementation. So, of course, we need to be really careful with re-
writing file system driver in Rust. But if we have valid implementation in C
then we need to follow the functional logic and make the Rust implementation
consistent with logic in C. Also, we have xfstests that can help to check that
functionality works correctly. Of course, xfstests cannot guarantee 100%
correctness of file system operations.
So, frankly speaking, I don't see big difference between Read-Only or Read-Write
functionality. Because, both functionalities should be correct and could result
in inconsistent state of file system's in-core metadata or what end-user can
access or see, finally.
Also, anyway, C implementation and Rust implementation needs to co-exist, at
minimum, for some time, I assume.
Thanks,
Slava.
next prev parent reply other threads:[~2025-06-20 18:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <d5ea8adb198eb6b6d2f6accaf044b543631f7a72.camel@ibm.com>
2025-05-28 12:40 ` [RFC] Should we consider to re-write HFS/HFS+ in Rust? Yangtao Li
2025-05-28 16:16 ` Viacheslav Dubeyko
2025-06-19 19:33 ` Benno Lossin
2025-06-19 20:22 ` Miguel Ojeda
2025-06-19 21:48 ` Viacheslav Dubeyko
2025-06-19 22:00 ` Benno Lossin
2025-06-20 8:17 ` Miguel Ojeda
2025-06-20 18:10 ` Viacheslav Dubeyko [this message]
2025-06-20 19:27 ` Miguel Ojeda
2025-06-19 21:39 ` Viacheslav Dubeyko
2025-06-19 22:24 ` Benno Lossin
2025-06-20 17:46 ` Viacheslav Dubeyko
2025-06-20 18:11 ` Miguel Ojeda
2025-06-21 22:38 ` Viacheslav Dubeyko
2025-06-22 7:48 ` Benno Lossin
2025-06-23 10:25 ` Miguel Ojeda
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=dc52fb4df4f1a54ece43c27245606b80c2b75ded.camel@ibm.com \
--to=slava.dubeyko@ibm.com \
--cc=frank.li@vivo.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=slava@dubeyko.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).