Project

General

Profile

Bug #7728

ctld segfaults after adding a large number of targets

Added by Hans Woithe over 5 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
Alexander Motin
Category:
OS
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

I am using the REST API to create a large number of targets on FreeNAS 9.3. Once I hit the limit (CTL_MAX_PORTS = 256) ctld segfaults. This is caused by a NULL pointer dereference of oldtarg after kernel_port_add (which returns an error) gets called. This has already been fixed in FreeBSD master but has not been cherry picked into the TrueOS github repo.

Please see:
https://github.com/freebsd/freebsd/commit/84e2f9fb805f1fee7bed4b55708ba595ebf34d87

Associated revisions

Revision bdbe886b (diff)
Added by trasz over 5 years ago

Fix null pointer dereference. MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation Ticket: #7728 (cherry picked from commit 84e2f9fb805f1fee7bed4b55708ba595ebf34d87)

Revision bdbe886b (diff)
Added by trasz over 5 years ago

Fix null pointer dereference. MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation Ticket: #7728 (cherry picked from commit 84e2f9fb805f1fee7bed4b55708ba595ebf34d87)

Revision 72cb2ef4 (diff)
Added by trasz over 5 years ago

Fix null pointer dereference. MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation Ticket: #7728 (cherry picked from commit 84e2f9fb805f1fee7bed4b55708ba595ebf34d87) (cherry picked from commit bdbe886b37d2e7f2b28708326a7e392c282481dc)

Revision 72cb2ef4 (diff)
Added by trasz over 5 years ago

Fix null pointer dereference. MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation Ticket: #7728 (cherry picked from commit 84e2f9fb805f1fee7bed4b55708ba595ebf34d87) (cherry picked from commit bdbe886b37d2e7f2b28708326a7e392c282481dc)

History

#1 Updated by Alexander Motin over 5 years ago

  • Status changed from Unscreened to Fix In Progress

Thank you for the notification. I've merged that and few more commits to the nightly branch and merge them to stable in few days.

That commit should probably fix ctld crash, but it still won't allow more then ~253 targets to be created. Do you need so many targets for some real purpose?

#2 Updated by Hans Woithe over 5 years ago

Thank you for following up.

Yes, there is a real purpose and need for this. In our system we can have many targets, some of them may be short lived. According to the FreeNAS user guide, there should be a 1:1 mapping of targets to extents. That would unfortunately limit us to ~253 simultaneous "mounts" across all of our servers. Imagine if each belongs to a jail that is doing some processing, like building a package. With 1:1 mapping you can easily get to ~253 targets.

#3 Updated by Alexander Motin over 5 years ago

"1:1 mapping of targets to extents" is not really a hard requirement, only an optimization, so that each extent/LUN has own independent iSCSI connection. CTL in present FreeNAS 9.3 supports up to 1024 extents/LUNs total, scattered over up to 253 targets, with up to 256 LUNs per target (the last limit is there only because many initiators don't support more then 256 LUNs per target). If your use scenario allows to have several LUNs per target, you may reach up to 1024 extents/LUNs.

#4 Updated by Alexander Motin over 5 years ago

  • Status changed from Fix In Progress to Ready For Release

#5 Updated by Alexander Motin over 5 years ago

  • Target version changed from 150 to Unspecified

#6 Updated by Jordan Hubbard over 5 years ago

  • Status changed from Ready For Release to Resolved

#7 Avatar?id=14398&size=24x24 Updated by Kris Moore about 4 years ago

  • Target version changed from Unspecified to N/A

Also available in: Atom PDF