aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs/inode.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2007-02-19 05:34:43 -0500
committerPierre Ossman <drzeus@drzeus.cx>2007-03-06 07:26:27 -0500
commitc5f93cf19df633a8dbd7adf8130d604eec96e145 (patch)
treee58a062b40b9ed1c9be9bcaac4302da98ae6082f /fs/ncpfs/inode.c
parentc3442e296517aee733d62fc3fe03211598902c7d (diff)
ncpfs: make sure server connection survives a kill
Use internal buffers instead of the ones supplied by the caller so that a caller can be interrupted without having to abort the entire ncp connection. Signed-off-by: Pierre Ossman <ossman@cendio.se> Acked-by: Petr Vandrovec <petr@vandrovec.name>
Diffstat (limited to 'fs/ncpfs/inode.c')
-rw-r--r--fs/ncpfs/inode.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 14939ddf74f1..7285c94956c4 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -576,6 +576,12 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
576 server->packet = vmalloc(NCP_PACKET_SIZE); 576 server->packet = vmalloc(NCP_PACKET_SIZE);
577 if (server->packet == NULL) 577 if (server->packet == NULL)
578 goto out_nls; 578 goto out_nls;
579 server->txbuf = vmalloc(NCP_PACKET_SIZE);
580 if (server->txbuf == NULL)
581 goto out_packet;
582 server->rxbuf = vmalloc(NCP_PACKET_SIZE);
583 if (server->rxbuf == NULL)
584 goto out_txbuf;
579 585
580 sock->sk->sk_data_ready = ncp_tcp_data_ready; 586 sock->sk->sk_data_ready = ncp_tcp_data_ready;
581 sock->sk->sk_error_report = ncp_tcp_error_report; 587 sock->sk->sk_error_report = ncp_tcp_error_report;
@@ -597,7 +603,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
597 error = ncp_connect(server); 603 error = ncp_connect(server);
598 ncp_unlock_server(server); 604 ncp_unlock_server(server);
599 if (error < 0) 605 if (error < 0)
600 goto out_packet; 606 goto out_rxbuf;
601 DPRINTK("ncp_fill_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb)); 607 DPRINTK("ncp_fill_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb));
602 608
603 error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */ 609 error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */
@@ -666,8 +672,12 @@ out_disconnect:
666 ncp_lock_server(server); 672 ncp_lock_server(server);
667 ncp_disconnect(server); 673 ncp_disconnect(server);
668 ncp_unlock_server(server); 674 ncp_unlock_server(server);
669out_packet: 675out_rxbuf:
670 ncp_stop_tasks(server); 676 ncp_stop_tasks(server);
677 vfree(server->rxbuf);
678out_txbuf:
679 vfree(server->txbuf);
680out_packet:
671 vfree(server->packet); 681 vfree(server->packet);
672out_nls: 682out_nls:
673#ifdef CONFIG_NCPFS_NLS 683#ifdef CONFIG_NCPFS_NLS
@@ -723,6 +733,8 @@ static void ncp_put_super(struct super_block *sb)
723 733
724 kfree(server->priv.data); 734 kfree(server->priv.data);
725 kfree(server->auth.object_name); 735 kfree(server->auth.object_name);
736 vfree(server->rxbuf);
737 vfree(server->txbuf);
726 vfree(server->packet); 738 vfree(server->packet);
727 sb->s_fs_info = NULL; 739 sb->s_fs_info = NULL;
728 kfree(server); 740 kfree(server);