pnfs-obj: Must return layout on IO error
commit5e383255dab2f12e7e111e23c057a30955de8cf3
authorBoaz Harrosh <bharrosh@panasas.com>
Fri, 6 Jan 2012 07:31:20 +0000 (6 09:31 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Jan 2012 01:25:03 +0000 (25 17:25 -0800)
tree48cc4a4df86c0572435f50c120c5cbb1eebf7b43
parent8edf7c13515fa2dee528ab348919058b14454457
pnfs-obj: Must return layout on IO error

commit fe0fe83585f88346557868a803a479dfaaa0688a upstream.

As mandated by the standard. In case of an IO error, a pNFS
objects layout driver must return it's layout. This is because
all device errors are reported to the server as part of the
layout return buffer.

This is implemented the same way PNFS_LAYOUTRET_ON_SETATTR
is done, through a bit flag on the pnfs_layoutdriver_type->flags
member. The flag is set by the layout driver that wants a
layout_return preformed at pnfs_ld_{write,read}_done in case
of an error.
(Though I have not defined a wrapper like pnfs_ld_layoutret_on_setattr
 because this code is never called outside of pnfs.c and pnfs IO
 paths)

Without this patch 3.[0-2] Kernels leak memory and have an annoying
WARN_ON after every IO error utilizing the pnfs-obj driver.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/objlayout/objio_osd.c
fs/nfs/pnfs.c
fs/nfs/pnfs.h