[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B32796B.90001@lll.lu>
Date: Wed, 23 Dec 2009 21:11:23 +0100
From: alain <alain@...ff.lu>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Andi Kleen <andi@...stfloor.org>,
Mark Hounschell <markh@...pro.net>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>,
"dmarkh@....rr.com" <dmarkh@....rr.com>,
Alain Knaff <alain@...ff.lu>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"fdutils@...tils.linux.lu" <fdutils@...tils.linux.lu>,
"Li, Shaohua" <shaohua.li@...el.com>, Ingo Molnar <mingo@...e.hu>
Subject: Re: [Fdutils] DMA cache consistency bug introduced in 2.6.28
Linus Torvalds wrote:
> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> index 3266b4f..9c9148c 100644
> --- a/drivers/block/floppy.c
> +++ b/drivers/block/floppy.c
> @@ -2237,13 +2237,10 @@ static void setup_format_params(int track)
> for (count = 1; count <= F_SECT_PER_TRACK; ++count) {
> here[n].sect = count;
> n = (n + il) % F_SECT_PER_TRACK;
> - if (here[n].sect) { /* sector busy, find next free sector */
> + while (here[n].sect) { /* sector busy, find next free sector */
> ++n;
> - if (n >= F_SECT_PER_TRACK) {
> + if (n >= F_SECT_PER_TRACK)
> n -= F_SECT_PER_TRACK;
> - while (here[n].sect)
> - ++n;
> - }
> }
> }
> if (_floppy->stretch & FD_SECTBASEMASK) {
The original code does indeed look a little bit strange... and might
break if there is a long run of "busy" sectors near the end of the
physical track. Or maybe there is a mathematical reason why this
situation cannot occur. I'll have to think about it a little bit more to
come up with a test case that will break either the new or old code.
But in any case, if a bug would occur due to this code, it would only
depend on the format's parameters, and not on the hardwarde.
Regards,
Alain
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists