- ecryptfs-remove-lock-propagation.patch removed from -mm tree

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

 



The patch titled

     eCryptfs: Remove lock propagation

has been removed from the -mm tree.  Its filename is

     ecryptfs-remove-lock-propagation.patch

This patch was dropped because it was folded into ecryptfs-fs-makefile-and-fs-kconfig.patch

------------------------------------------------------
Subject: eCryptfs: Remove lock propagation
From: Michael Halcrow <mhalcrow@xxxxxxxxxx>

Remove propagation of locks down to the lower filesystem.

The current implementation does not work right (in some use case scenarios,
IS_FLOCK(fl) and IS_LEASE(fl) are both false for the lower file in
locks_remove_flock(), leading to a BUG()).  I attribute this to the fact
that the code is copied and hacked from locks.c, when in reality, stacked
filesystems should find a way to call the locking code in locks.c.  As long
as there is no propagation of locks up from the lower filesystem, there
really is little point in pretending to keep upper and lower locks in sync.
 When eCryptfs is operating on the files in a lower directory, nothing else
should be trying to operate on those files at the same time.

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

 fs/ecryptfs/file.c |   99 -------------------------------------------
 1 file changed, 99 deletions(-)

diff -puN fs/ecryptfs/file.c~ecryptfs-remove-lock-propagation fs/ecryptfs/file.c
--- a/fs/ecryptfs/file.c~ecryptfs-remove-lock-propagation
+++ a/fs/ecryptfs/file.c
@@ -340,83 +340,6 @@ ecryptfs_fsync(struct file *file, struct
 	return rc;
 }
 
-static int ecryptfs_setlk(struct file *file, int cmd, struct file_lock *fl)
-{
-	struct file *lower_file = ecryptfs_file_to_lower(file);
-	struct inode *lower_inode = lower_file->f_dentry->d_inode;
-	int rc;
-
-	/* Don't allow mandatory locks on files that may be memory mapped
-	 * and shared. */
-	if (IS_MANDLOCK(lower_inode) &&
-	    (lower_inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID &&
-	    mapping_writably_mapped(lower_file->f_mapping)) {
-		rc = -EAGAIN;
-		goto out;
-	}
-	if (IS_SETLKW(cmd))
-		fl->fl_flags |= FL_SLEEP;
-	rc = -EBADF;
-	switch (fl->fl_type) {
-	case F_RDLCK:
-		if (!(lower_file->f_mode & FMODE_READ))
-			goto out;
-		break;
-	case F_WRLCK:
-		if (!(lower_file->f_mode & FMODE_WRITE))
-			goto out;
-		break;
-	case F_UNLCK:
-		break;
-	default:
-		rc = -EINVAL;
-		goto out;
-	}
-	fl->fl_file = lower_file;
-	rc = security_file_lock(lower_file, fl->fl_type);
-	if (rc)
-		goto out;
-	if (lower_file->f_op && lower_file->f_op->lock) {
-		rc = lower_file->f_op->lock(lower_file, cmd, fl);
-		if (rc)
-			goto out;
-		goto upper_lock;
-	}
-	rc = posix_lock_file_wait(lower_file, fl);
-	if (rc)
-		goto out;
-upper_lock:
-	fl->fl_file = file;
-	rc = posix_lock_file_wait(lower_file, fl);
-	if (rc) {
-		fl->fl_type = F_UNLCK;
-		fl->fl_file = lower_file;
-		rc = posix_lock_file_wait(lower_file, fl);
-	}
-out:
-	return rc;
-}
-
-static int ecryptfs_getlk(struct file *file, int cmd, struct file_lock *fl)
-{
-	struct file_lock cfl;
-	struct file_lock *tempfl = NULL;
-	int rc = 0;
-
-	if (file->f_op && file->f_op->lock) {
-		rc = file->f_op->lock(file, cmd, fl);
-		if (rc < 0)
-			goto out;
-	} else
-		tempfl = (posix_test_lock(file, fl, &cfl) ? &cfl : NULL);
-	if (!tempfl)
-		fl->fl_type = F_UNLCK;
-	else
-		memcpy(fl, tempfl, sizeof(struct file_lock));
-out:
-	return rc;
-}
-
 static int ecryptfs_fasync(int fd, struct file *file, int flag)
 {
 	int rc = 0;
@@ -428,26 +351,6 @@ static int ecryptfs_fasync(int fd, struc
 	return rc;
 }
 
-static int ecryptfs_lock(struct file *file, int cmd, struct file_lock *fl)
-{
-	struct file *lower_file = ecryptfs_file_to_lower(file);
-	int rc = -EINVAL;
-
-	if (!fl)
-		goto out;
-	if (IS_GETLK(cmd)) {
-		fl->fl_file = lower_file;
-		rc = ecryptfs_getlk(lower_file, cmd, fl);
-		fl->fl_file = file;
-	} else if (IS_SETLK(cmd) || IS_SETLKW(cmd)) {
-		fl->fl_file = file;
-		rc = ecryptfs_setlk(file, cmd, fl);
-	} else
-		fl->fl_file = file;
-out:
-	return rc;
-}
-
 static ssize_t ecryptfs_sendfile(struct file *file, loff_t * ppos,
 				 size_t count, read_actor_t actor, void *target)
 {
@@ -474,7 +377,6 @@ const struct file_operations ecryptfs_di
 	.release = ecryptfs_release,
 	.fsync = ecryptfs_fsync,
 	.fasync = ecryptfs_fasync,
-	.lock = ecryptfs_lock,
 	.sendfile = ecryptfs_sendfile,
 };
 
@@ -490,7 +392,6 @@ const struct file_operations ecryptfs_ma
 	.release = ecryptfs_release,
 	.fsync = ecryptfs_fsync,
 	.fasync = ecryptfs_fasync,
-	.lock = ecryptfs_lock,
 	.sendfile = ecryptfs_sendfile,
 };
 
_

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

origin.patch
ecryptfs-fs-makefile-and-fs-kconfig.patch
ecryptfs-remove-lock-propagation.patch
ecryptfs-dont-muck-with-the-existing-nameidata-structures.patch
ecryptfs-asm-scatterlisth-linux-scatterlisth.patch
ecryptfs-support-for-larger-maximum-key-size.patch
ecryptfs-add-codes-for-additional-ciphers.patch
ecryptfs-unencrypted-key-size-based-on-encrypted-key-size.patch
ecryptfs-packet-and-key-management-update-for-variable-key-size.patch
ecryptfs-add-ecryptfs_-prefix-to-mount-options-key-size-parameter.patch
ecryptfs-set-the-key-size-from-the-default-for-the-mount.patch
ecryptfs-check-for-weak-keys.patch
ecryptfs-add-define-values-for-cipher-codes-from-rfc2440-openpgp.patch
ecryptfs-convert-bits-to-bytes.patch
ecryptfs-more-elegant-aes-key-size-manipulation.patch
ecryptfs-more-intelligent-use-of-tfm-objects.patch
ecryptfs-remove-debugging-cruft.patch
ecryptfs-get_sb_dev-fix.patch
ecryptfs-validate-minimum-header-extent-size.patch
ecryptfs-validate-body-size.patch
ecryptfs-validate-packet-length-prior-to-parsing-add-comments.patch
ecryptfs-use-the-passed-in-max-value-as-the-upper-bound.patch
ecryptfs-change-the-maximum-size-check-when-writing-header.patch
ecryptfs-print-the-actual-option-that-is-problematic.patch
ecryptfs-add-a-maintainers-entry.patch
ecryptfs-partial-signed-integer-to-size_t-conversion-updated-ii.patch
ecryptfs-graceful-handling-of-mount-error.patch
ecryptfs-fix-printk-format-warnings.patch
ecryptfs-associate-vfsmount-with-dentry-rather-than-superblock.patch
ecryptfs-mntput-lower-mount-on-umount_begin.patch
vfs-make-filldir_t-and-struct-kstat-deal-in-64-bit-inode-numbers-ecryptfs.patch
make-kmem_cache_destroy-return-void-ecryptfs.patch
ecryptfs-inode-numbering-fixes.patch
ecryptfs-versioning-fixes.patch
ecryptfs-versioning-fixes-tidy.patch
ecryptfs-grab-lock-on-lower_page-in-ecryptfs_sync_page.patch
ecryptfs-enable-plaintext-passthrough.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