patch-2.4.0-test3 linux/fs/ncpfs/ioctl.c

Next file: linux/fs/ncpfs/mmap.c
Previous file: linux/fs/ncpfs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/fs/ncpfs/ioctl.c linux/fs/ncpfs/ioctl.c
@@ -335,18 +335,12 @@
 			{
 				return result;
 			}
+			result = -EIO;
 			if (!ncp_conn_valid(server))
-			{
-				return -EIO;
-			}
+				goto outrel;
+			result = -EISDIR;
 			if (!S_ISREG(inode->i_mode))
-			{
-				return -EISDIR;
-			}
-			if (!NCP_FINFO(inode)->opened)
-			{
-				return -EBADFD;
-			}
+				goto outrel;
 			if (rqdata.cmd == NCP_LOCK_CLEAR)
 			{
 				result = ncp_ClearPhysicalRecord(NCP_SERVER(inode),
@@ -373,6 +367,8 @@
 							rqdata.timeout);
 				if (result > 0) result = -EAGAIN;
 			}
+outrel:			
+			ncp_inode_close(inode);
 			return result;
 		}
 #endif	/* CONFIG_NCPFS_IOCTL_LOCKING */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)