All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: block2mtd: fix recursive call of mtd_writev
@ 2012-05-23 22:17 Gabor Juhos
  2012-05-24  7:48 ` Artem Bityutskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Gabor Juhos @ 2012-05-23 22:17 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Gabor Juhos, linux-mtd, stable, Artem Bityutskiy

The 'mtd_writev' interface calls the function assigned
to the '_write' field of a given mtd device if that is
not NULL. The block2mtd driver sets the '_writev' field
to the 'mtd_writev' function itself and thus causes a
endless loop.

This is caused by 1dbebd32562b3c2caeca35960e5cb00bfcc12900
(mtd: harmonize mtd_writev usage).

Remove the assignment from the block2mtd driver to fix the
issue.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: stable@vger.kernel.org

---
An identical patch has been tested on 3.3.7, but the actual
one is not even compile tested.
---
 drivers/mtd/devices/block2mtd.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index a4a80b7..7d7000d 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -271,7 +271,6 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
 	dev->mtd.flags = MTD_CAP_RAM;
 	dev->mtd._erase = block2mtd_erase;
 	dev->mtd._write = block2mtd_write;
-	dev->mtd._writev = mtd_writev;
 	dev->mtd._sync = block2mtd_sync;
 	dev->mtd._read = block2mtd_read;
 	dev->mtd.priv = dev;
-- 
1.7.2.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: block2mtd: fix recursive call of mtd_writev
  2012-05-23 22:17 [PATCH] mtd: block2mtd: fix recursive call of mtd_writev Gabor Juhos
@ 2012-05-24  7:48 ` Artem Bityutskiy
  2012-05-24  8:50   ` Gabor Juhos
  0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2012-05-24  7:48 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: linux-mtd, David Woodhouse, stable

[-- Attachment #1: Type: text/plain, Size: 762 bytes --]

On Thu, 2012-05-24 at 00:17 +0200, Gabor Juhos wrote:
> The 'mtd_writev' interface calls the function assigned
> to the '_write' field of a given mtd device if that is
> not NULL. The block2mtd driver sets the '_writev' field
> to the 'mtd_writev' function itself and thus causes a
> endless loop.
> 
> This is caused by 1dbebd32562b3c2caeca35960e5cb00bfcc12900
> (mtd: harmonize mtd_writev usage).
> 
> Remove the assignment from the block2mtd driver to fix the
> issue.
> 
> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> Cc: stable@vger.kernel.org

Amended the "stable" tag and pushed to l2-mtd.git, thanks:

Cc: stable@kernel.org [3.3+]

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: block2mtd: fix recursive call of mtd_writev
  2012-05-24  7:48 ` Artem Bityutskiy
@ 2012-05-24  8:50   ` Gabor Juhos
  0 siblings, 0 replies; 3+ messages in thread
From: Gabor Juhos @ 2012-05-24  8:50 UTC (permalink / raw)
  To: artem.bityutskiy; +Cc: linux-mtd, David Woodhouse, stable

2012.05.24. 9:48 keltezéssel, Artem Bityutskiy írta:
> On Thu, 2012-05-24 at 00:17 +0200, Gabor Juhos wrote:
>> The 'mtd_writev' interface calls the function assigned to the '_write'
>> field of a given mtd device if that is not NULL. The block2mtd driver
>> sets the '_writev' field to the 'mtd_writev' function itself and thus
>> causes a endless loop.
>> 
>> This is caused by 1dbebd32562b3c2caeca35960e5cb00bfcc12900 (mtd:
>> harmonize mtd_writev usage).
>> 
>> Remove the assignment from the block2mtd driver to fix the issue.
>> 
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Artem Bityutskiy
>> <artem.bityutskiy@linux.intel.com> Cc: stable@vger.kernel.org
> 
> Amended the "stable" tag and pushed to l2-mtd.git, thanks:
> 
> Cc: stable@kernel.org [3.3+]
> 

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-24  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 22:17 [PATCH] mtd: block2mtd: fix recursive call of mtd_writev Gabor Juhos
2012-05-24  7:48 ` Artem Bityutskiy
2012-05-24  8:50   ` Gabor Juhos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.