> This bug was introduce in commit  2e8ac30312973dd20e68073653
> (the first time rdev_set_badblock was call from interrupt context),
> so this patch is appropriate for 3.5 and subsequent kernels.
> 

While this patch is harmless for 3.4, the changelog does say
it is for 3.5+.

> Signed-off-by: Bian Yu <[email protected]>
> Reviewed-by: Jianpeng Ma <[email protected]>
> Signed-off-by: NeilBrown <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
> 
> ---
>  drivers/md/md.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7780,6 +7780,7 @@ static int md_set_badblocks(struct badbl
>       u64 *p;
>       int lo, hi;
>       int rv = 1;
> +     unsigned long flags;
>  
>       if (bb->shift < 0)
>               /* badblocks are disabled */
> @@ -7794,7 +7795,7 @@ static int md_set_badblocks(struct badbl
>               sectors = next - s;
>       }
>  
> -     write_seqlock_irq(&bb->lock);
> +     write_seqlock_irqsave(&bb->lock, flags);
>  
>       p = bb->page;
>       lo = 0;
> @@ -7910,7 +7911,7 @@ static int md_set_badblocks(struct badbl
>       bb->changed = 1;
>       if (!acknowledged)
>               bb->unacked_exist = 1;
> -     write_sequnlock_irq(&bb->lock);
> +     write_sequnlock_irqrestore(&bb->lock, flags);
>  
>       return rv;
>  }
> 

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to