]> git.ipfire.org Git - people/ms/linux.git/commit
target: Fix PR_APTPL_BUF_LEN buffer size limitation
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 12 Feb 2015 02:34:40 +0000 (18:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:10:57 +0000 (14:10 +0100)
commit12c5ac27e69ca3d652a95d3f99423e5fadb274a1
tree51c62b42cc108bf375fa489c534fb02202f9f602
parenta88c8685cd4acacc9bd6234e4f8124ec1ce7e494
target: Fix PR_APTPL_BUF_LEN buffer size limitation

commit f161d4b44d7cc1dc66b53365215227db356378b1 upstream.

This patch addresses the original PR_APTPL_BUF_LEN = 8k limitiation
for write-out of PR APTPL metadata that Martin has recently been
running into.

It changes core_scsi3_update_and_write_aptpl() to use vzalloc'ed
memory instead of kzalloc, and increases the default hardcoded
length to 256k.

It also adds logic in core_scsi3_update_and_write_aptpl() to double
the original length upon core_scsi3_update_aptpl_buf() failure, and
retries until the vzalloc'ed buffer is large enough to accommodate
the outgoing APTPL metadata.

Reported-by: Martin Svec <martin.svec@zoner.cz>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_pr.c
include/target/target_core_base.h