Re: [Vserver] CIFS-mounts in vserver guests: solved

2007-04-03 Thread Roderick A. Anderson

Wilhelm Meier wrote:

Am Montag, 2. April 2007 schrieb Wilhelm Meier:

after our conversion I got the quick cifs hack running (using a special
CLONE-flag for the cifs-thread).

The I got this patch, which changes the api to kthread_run. But, the
problem remains. I still got this error in dmesg:



I've to correct myself! 
I had a configuration flaw ... if the patch is in place, it works as expected. 
CIFS-shares can be mounted inside the guests.


Wilhelm,

Would you be willing to put some instructions together on what it takes 
to do this?



TIA,
Rod
--


-
Wilhelm
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] CIFS-mounts in vserver guests: solved

2007-04-03 Thread Wilhelm Meier
Am Dienstag, 3. April 2007 schrieb Roderick A. Anderson:
 Wilhelm Meier wrote:
  Am Montag, 2. April 2007 schrieb Wilhelm Meier:
  after our conversion I got the quick cifs hack running (using a special
  CLONE-flag for the cifs-thread).
 
  The I got this patch, which changes the api to kthread_run. But, the
  problem remains. I still got this error in dmesg:
 
  I've to correct myself!
  I had a configuration flaw ... if the patch is in place, it works as
  expected. CIFS-shares can be mounted inside the guests.

 Wilhelm,

 Would you be willing to put some instructions together on what it takes
 to do this?

Ok., get the patch from the list and apply it 
to /usr/src/linux-vserver/fs/cifs/connect.c (or whatever you kernel source 
path is).

Recompile the kernel and/or modules (if cifs is a module). be sure to load the 
newly compiled module ;-)

Boot the host into the new kernel or just un/load the cifs module.

Set the ccaps of a guest to binary_mount and secure_mount.

Restart the guest.

Enter the guest and do a

mount.cifs '\\windowsserver\share' /mnt/test -o 
user=windowsusername,pass=password

inside the guest.

That's all. 
Now you can use cifs-mounts inside a guest (like nfs-mounts). 

-- 
Wilhelm Meier
email: [EMAIL PROTECTED]
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] CIFS-mounts in vserver guests: solved

2007-04-03 Thread Daniel Hokka Zakrisson

Wilhelm Meier wrote:

Am Dienstag, 3. April 2007 schrieb Roderick A. Anderson:

Wilhelm Meier wrote:

Am Montag, 2. April 2007 schrieb Wilhelm Meier:

after our conversion I got the quick cifs hack running (using a special
CLONE-flag for the cifs-thread).

The I got this patch, which changes the api to kthread_run. But, the
problem remains. I still got this error in dmesg:

I've to correct myself!
I had a configuration flaw ... if the patch is in place, it works as
expected. CIFS-shares can be mounted inside the guests.

Wilhelm,

Would you be willing to put some instructions together on what it takes
to do this?


Ok., get the patch from the list and apply it 
to /usr/src/linux-vserver/fs/cifs/connect.c (or whatever you kernel source 
path is).


Has the patch been submitted to (and reviewed by) 
linux-kernel@vger.kernel.org, [EMAIL PROTECTED] and 
[EMAIL PROTECTED] Note that it already doesn't follow 
the typical coding style used in the kernel (regarding the if/while( x ) 
thing).


--
Daniel Hokka Zakrisson
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] CIFS-mounts in vserver guests: solved

2007-04-03 Thread Wilhelm Meier
Am Dienstag, 3. April 2007 schrieb Daniel Hokka Zakrisson:
 Has the patch been submitted to (and reviewed by)
 linux-kernel@vger.kernel.org, [EMAIL PROTECTED] and
 [EMAIL PROTECTED] Note that it already doesn't follow
 the typical coding style used in the kernel (regarding the if/while( x )
 thing).

I posted it to [EMAIL PROTECTED] Steve French told me that it 
is actually in the cifs-2.6 git.

