Print this page
5914 pipe generates inodes with ino > 4G

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 ↓ 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  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  22   22  
  23   23  /*
  24   24   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
       25 + *
       26 + * Copyright 2017 Ivan Richwalski <ivan@seppuku.net>
       27 + *
  25   28   */
  26   29  
  27   30  /*
  28   31   * The routines defined in this file are supporting routines for FIFOFS
  29   32   * file system type.
  30   33   */
  31   34  #include <sys/types.h>
  32   35  #include <sys/param.h>
  33   36  #include <sys/systm.h>
  34   37  #include <sys/debug.h>
↓ open down ↓ 510 lines elided ↑ open up ↑
 545  548          fifo_reinit_vp(nvp1);           /* Reinitialize vnodes for reuse... */
 546  549          fifo_reinit_vp(nvp2);
 547  550          nvp1->v_vfsp = fifovfsp;        /* Need to re-establish VFS & device */
 548  551          nvp2->v_vfsp = fifovfsp;        /* before we can reuse this vnode. */
 549  552          nvp1->v_rdev = fifodev;
 550  553          nvp2->v_rdev = fifodev;
 551  554  }
 552  555  
 553  556  /*
 554  557   * Attempt to establish a unique pipe id.  Only un-named pipes use this
 555      - * routine.
      558 + * routine. Use a 32-bit ino_t so any 32-bit processes that aren't large
      559 + * file aware can still stat() a pipe fd and not fail with EOVERFLOW.
 556  560   */
 557  561  ino_t
 558  562  fifogetid(void)
 559  563  {
 560      -        static ino_t fifo_ino = 0;
      564 +        static ino32_t fifo_ino = 0;
 561  565          ino_t fino;
 562  566  
 563  567          mutex_enter(&fino_lock);
 564  568          fino = fifo_ino++;
 565  569          mutex_exit(&fino_lock);
 566  570          return (fino);
 567  571  }
 568  572  
 569  573  
 570  574  /*
↓ open down ↓ 635 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX