Print this page
5026 intra-node/inter-zone networking doesn't always deliver SIGPOLL

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/sockfs/sockcommon_subr.c
          +++ new/usr/src/uts/common/fs/sockfs/sockcommon_subr.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
       25 +/*
       26 + * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
       27 + */
  25   28  
  26   29  #include <sys/types.h>
  27   30  #include <sys/param.h>
  28   31  #include <sys/signal.h>
  29   32  #include <sys/cmn_err.h>
  30   33  
  31   34  #include <sys/stropts.h>
  32   35  #include <sys/socket.h>
  33   36  #include <sys/socketvar.h>
  34   37  #include <sys/sockio.h>
↓ open down ↓ 354 lines elided ↑ open up ↑
 389  392  
 390  393          dprint(3, ("sending sig %d to %d\n", event, so->so_pgrp));
 391  394  
 392  395          if (so->so_pgrp > 0) {
 393  396                  /*
 394  397                   * XXX This unfortunately still generates
 395  398                   * a signal when a fd is closed but
 396  399                   * the proc is active.
 397  400                   */
 398  401                  mutex_enter(&pidlock);
 399      -                proc = prfind(so->so_pgrp);
      402 +                /*
      403 +                 * Even if the thread started in another zone, we're receiving
      404 +                 * on behalf of this socket's zone, so find the proc using the
      405 +                 * socket's zone ID.
      406 +                 */
      407 +                proc = prfind_zone(so->so_pgrp, so->so_zoneid);
 400  408                  if (proc == NULL) {
 401  409                          mutex_exit(&pidlock);
 402  410                          return;
 403  411                  }
 404  412                  mutex_enter(&proc->p_lock);
 405  413                  mutex_exit(&pidlock);
 406  414                  socket_sigproc(proc, event);
 407  415                  mutex_exit(&proc->p_lock);
 408  416          } else {
 409  417                  /*
 410  418                   * Send to process group. Hold pidlock across
 411  419                   * calls to socket_sigproc().
 412  420                   */
 413  421                  pid_t pgrp = -so->so_pgrp;
 414  422  
 415  423                  mutex_enter(&pidlock);
 416      -                proc = pgfind(pgrp);
      424 +                /*
      425 +                 * Even if the thread started in another zone, we're receiving
      426 +                 * on behalf of this socket's zone, so find the pgrp using the
      427 +                 * socket's zone ID.
      428 +                 */
      429 +                proc = pgfind_zone(pgrp, so->so_zoneid);
 417  430                  while (proc != NULL) {
 418  431                          mutex_enter(&proc->p_lock);
 419  432                          socket_sigproc(proc, event);
 420  433                          mutex_exit(&proc->p_lock);
 421  434                          proc = proc->p_pglink;
 422  435                  }
 423  436                  mutex_exit(&pidlock);
 424  437          }
 425  438  }
 426  439  
↓ open down ↓ 2019 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX