On 05/25/2015 05:38 AM, Ilya Dryomov wrote: > On Thu, May 21, 2015 at 4:29 PM, Alex Elder <elder@xxxxxxxx> wrote: >> On 05/21/2015 07:35 AM, Ilya Dryomov wrote: >>> - return -ETIMEDOUT instead of -EIO in case of timeout >>> - wait_event_interruptible_timeout() returns time left until timeout >>> and since it can be almost LONG_MAX we had better assign it to long >> >> Any error returned by wait_event_interruptible_timeout() >> can now be returned by __ceph_open_session(). It looks >> like that may, in fact, be only -EINTR and -ERESTARTSYS. >> But it's a change you could note in the log message. > > I think it's just -ERESTARTSYS so I didn't bother. My point was almost a little more philosophical. It's conceivable (though not likely) that wait_event_interruptible_timeout() could be changed to return a value that your caller here does not expect. >> It turns out the only caller ignores the return value of >> ceph_monc_wait_osdmap() anyway. That should maybe be fixed. > > That's on purpose - rbd map tries to wait for a new enough osdmap only > if the pool that the image is supposed to be in doesn't exist and we > know we have a stale osdmap. We ignore wait retval because if we > timeout we should return "this pool doesn't exist", not -ETIMEDOUT. Yes I realize that. This second part of my response was following on to my previous thought. That is, the caller might get a different return value that it didn't expect; but since the only caller ignores what gets returned, it's a moot point. -Alex > Thanks, > > Ilya > -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html