Message ID | 4ECD32BF0200006600006F28@novprvlin0050.provo.novell.com |
---|---|
State | New |
Headers | show |
On 11/23/2011 07:51 AM, Chun Yan Liu wrote: > > According to above code logic, if lock in an early place is not > accepted, then removing CLEAR_SOCK in nbd_init phase can also solve > problem. In fact, if cleanup work done well, I think that ioctl is not > needed. Any comments? I think you're right. In addition, SET_BLKSIZE and SET_SIZE should not be sent unless SET_SOCK succeeds. Paolo
diff --git a/nbd.c b/nbd.c index e6c931c..067a57b 100644 --- a/nbd.c +++ b/nbd.c @@ -386,15 +386,6 @@ int nbd_init(int fd, int csock, uint32_t flags, off_t size, size_t blocksize) return -1; } - TRACE("Clearing NBD socket"); - - if (ioctl(fd, NBD_CLEAR_SOCK) == -1) { - int serrno = errno; - LOG("Failed clearing NBD socket"); - errno = serrno; - return -1; - } - TRACE("Setting NBD socket"); if (ioctl(fd, NBD_SET_SOCK, csock) == -1) {