ore: fix BUG_ON, too few sgs when reading
authorBoaz Harrosh <bharrosh@panasas.com>
Wed, 28 Dec 2011 17:14:23 +0000 (19:14 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jan 2012 19:29:28 +0000 (11:29 -0800)
commit0889c179651f57c6fdf4ed72e5027c5dcc90bda2
tree6f1405d1f95b7e6cac3baede1dc09ba092b21269
parent688485273b3173d2fdb590ff916b55c581da6ed0
ore: fix BUG_ON, too few sgs when reading

commit 361aba569f55dd159b850489a3538253afbb3973 upstream.

When reading RAID5 files, in rare cases, we calculated too
few sg segments. There should be two extra for the beginning
and end partial units.

Also "too few sg segments" should not be a BUG_ON there is
all the mechanics in place to handle it, as a short read.
So just return -ENOMEM and the rest of the code will gracefully
split the IO.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/exofs/ore.c
fs/exofs/ore_raid.c