-- 
Wilhelm Meier
email: [EMAIL PROTECTED]
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] CIFS-mounts in vserver guests

2007-04-02 Thread Wilhelm Meier
Hi Herbert,

Am Freitag, 30. März 2007 schrieb Herbert Poetzl:

 cya there then ...


after our conversion I got the quick cifs hack running (using a special 
CLONE-flag for the cifs-thread). 

The I got this patch, which changes the api to kthread_run. But, the problem 
remains. I still got this error in dmesg:

vxW: xid=115 tried to spawn a kernel thread.
 CIFS VFS: cifs_mount failed w/return code = -12

The patch works if I try to mount on the host.

Any suggestions?

-
Wilhelm
Index: connect.c
===
--- connect.c	(.../2.6.19.1)	(revision 20)
+++ connect.c	(.../kthread_support)	(revision 20)
@@ -30,6 +30,7 @@
 #include linux/mempool.h
 #include linux/delay.h
 #include linux/completion.h
+#include linux/kthread.h
 #include linux/pagevec.h
 #include asm/uaccess.h
 #include asm/processor.h
@@ -119,7 +120,7 @@
 	struct mid_q_entry * mid_entry;
 	
 	spin_lock(GlobalMid_Lock);
-	if(server-tcpStatus == CifsExiting) {
+	if( kthread_should_stop() ) {
 		/* the demux thread will exit normally 
 		next time through the loop */
 		spin_unlock(GlobalMid_Lock);
@@ -181,7 +182,7 @@
 	spin_unlock(GlobalMid_Lock);
 	up(server-tcpSem); 
 
-	while ((server-tcpStatus != CifsExiting)  (server-tcpStatus != CifsGood))
+	while ( (!kthread_should_stop())  (server-tcpStatus != CifsGood))
 	{
 		try_to_freeze();
 		if(server-protocolType == IPV6) {
@@ -198,7 +199,7 @@
 		} else {
 			atomic_inc(tcpSesReconnectCount);
 			spin_lock(GlobalMid_Lock);
-			if(server-tcpStatus != CifsExiting)
+			if( !kthread_should_stop() )
 server-tcpStatus = CifsGood;
 			server-sequence_number = 0;
 			spin_unlock(GlobalMid_Lock);			
@@ -344,7 +345,6 @@
 	int isMultiRsp;
 	int reconnect;
 
-	daemonize(cifsd);
 	allow_signal(SIGKILL);
 	current-flags |= PF_MEMALLOC;
 	server-tsk = current;	/* save process info to wake at shutdown */
@@ -360,7 +360,7 @@
 			GFP_KERNEL);
 	}
 
-	while (server-tcpStatus != CifsExiting) {
+	while (!kthread_should_stop()) {
 		if (try_to_freeze())
 			continue;
 		if (bigbuf == NULL) {
@@ -399,7 +399,7 @@
 		kernel_recvmsg(csocket, smb_msg,
  iov, 1, 4, 0 /* BB see socket.h flags */);
 
-		if (server-tcpStatus == CifsExiting) {
+		if ( kthread_should_stop() ) {
 			break;
 		} else if (server-tcpStatus == CifsNeedReconnect) {
 			cFYI(1, (Reconnect after server stopped responding));
@@ -523,7 +523,7 @@
 		 total_read += length) {
 			length = kernel_recvmsg(csocket, smb_msg, iov, 1,
 		pdu_length - total_read, 0);
-			if((server-tcpStatus == CifsExiting) ||
+			if( kthread_should_stop() ||
 			(length == -EINTR)) {
 /* then will exit */
 reconnect = 2;
@@ -756,7 +756,6 @@
 			GFP_KERNEL);
 	}
 	
-	complete_and_exit(cifsd_complete, 0);
 	return 0;
 }
 
@@ -1779,10 +1778,11 @@
 			so no need to spinlock this init of tcpStatus */
 			srvTcp-tcpStatus = CifsNew;
 			init_MUTEX(srvTcp-tcpSem);
-			rc = (int)kernel_thread((void *)(void *)cifs_demultiplex_thread, srvTcp,
-  CLONE_FS | CLONE_FILES | CLONE_VM);
-			if(rc  0) {
-rc = -ENOMEM;
+			srvTcp-tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, cifsd);
+			if( IS_ERR(srvTcp-tsk) ) {
+rc = PTR_ERR(srvTcp-tsk);
+cERROR(1,(error %d create cifsd thread, rc));
+srvTcp-tsk = NULL;
 sock_release(csocket);
 kfree(volume_info.UNC);
 kfree(volume_info.password);
@@ -1973,7 +1973,7 @@
 			spin_unlock(GlobalMid_Lock);
 			if(srvTcp-tsk) {
 send_sig(SIGKILL,srvTcp-tsk,1);
-wait_for_completion(cifsd_complete);
+kthread_stop(srvTcp-tsk);
 			}
 		}
 		 /* If find_unc succeeded then rc == 0 so we can not end */
@@ -1987,9 +1987,9 @@
 	temp_rc = CIFSSMBLogoff(xid, pSesInfo);
 	/* if the socketUseCount is now zero */
 	if((temp_rc == -ESHUTDOWN) 
-	   (pSesInfo-server-tsk)) {
+	   (pSesInfo-server)  (pSesInfo-server-tsk)) {
 		send_sig(SIGKILL,pSesInfo-server-tsk,1);
-		wait_for_completion(cifsd_complete);
+		kthread_stop(pSesInfo-server-tsk);
 	}
 } else
 	cFYI(1, (No session or bad tcon));
@@ -3273,7 +3273,7 @@
 cFYI(1,(Waking up socket by sending it signal));
 if(cifsd_task) {
 	send_sig(SIGKILL,cifsd_task,1);
-	wait_for_completion(cifsd_complete);
+	kthread_stop(cifsd_task);
 }
 rc = 0;
 			} /* else - we have an smb session
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] CIFS-mounts in vserver guests: solved

2007-04-02 Thread Wilhelm Meier
Am Montag, 2. April 2007 schrieb Wilhelm Meier:

 after our conversion I got the quick cifs hack running (using a special
 CLONE-flag for the cifs-thread).

 The I got this patch, which changes the api to kthread_run. But, the
 problem remains. I still got this error in dmesg:


I've to correct myself! 
I had a configuration flaw ... if the patch is in place, it works as expected. 
CIFS-shares can be mounted inside the guests.

-
Wilhelm
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


[Vserver] CIFS-mounts in vserver guests

2007-03-29 Thread Wilhelm Meier
Hi all,

I would like to reactivate an old topic, that is mounting cifs-shares inside a 
vserver guest. I tried this some time ago with no luck:

http://www.paul.sladen.org/vserver/archives/200610/0032.html

Was there any activity on this topic in the mean time?

If there is interest in this, I would like to offer some time to do the  
testing ;-)

-- 
Wilhelm Meier
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] CIFS-mounts in vserver guests

2007-03-29 Thread Herbert Poetzl
On Thu, Mar 29, 2007 at 06:38:50PM +0200, Wilhelm Meier wrote:
 Hi all,
 
 I would like to reactivate an old topic, that is mounting cifs-shares
 inside a vserver guest. I tried this some time ago with no luck:
 
 http://www.paul.sladen.org/vserver/archives/200610/0032.html
 
 Was there any activity on this topic in the mean time?

not that I would know of ...

 If there is interest in this, I would like to offer some time 
 to do the testing ;-)

okay, good, first step, please try with vs2.2.0-rc21
maybe it started working in the meantime :)

then, as mentioned in the previous email, try to
catch me on the irc channel (#vserver @ irc.oftc.net)

TIA,
Herbert

 -- 
 Wilhelm Meier
 ___
 Vserver mailing list
 Vserver@list.linux-vserver.org
 http://list.linux-vserver.org/mailman/listinfo/vserver
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver