mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Matteo Croce <technoboy85@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 Timothy Redaelli <tredaelli@redhat.com>,
	 linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Matteo Croce <teknoraver@meta.com>
Subject: Re: [PATCH v3] fat: stop reading directory entries past the end-of-directory marker
Date: Tue, 16 Jun 2026 23:54:47 +0900	[thread overview]
Message-ID: <871pe65ydk.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <878q8e699i.fsf@mail.parknet.co.jp>

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:

>
> There are some strange behavior though (e.g. seek after name[0] == 0,
> then readdir()), the strange should only be on already a corrupted image.
>
> Well, if we found a serious issue with this, there is possibility to
> revert later though. Looks good for me.
>
> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>

[...]

>> +static int fat_get_entry_eod(struct inode *dir, loff_t *pos,
>> +			     struct buffer_head **bh,
>> +			     struct msdos_dir_entry **de)
>> +{
>> +	int err = fat_get_entry(dir, pos, bh, de);
>> +
>> +	if (err == 0 && (*de)->name[0] == 0) {
>> +		*pos = dir->i_size;

I re-reviewed this part. Since here is failure case, so we have to
release *bh, isn't it?

		brelse(*bh);
                *bh = NULL;

>> +		return -1;
>> +	}
>> +	return err;
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2026-06-16 14:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13 17:28 Matteo Croce
2026-06-16 10:59 ` OGAWA Hirofumi
2026-06-16 14:54   ` OGAWA Hirofumi [this message]
2026-06-16 15:27     ` Matteo Croce
2026-06-16 15:36       ` OGAWA Hirofumi

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=871pe65ydk.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=technoboy85@gmail.com \
    --cc=teknoraver@meta.com \
    --cc=tredaelli@redhat.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

Powered by JetHome