The patch titled eCryptfs: Graceful handling of mount error has been added to the -mm tree. Its filename is ecryptfs-graceful-handling-of-mount-error.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: Graceful handling of mount error From: Michael Halcrow <mhalcrow@xxxxxxxxxx> This fixes the error path for when eCryptfs has trouble mounting. Signed-off-by: Michael Halcrow <mhalcrow@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/ecryptfs/main.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff -puN fs/ecryptfs/main.c~ecryptfs-graceful-handling-of-mount-error fs/ecryptfs/main.c --- a/fs/ecryptfs/main.c~ecryptfs-graceful-handling-of-mount-error +++ a/fs/ecryptfs/main.c @@ -369,18 +369,6 @@ out: struct kmem_cache *ecryptfs_sb_info_cache; /** - * ecryptfs_cleanup_read_super - * @sb: The ecryptfs super block - * - * Preform the cleanup for ecryptfs_read_super() - */ -static void ecryptfs_cleanup_read_super(struct super_block *sb) -{ - up_write(&sb->s_umount); - deactivate_super(sb); -} - -/** * ecryptfs_fill_super * @sb: The ecryptfs super block * @raw_data: The options passed to mount @@ -433,7 +421,7 @@ ecryptfs_fill_super(struct super_block * sizeof(struct ecryptfs_dentry_info)); rc = 0; out: - /* Should be able to rely on deactive_super called from + /* Should be able to rely on deactivate_super called from * get_sb_nodev */ return rc; } @@ -476,7 +464,6 @@ static int ecryptfs_read_super(struct su goto out; out_free: path_release(&nd); - ecryptfs_cleanup_read_super(sb); out: return rc; } @@ -502,30 +489,31 @@ static int ecryptfs_get_sb(struct file_s struct vfsmount *mnt) { int rc; - int ret; struct super_block *sb; - ret = get_sb_nodev(fs_type, flags, raw_data, ecryptfs_fill_super, mnt); - if (ret < 0) { - ecryptfs_printk(KERN_ERR, "Getting sb failed: %d\n", ret); + rc = get_sb_nodev(fs_type, flags, raw_data, ecryptfs_fill_super, mnt); + if (rc < 0) { + printk(KERN_ERR "Getting sb failed; rc = [%d]\n", rc); goto out; } sb = mnt->mnt_sb; rc = ecryptfs_parse_options(sb, raw_data); if (rc) { - deactivate_super(sb); - ret = rc; - goto out; + printk(KERN_ERR "Error parsing options; rc = [%d]\n", rc); + goto out_abort; } rc = ecryptfs_read_super(sb, dev_name); if (rc) { - up_write(&sb->s_umount); - deactivate_super(sb); - ret = rc; - ecryptfs_printk(KERN_ERR, "Reading sb failed: %d\n", ret); + printk(KERN_ERR "Reading sb failed; rc = [%d]\n", rc); + goto out_abort; } + goto out; +out_abort: + dput(sb->s_root); + up_write(&sb->s_umount); + deactivate_super(sb); out: - return ret; + return rc; } /** _ Patches currently in -mm which might be from mhalcrow@xxxxxxxxxx are lsm-remove-bsd-secure-level-security-module.patch ecryptfs-fs-makefile-and-fs-kconfig.patch ecryptfs-fs-makefile-and-fs-kconfig-kconfig-help-update.patch ecryptfs-documentation.patch ecryptfs-makefile.patch ecryptfs-main-module-functions.patch ecryptfs-header-declarations.patch ecryptfs-superblock-operations.patch ecryptfs-dentry-operations.patch ecryptfs-file-operations.patch ecryptfs-inode-operations.patch ecryptfs-mmap-operations.patch ecryptfs-mmap-operations-fix.patch ecryptfs-keystore.patch ecryptfs-crypto-functions.patch fs-ecryptfs-possible-cleanups.patch ecryptfs-debug-functions.patch ecryptfs-alpha-build-fix.patch ecryptfs-convert-assert-to-bug_on.patch ecryptfs-remove-pointless-bug_ons.patch ecryptfs-remove-unnecessary-null-checks.patch ecryptfs-rewrite-ecryptfs_fsync.patch ecryptfs-overhaul-file-locking.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 - 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