Re: [PATCH 2/2] pipe: do not return POLLERR for fifo_poll

From: Andrew Morton (akpm_at_osdl.org)
Date: 08/26/05

  • Next message: Tomita, Haruo: "RE: libata-dev queue updated"
    Date:	Thu, 25 Aug 2005 17:02:17 -0700
    To: Pekka Enberg <penberg@cs.helsinki.fi>
    
    

    Pekka Enberg <penberg@cs.helsinki.fi> wrote:
    >
    > This patch changes fifo_poll not to return POLLERR to take care of a FIXME
    > in fs/pipe.c stating that "Most unices do not set POLLERR for fifos." The
    > comment has been there since 2.3.99-pre3 so either apply this patch or
    > alternatively, I can send a new one removing the unnecessary abstraction.
    >
    > ...
    > --- 2.6-mm.orig/fs/pipe.c
    > +++ 2.6-mm/fs/pipe.c
    > @@ -399,8 +399,8 @@ pipe_ioctl(struct inode *pino, struct fi
    > }
    >
    > /* No kernel lock held - fine */
    > -static unsigned int
    > -pipe_poll(struct file *filp, poll_table *wait)
    > +static inline unsigned int
    > +__pipe_poll(struct file *filp, poll_table *wait, int can_err)
    > {
    > unsigned int mask;
    > struct inode *inode = filp->f_dentry->d_inode;
    > @@ -420,15 +420,24 @@ pipe_poll(struct file *filp, poll_table
    >
    > if (filp->f_mode & FMODE_WRITE) {
    > mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0;
    > - if (!info->readers)
    > + if (can_err && !info->readers)
    > mask |= POLLERR;
    > }
    >
    > return mask;
    > }
    >
    > -/* FIXME: most Unices do not set POLLERR for fifos */
    > -#define fifo_poll pipe_poll
    > +static unsigned int
    > +pipe_poll(struct file *filp, poll_table *wait)
    > +{
    > + return __pipe_poll(filp, wait, 1);
    > +}
    > +
    > +static unsigned int
    > +fifo_poll(struct file *filp, poll_table *wait)
    > +{
    > + return __pipe_poll(filp, wait, 0);
    > +}
    >
    > static int
    > pipe_release(struct inode *inode, int decr, int decw)

    A userspace-visible change, no?

    So there's a risk in changing it. What do we get in return? Worried.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Tomita, Haruo: "RE: libata-dev queue updated"

    Relevant Pages

    • [patch 42/44] ia64: make partial_page.bitmap an unsigned long
      ... The *_bitroutines are defined to work on a pointer to unsigned long. ... But partial_page.bitmap is unsigned int and it is passed to find_*_bit ... This patch changes to unsigned long instead. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 6/11] serio dynamic allocation
      ... This patch causes problems on sparc64: ... extern unsigned int i8042_dmi_noloop; ... static unsigned int i8042_noloop; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [-mm PATCH][3/4] net: signed vs unsigned cleanup in net/ipv4/raw.c
      ... This patch changes the type of the local variable 'i' in ... raw_probe_proto_optfrom 'int' to 'unsigned int'. ... Changing 'i' to unsigned silences this warning and is safe since the array ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 13/47] Add a missing dmi_noloop declaration in i8042.c
      ... static unsigned int i8042_noloop; ... +extern unsigned int i8042_dmi_noloop; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 1/11] psmouse resync for KVM users
      ... module_param_named(smartscroll, psmouse_smartscroll, bool, 0); ... -static unsigned int psmouse_resetafter; ... +static unsigned int psmouse_resetafter = 20; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)