From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Frodo Looijaard <frodol@dds.nl>
Cc: "H. Peter Anvin" <hpa@zytor.com>, linux-kernel@vger.kernel.org
Subject: Re: PATCH to access old-style FAT fs
Date: Thu, 29 Jan 2004 06:01:18 +0900 [thread overview]
Message-ID: <87bron7ppd.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <20040128202443.GA9246@frodo.local>
Frodo Looijaard <frodol@dds.nl> writes:
> On Thu, Jan 29, 2004 at 05:08:32AM +0900, OGAWA Hirofumi wrote:
> >
> > "stop when DIR_Name[0] == 0" should be added after cleanup. The option
> > is not needed.
>
> OK. That would be nice. Like I said, I just hope it does not break other
> FAT implementations, but that is not very likely. At least, that would
> allow read-only mounted EPOC FAT partitions to be handled correctly.
This is spec as hpa saied. So this is right things, and other fat
driver also does, AFAIK.
> > Honestly, I wouldn't like to add the "add a new DIR_Name[0] = 0" part.
> > The option is added easy, but it is not removed easy. And we must
> > maintain it.
>
> I understand. I could always maintain that patch separately for those
> who need it (for read-write mounted EPOC FAT partitions).
Thanks.
> > (BTW, looks like that patch is buggy)
>
> Could well be. Any suggestions what to look out for?
@@ -200,4 +202,8 @@
parse_record:
long_slots = 0;
+ if (oldfat && (de->name[0] == EOD_FLAG))
+ last_entry = 1;
+ if (last_entry)
+ continue;
^^^^^^^^
if (de->name[0] == DELETED_FLAG)
continue;
The above should "goto EODir;". Likewise, another "contiure" of
fat_search_long().
@@ -709,7 +731,20 @@
}
- if (IS_FREE((*de)->name)) {
- if (++row == slots)
+ if ((oldfat && ((*de)->name[0] == EOD_FLAG)))
+ last_entry = 1;
+ if (last_entry || IS_FREE((*de)->name)) {
+ if (++row == slots) {
+ if (last_entry) {
+ /* If we encounter a last_entry, we
+ * need to mark the entry after the
+ * one to be inserted as last_entry
+ * now! */
+ if (fat_get_entry(dir,&curr,bh,de,i_pos) > -1) {
+ (*de)->name[0] = 0;
+ mark_inode_dirty(dir);
mark_inode_dirty(dir) is not needed, instead of it we should do
mark_buffer_dirty(bh).
And this fat_get_entry() updates bh and de, but it should be point to
allocated bh and de, not free entry. It's needed by msdos_add_entry().
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2004-01-28 21:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-26 17:39 PATCH to access old-style FAT fs Frodo Looijaard
2004-01-26 19:38 ` H. Peter Anvin
2004-01-27 12:55 ` OGAWA Hirofumi
2004-01-27 18:51 ` H. Peter Anvin
2004-01-27 20:17 ` OGAWA Hirofumi
2004-01-28 11:56 ` Frodo Looijaard
2004-01-28 20:08 ` OGAWA Hirofumi
2004-01-28 20:24 ` Frodo Looijaard
2004-01-28 21:01 ` OGAWA Hirofumi [this message]
2004-01-29 10:56 ` Frodo Looijaard
2004-01-31 2:19 ` H. Peter Anvin
2004-01-31 17:19 ` OGAWA Hirofumi
2004-01-29 22:39 ` Frodo Looijaard
2004-01-29 22:49 ` H. Peter Anvin
2004-01-30 0:30 ` Andries Brouwer
2004-01-30 3:40 ` OGAWA Hirofumi
2004-02-01 14:51 ` Frodo Looijaard
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=87bron7ppd.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=frodol@dds.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@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