public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: "linux-os (Dick Johnson)" <linux-os@analogic.com>
Cc: Linux kernel <linux-kernel@vger.kernel.org>, staubach@redhat.com
Subject: Re: Linux poll() <sigh> again
Date: Thu, 11 May 2006 14:16:15 -0700	[thread overview]
Message-ID: <20060511211615.GA8485@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0605111659580.5484@chaos.analogic.com>

On 11.05.2006 [17:04:46 -0400], linux-os (Dick Johnson) wrote:
> 
> On Thu, 11 May 2006, Nishanth Aravamudan wrote:
> 
> > On 11.05.2006 [10:25:29 -0400], linux-os (Dick Johnson) wrote:
> >>
> >>
> >> Hello,
> >>
> >> I'm trying to fix a long-standing bug which has a
> >> work-around that has been working for a year or
> >> so.
> >
> > <snip valiant efforts>
> >
> >> Here is relevent code:
> >>
> >>              for(;;) {
> >>                  mem->pfd.fd = fd;
> >>                  mem->pfd.events = POLLIN|POLLERR|POLLHUP|POLLNVAL;
> >>                  mem->pfd.revents = 0x00;
> >
> > Hrm, in looking at the craziness that is sys_poll() for a bit, I think
> > it's the underlying f_ops that are responsible for not setting POLLHUP,
> > that is:
> >
> >                        if (file != NULL) {
> >                                mask = DEFAULT_POLLMASK;
> >                                if (file->f_op && file->f_op->poll)
> >                                        mask = file->f_op->poll(file, *pwait);
> >                                mask &= fdp->events | POLLERR | POLLHUP;
> >                                fput_light(file, fput_needed);
> >                        }
> >
> > and file->f_op->poll(file, *pwait) is not setting POLLHUP on the
> > disconnect. What filesystem is this?
> 
> I think that's the problem. A socket isn't a file-system and the
> code won't set either bits if it isn't. Perhaps, the kernel code
> needs to consider a socket as a virtual file of some kind? Surely
> one needs to use poll() on sockets, no?

Duh, I'm not reading well today -- for sockets, we do

file->f_op->poll() -> (socket_file_ops) sock_poll() -> sock->ops->poll()

So, now I need to know what kind of socket is this to go from there ...

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

  reply	other threads:[~2006-05-11 21:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-11 14:25 Linux poll() <sigh> again linux-os (Dick Johnson)
2006-05-11 20:47 ` Nishanth Aravamudan
2006-05-11 21:04   ` linux-os (Dick Johnson)
2006-05-11 21:16     ` Nishanth Aravamudan [this message]
2006-05-12 11:42       ` linux-os (Dick Johnson)
2006-05-12 10:37     ` Jan Engelhardt
2006-05-12  5:26 ` David Schwartz
     [not found] <6bkl7-56Y-11@gated-at.bofh.it>
2006-05-12  0:08 ` Robert Hancock
2006-05-12 11:53   ` linux-os (Dick Johnson)
2006-05-12 14:32     ` Robert Hancock
2006-05-12 14:46       ` jimmy
2006-05-12 14:57         ` linux-os (Dick Johnson)
2006-05-12 15:06           ` Eric Dumazet
2006-05-12 15:12           ` Davide Libenzi
2006-05-12 18:49         ` David Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060511211615.GA8485@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@analogic.com \
    --cc=staubach@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox