Przeglądaj źródła

Merge git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs

Here are some trivial NTFS changes (a spelling fix and two use before
NULL check cases found by Coverity as well as an update in MAINTAINERS
for the path to the ntfs git repo) together with a simple LDM fix for
parsing fragmented VBLKs.

* git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs:
  NTFS: Update git repo path in MAINTAINERS file.
  LDM: Fix reassembly of extended VBLKs.
  NTFS: Correct two spelling errors "dealocate" to "deallocate" in mft.c.
  NTFS: Do not dereference pointer before checking for NULL.
  NTFS: Remove unused variable.
Linus Torvalds 13 lat temu
rodzic
commit
5ffca28a4a
5 zmienionych plików z 12 dodań i 17 usunięć
  1. 1 1
      MAINTAINERS
  2. 4 7
      block/partitions/ldm.c
  3. 3 3
      fs/ntfs/attrib.c
  4. 3 3
      fs/ntfs/mft.c
  5. 1 3
      fs/ntfs/super.c

+ 1 - 1
MAINTAINERS

@@ -4685,7 +4685,7 @@ NTFS FILESYSTEM
 M:	Anton Altaparmakov <anton@tuxera.com>
 M:	Anton Altaparmakov <anton@tuxera.com>
 L:	linux-ntfs-dev@lists.sourceforge.net
 L:	linux-ntfs-dev@lists.sourceforge.net
 W:	http://www.tuxera.com/
 W:	http://www.tuxera.com/
-T:	git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs.git
 S:	Supported
 S:	Supported
 F:	Documentation/filesystems/ntfs.txt
 F:	Documentation/filesystems/ntfs.txt
 F:	fs/ntfs/
 F:	fs/ntfs/

+ 4 - 7
block/partitions/ldm.c

@@ -2,7 +2,7 @@
  * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
  * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
  *
  *
  * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
  * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
- * Copyright (c) 2001-2007 Anton Altaparmakov
+ * Copyright (c) 2001-2012 Anton Altaparmakov
  * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
  * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
  *
  *
  * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads 
  * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads 
@@ -1341,20 +1341,17 @@ found:
 		ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);
 		ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);
 		return false;
 		return false;
 	}
 	}
-
 	if (f->map & (1 << rec)) {
 	if (f->map & (1 << rec)) {
 		ldm_error ("Duplicate VBLK, part %d.", rec);
 		ldm_error ("Duplicate VBLK, part %d.", rec);
 		f->map &= 0x7F;			/* Mark the group as broken */
 		f->map &= 0x7F;			/* Mark the group as broken */
 		return false;
 		return false;
 	}
 	}
-
 	f->map |= (1 << rec);
 	f->map |= (1 << rec);
-
+	if (!rec)
+		memcpy(f->data, data, VBLK_SIZE_HEAD);
 	data += VBLK_SIZE_HEAD;
 	data += VBLK_SIZE_HEAD;
 	size -= VBLK_SIZE_HEAD;
 	size -= VBLK_SIZE_HEAD;
-
-	memcpy (f->data+rec*(size-VBLK_SIZE_HEAD)+VBLK_SIZE_HEAD, data, size);
-
+	memcpy(f->data + VBLK_SIZE_HEAD + rec * size, data, size);
 	return true;
 	return true;
 }
 }
 
 

+ 3 - 3
fs/ntfs/attrib.c

@@ -1,7 +1,7 @@
 /**
 /**
  * attrib.c - NTFS attribute operations.  Part of the Linux-NTFS project.
  * attrib.c - NTFS attribute operations.  Part of the Linux-NTFS project.
  *
  *
- * Copyright (c) 2001-2007 Anton Altaparmakov
+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
  * Copyright (c) 2002 Richard Russon
  * Copyright (c) 2002 Richard Russon
  *
  *
  * This program/include file is free software; you can redistribute it and/or
  * This program/include file is free software; you can redistribute it and/or
@@ -345,10 +345,10 @@ LCN ntfs_attr_vcn_to_lcn_nolock(ntfs_inode *ni, const VCN vcn,
 	unsigned long flags;
 	unsigned long flags;
 	bool is_retry = false;
 	bool is_retry = false;
 
 
+	BUG_ON(!ni);
 	ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.",
 	ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.",
 			ni->mft_no, (unsigned long long)vcn,
 			ni->mft_no, (unsigned long long)vcn,
 			write_locked ? "write" : "read");
 			write_locked ? "write" : "read");
-	BUG_ON(!ni);
 	BUG_ON(!NInoNonResident(ni));
 	BUG_ON(!NInoNonResident(ni));
 	BUG_ON(vcn < 0);
 	BUG_ON(vcn < 0);
 	if (!ni->runlist.rl) {
 	if (!ni->runlist.rl) {
@@ -469,9 +469,9 @@ runlist_element *ntfs_attr_find_vcn_nolock(ntfs_inode *ni, const VCN vcn,
 	int err = 0;
 	int err = 0;
 	bool is_retry = false;
 	bool is_retry = false;
 
 
+	BUG_ON(!ni);
 	ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.",
 	ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.",
 			ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out");
 			ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out");
-	BUG_ON(!ni);
 	BUG_ON(!NInoNonResident(ni));
 	BUG_ON(!NInoNonResident(ni));
 	BUG_ON(vcn < 0);
 	BUG_ON(vcn < 0);
 	if (!ni->runlist.rl) {
 	if (!ni->runlist.rl) {

+ 3 - 3
fs/ntfs/mft.c

@@ -1,7 +1,7 @@
 /**
 /**
  * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.
  * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.
  *
  *
- * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc.
+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
  * Copyright (c) 2002 Richard Russon
  * Copyright (c) 2002 Richard Russon
  *
  *
  * This program/include file is free software; you can redistribute it and/or
  * This program/include file is free software; you can redistribute it and/or
@@ -1367,7 +1367,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)
 			ntfs_error(vol->sb, "Failed to merge runlists for mft "
 			ntfs_error(vol->sb, "Failed to merge runlists for mft "
 					"bitmap.");
 					"bitmap.");
 			if (ntfs_cluster_free_from_rl(vol, rl2)) {
 			if (ntfs_cluster_free_from_rl(vol, rl2)) {
-				ntfs_error(vol->sb, "Failed to dealocate "
+				ntfs_error(vol->sb, "Failed to deallocate "
 						"allocated cluster.%s", es);
 						"allocated cluster.%s", es);
 				NVolSetErrors(vol);
 				NVolSetErrors(vol);
 			}
 			}
@@ -1805,7 +1805,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
 		ntfs_error(vol->sb, "Failed to merge runlists for mft data "
 		ntfs_error(vol->sb, "Failed to merge runlists for mft data "
 				"attribute.");
 				"attribute.");
 		if (ntfs_cluster_free_from_rl(vol, rl2)) {
 		if (ntfs_cluster_free_from_rl(vol, rl2)) {
-			ntfs_error(vol->sb, "Failed to dealocate clusters "
+			ntfs_error(vol->sb, "Failed to deallocate clusters "
 					"from the mft data attribute.%s", es);
 					"from the mft data attribute.%s", es);
 			NVolSetErrors(vol);
 			NVolSetErrors(vol);
 		}
 		}

+ 1 - 3
fs/ntfs/super.c

@@ -1,7 +1,7 @@
 /*
 /*
  * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project.
  * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project.
  *
  *
- * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc.
+ * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc.
  * Copyright (c) 2001,2002 Richard Russon
  * Copyright (c) 2001,2002 Richard Russon
  *
  *
  * This program/include file is free software; you can redistribute it and/or
  * This program/include file is free software; you can redistribute it and/or
@@ -1239,7 +1239,6 @@ static int check_windows_hibernation_status(ntfs_volume *vol)
 {
 {
 	MFT_REF mref;
 	MFT_REF mref;
 	struct inode *vi;
 	struct inode *vi;
-	ntfs_inode *ni;
 	struct page *page;
 	struct page *page;
 	u32 *kaddr, *kend;
 	u32 *kaddr, *kend;
 	ntfs_name *name = NULL;
 	ntfs_name *name = NULL;
@@ -1290,7 +1289,6 @@ static int check_windows_hibernation_status(ntfs_volume *vol)
 				"is not the system volume.", i_size_read(vi));
 				"is not the system volume.", i_size_read(vi));
 		goto iput_out;
 		goto iput_out;
 	}
 	}
-	ni = NTFS_I(vi);
 	page = ntfs_map_page(vi->i_mapping, 0);
 	page = ntfs_map_page(vi->i_mapping, 0);
 	if (IS_ERR(page)) {
 	if (IS_ERR(page)) {
 		ntfs_error(vol->sb, "Failed to read from hiberfil.sys.");
 		ntfs_error(vol->sb, "Failed to read from hiberfil.sys.");