linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Kai Bankett <chaosman@ontika.net>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] qnx4fs: small cleanup
Date: Tue, 14 Feb 2012 04:00:30 +0000	[thread overview]
Message-ID: <20120214040030.GY23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <4F386ACD.2010908@ontika.net>

On Mon, Feb 13, 2012 at 02:43:41AM +0100, Kai Bankett wrote:
> Small qnx4 cleanup patch.
> - removes .writepage, .write_begin and .write_end (+callback functions)
> - removes '.' path checking in namei.c (handled on upper layers)

Applied.  FWIW, after looking at fs/qnx4...  *OUCH*

* qnx4_bread()/qnx4_getblk() is completely pointless - the sole caller
is going to call qnx4_block_map() *anyway*, so we might as well just
feed that value to sb_bread().

* extent blocks handling is fishy - e.g. if you have an extent block
with 0 extents in it, the damn thing will treat that as if it contained
1 extent.  If it's really invalid (and it probably is), that might be
a sane mitigation strategy, but otherwise it's a bug; in any case, that
shouldn't be silent.  It also leaks references to buffer_head if it
runs into extent block with invalid signature.  It definitely could've
used a bit of caching - storing the last matched extent in the in-core
inode and skipping the entire "walk the whole extent chain" thing would
be a clear win.  It also has a problem with error reporting - it
returns (unsigned long)-EIO and callers have no idea what to do with that
(they do understand 0 as "no such block", but that's it; you'll _probably_
end up with sb_bread() unhappy with huge block number, so it'll end up
with screaming block layer)

* readdir and lookup handling relies on running into NULs in directories.
Neither bothers to check for combination of "used" and "link" bits being
invalid.  BTW, neither handles long names (present in qnx4 filesystems
on recent enough versions).

Overall, the code could use quite a bit of cleanup.  I don't know if they
have evaluation images that could run under qemu and if the license allows
experimenting with fs images anyway; if anyone knows (or can run the tests
on their box), please yell - I'd rather not play with cleanup patches
without testing, but the codebase isn't large or complex enough to make
writing the patches to test particulary hard.

  reply	other threads:[~2012-02-14  4:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13  1:43 [PATCH] qnx4fs: small cleanup Kai Bankett
2012-02-14  4:00 ` Al Viro [this message]
2012-02-15  2:58   ` Kai Bankett
2012-02-15 22:37   ` [PATCH] qnx4fs: small cleanup #2 Kai Bankett
2012-02-16 10:09     ` Al Viro
2012-02-16 17:46       ` Kai Bankett

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=20120214040030.GY23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=chaosman@ontika.net \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).