Whne the endpoint is shut (an applet or a mux), at least one of the SHW
flags must be set (SE_SHW_SILENT or SE_SHW_NORMAL). It is mandatory for
muxes to perform the shutdown. Otherwise, the shutdown could be ignored.
So let's add a BUG_ON() on it to be sure this never happen.
struct se_abort_info *reason = NULL;
unsigned int flags = 0;
+ /* Should never happen, placed here to be sure we forgot nothing */
+ BUG_ON(!(mode & (SE_SHW_SILENT|SE_SHW_NORMAL)));
+
if ((mode & (SE_SHW_SILENT|SE_SHW_NORMAL)) && !se_fl_test(sedesc, SE_FL_SHW)) {
se_report_term_evt(sedesc, se_tevt_type_shutw);
flags |= (mode & SE_SHW_NORMAL) ? SE_FL_SHWN : SE_FL_SHWS;