Skip to contentSkip to conversation

staging: lustre use kernel socket sockopt apis

PATCH Drokin, Oleg 1 participant 1 message Jun 22, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

So I came back to this patch (now part of Greg's tree)

Quoted 18 lines · Fredrick John Berchmans

Change old way of ops->setsockopt or ops->getsockopt in kernel to kernel_setsockopt or kernel_getsockopt.

drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c +0 -9
@@ -56,21 +56,8 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
 		CERROR ("Can't create socket: %d\n", rc);
 		return rc;
 	}
-
-	sock_filp = sock_alloc_file(sock, 0, NULL);
-	if (IS_ERR(sock_filp)) {
-		sock_release(sock);
-		rc = PTR_ERR(sock_filp);
-		goto out;
-	}
-
-	set_fs(KERNEL_DS);

drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c libcfs_sock_ioctl(int cmd, unsigned long arg) · line 62

Quoted 10 lines
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c +2 -6
-	if (sock_filp->f_op->unlocked_ioctl)
-		rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
-	set_fs(oldmm);
-
-	fput(sock_filp);
-out:
+	rc = kernel_sock_ioctl(sock, cmd, arg);
+	sock_release(sock);
 	return rc;
 }

This part totally breaks lustre, we use this to also call things like SIOCGIFCONF that are not available from socket proto_ops because this is really coming from dev_ioctl and I do not see any better way to access it. So I'd like this to be reverted or if there is a better way to access this, I am interested to learn it.

Bye,
Oleg