Print this page
OS-3137 lxbrand pipe does not pollnotify when end is closed

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/fifofs/fifosubr.c
          +++ new/usr/src/uts/common/fs/fifofs/fifosubr.c
↓ open down ↓ 606 lines elided ↑ open up ↑
 607  607                          fifo_cleanup(oldvp, flag);
 608  608                          if (!lockheld)
 609  609                                  mutex_exit(&fn_lock->flk_lock);
 610  610                          return (EINTR);
 611  611                  }
 612  612          }
 613  613  
 614  614          /*
 615  615           * The other end of the pipe is almost closed so
 616  616           * reject any other open on this end of the pipe
 617      -         * This only happens with a pipe mounted under namefs
      617 +         * This normally only happens with a pipe mounted under namefs, but
      618 +         * we can also see an open via proc/fd, which should still succeed.
      619 +         * To indicate the proc/fd case the FKLYR flag is passed.
 618  620           */
 619      -        if ((fnp->fn_flag & (FIFOCLOSE|ISPIPE)) == (FIFOCLOSE|ISPIPE)) {
      621 +        if ((fnp->fn_flag & (FIFOCLOSE|ISPIPE)) == (FIFOCLOSE|ISPIPE) &&
      622 +            (flag & FKLYR) == 0) {
 620  623                  fifo_cleanup(oldvp, flag);
 621  624                  cv_broadcast(&fnp->fn_wait_cv);
 622  625                  if (!lockheld)
 623  626                          mutex_exit(&fn_lock->flk_lock);
 624  627                  return (ENXIO);
 625  628          }
 626  629  
 627  630          fnp->fn_flag |= FIFOOPEN;
 628  631  
 629  632          /*
↓ open down ↓ 576 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX