+ ecryptfs-file-operations-remove-extraneous-read-of-inode-size-from-header.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     ecryptfs: Remove extraneous read of inode size from header

has been added to the -mm tree.  Its filename is

     ecryptfs-file-operations-remove-extraneous-read-of-inode-size-from-header.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ecryptfs: Remove extraneous read of inode size from header
From: Mike Halcrow <mhalcrow@xxxxxxxxxx>


Christoph Hellwig pointed out that the inode is not live at this point
in ecryptfs_open(), and so this entire function is pointless.

Signed-off-by: Michael Halcrow <mhalcrow@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/ecryptfs/file.c |   47 -------------------------------------------
 1 files changed, 1 insertion(+), 46 deletions(-)

diff -puN fs/ecryptfs/file.c~ecryptfs-file-operations-remove-extraneous-read-of-inode-size-from-header fs/ecryptfs/file.c
--- 25/fs/ecryptfs/file.c~ecryptfs-file-operations-remove-extraneous-read-of-inode-size-from-header	Fri May 26 13:48:03 2006
+++ 25-akpm/fs/ecryptfs/file.c	Fri May 26 13:48:03 2006
@@ -189,49 +189,6 @@ retry:
 	return rc;
 }
 
-/**
- * read_inode_size_from_header
- * @lower_file: The lower file struct
- * @lower_inode: The lower inode
- * @inode: The ecryptfs inode
- *
- * Returns zero on success; non-zero otherwise
- */
-static int
-read_inode_size_from_header(struct file *lower_file,
-			    struct inode *lower_inode, struct inode *inode)
-{
-	int rc;
-	struct page *header_page;
-	unsigned char *header_virt;
-	u64 data_size;
-
-	header_page = grab_cache_page(lower_inode->i_mapping, 0);
-	if (!header_page) {
-		rc = -EINVAL;
-		ecryptfs_printk(KERN_ERR, "grab_cache_page for header page "
-				"failed\n");
-		goto out;
-	}
-	header_virt = kmap(header_page);
-	rc = lower_inode->i_mapping->a_ops->readpage(lower_file, header_page);
-	if (rc) {
-		ecryptfs_printk(KERN_ERR, "Error reading header page\n");
-		goto out_unmap;
-	}
-	memcpy(&data_size, header_virt, sizeof(data_size));
-	data_size = be64_to_cpu(data_size);
-	i_size_write(inode, (loff_t)data_size);
-	ecryptfs_printk(KERN_DEBUG, "inode w/ addr = [0x%p], i_ino = [0x%.16x] "
-			"size: [0x%.16x]\n", inode, inode->i_ino,
-			i_size_read(inode));
-out_unmap:
-	kunmap(header_page);
-	page_cache_release(header_page);
-out:
-	return rc;
-}
-
 struct kmem_cache *ecryptfs_file_info_cache;
 
 /**
@@ -320,9 +277,7 @@ static int ecryptfs_open(struct inode *i
 			 * going to default to -EIO. */
 			rc = -EIO;
 			goto out_puts;
-		} else
-			read_inode_size_from_header(lower_file, lower_inode,
-						    inode);
+		}
 	}
 	ecryptfs_printk(KERN_DEBUG, "inode w/ addr = [0x%p], i_ino = [0x%.16x] "
 			"size: [0x%.16x]\n", inode, inode->i_ino,
_

Patches currently in -mm which might be from mhalcrow@xxxxxxxxxx are

ecryptfs-fs-makefile-and-fs-kconfig.patch
ecryptfs-documentation.patch
ecryptfs-makefile.patch
ecryptfs-main-module-functions.patch
ecryptfs-main-module-functions-uint16_t-u16.patch
ecryptfs-header-declarations.patch
ecryptfs-header-declarations-update.patch
ecryptfs-header-declarations-update-convert-signed-data-types-to-unsigned-data-types.patch
ecryptfs-header-declarations-remove-unnecessary-ifndefs.patch
ecryptfs-superblock-operations.patch
ecryptfs-dentry-operations.patch
ecryptfs-file-operations.patch
ecryptfs-file-operations-remove-null-==-syntax.patch
ecryptfs-file-operations-remove-extraneous-read-of-inode-size-from-header.patch
ecryptfs-file-operations-fix.patch
ecryptfs-inode-operations.patch
ecryptfs-mmap-operations.patch
mark-address_space_operations-const-vs-ecryptfs-mmap-operations.patch
ecryptfs-keystore.patch
ecryptfs-crypto-functions.patch
ecryptfs-debug-functions.patch
ecryptfs-alpha-build-fix.patch
ecryptfs-convert-assert-to-bug_on.patch
ecryptfs-remove-unnecessary-null-checks.patch
ecryptfs-rewrite-ecryptfs_fsync.patch
ecryptfs-overhaul-file-locking.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux