[Stgt-devel] Segmentation fault on target update operation
FUJITA Tomonori
fujita.tomonori
Fri Mar 9 16:20:40 CET 2007
From: Robert Jennings <rcj at linux.vnet.ibm.com>
Subject: [Stgt-devel] Segmentation fault on target update operation
Date: Thu, 8 Mar 2007 15:21:11 -0600
> In a case where the target driver doesn't have a target_update() method
> defined tgtadm will segfault with a command-line like:
>
> # tgtadm --lld ibmvio --mode target --op update --tid=1 --name=invalid \
> --value=3
>
> The name will not match "state" in mgmt.c:target_mgmt(...) for
> OP_UPDATE and because there is no target_update() function for the
> driver -EINVAL (-22) is returned to tgtadm.c:ipc_mgmt_rsp(...) and
> stored in rsp.err where it then attempts:
Thanks.
I changed target_mgmt() to return TGTADM_UNSUPPORTED_OPERATION instead
of -EINVAL.
Note that iscsi_target_update returns a negative value and tgtadm will
segfault. Well, mgmt.c is crappy. I'll clean it up later on.
More information about the stgt
mailing list