patch-2.2.6 linux/fs/ntfs/fs.c

Next file: linux/fs/ntfs/inode.c
Previous file: linux/fs/ntfs/dir.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.5/linux/fs/ntfs/fs.c linux/fs/ntfs/fs.c
@@ -2,7 +2,7 @@
  *  fs.c
  *  NTFS driver for Linux 2.1
  *
- *  Copyright (C) 1995-1997 Martin von Löwis
+ *  Copyright (C) 1995-1997, 1999 Martin von Löwis
  *  Copyright (C) 1996 Richard Russon
  *  Copyright (C) 1996-1997 Régis Duchesne
  */
@@ -387,6 +387,8 @@
 	if(error)
 		return error;
 	item=ntfs_malloc(ITEM_SIZE);
+	if( !item )
+		return ENOMEM;
 	/* ntfs_getdir will place the directory entry into item,
 	   and the first long long is the MFT record number */
 	walk.type=BY_NAME;
@@ -583,8 +585,6 @@
 	int ret=ntfs_vcn_to_lcn(NTFS_LINO2NINO(ino),block);
 	ntfs_debug(DEBUG_OTHER, "bmap of %lx,block %x is %x\n",
 	       ino->i_ino,block,ret);
-	ntfs_error("bmap of %lx,block %x is %x\n", ino->i_ino,block,ret);
-	ntfs_error("super %x\n", ino->i_sb->s_blocksize); 
 	return (ret==-1) ? 0:ret;
 }
 
@@ -709,6 +709,7 @@
 		#ifdef NTFS_IN_LINUX_KERNEL
 		ino=&inode->u.ntfs_i;
 		#else
+		/* FIXME: check for ntfs_malloc failure */
 		ino=(ntfs_inode*)ntfs_malloc(sizeof(ntfs_inode));
 		inode->u.generic_ip=ino;
 		#endif
@@ -818,6 +819,7 @@
 	struct statfs fs;
 	struct inode *mft;
 	ntfs_volume *vol;
+	int error;
 
 	ntfs_debug(DEBUG_OTHER, "ntfs_statfs\n");
 	vol=NTFS_SB2VOL(sb);
@@ -825,7 +827,9 @@
 	fs.f_type=NTFS_SUPER_MAGIC;
 	fs.f_bsize=vol->clustersize;
 
-	fs.f_blocks=ntfs_get_volumesize(NTFS_SB2VOL(sb));
+	error = ntfs_get_volumesize( NTFS_SB2VOL( sb ), &fs.f_blocks );
+	if( error )
+		return error;
 	fs.f_bfree=ntfs_get_free_cluster_count(vol->bitmap);
 	fs.f_bavail=fs.f_bfree;
 

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