25 Jan, 2014

1 commit

  • If ecryptfs_readlink_lower() fails, buf remains an uninitialized
    pointer and passing it nd_set_link() won't do anything good.

    Fixed by switching ecryptfs_readlink_lower() to saner API - make it
    return buf or ERR_PTR(...) and update callers.

    Signed-off-by: Al Viro

    Al Viro
     

23 Nov, 2013

1 commit


15 Nov, 2013

2 commits

  • Use this new function to make code more comprehensible, since we are
    reinitialzing the completion, not initializing.

    [akpm@linux-foundation.org: linux-next resyncs]
    Signed-off-by: Wolfram Sang
    Acked-by: Linus Walleij (personally at LCE13)
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • When accessing the lower_file pointer located in private_data of
    eCryptfs files, there is no need to check to see if the private_data
    pointer has been initialized to a non-NULL value. The file->private_data
    and file->private_data->lower_file pointers are always initialized to
    non-NULL values in ecryptfs_open().

    This change quiets a Smatch warning:

    CHECK /var/scm/kernel/linux/fs/ecryptfs/file.c
    fs/ecryptfs/file.c:321 ecryptfs_unlocked_ioctl() error: potential NULL dereference 'lower_file'.
    fs/ecryptfs/file.c:335 ecryptfs_compat_ioctl() error: potential NULL dereference 'lower_file'.

    Signed-off-by: Tyler Hicks
    Reported-by: Dan Carpenter
    Reviewed-by: Geyslan G. Bem
    Cc: Al Viro

    Tyler Hicks
     

13 Nov, 2013

1 commit

  • Pull vfs updates from Al Viro:
    "All kinds of stuff this time around; some more notable parts:

    - RCU'd vfsmounts handling
    - new primitives for coredump handling
    - files_lock is gone
    - Bruce's delegations handling series
    - exportfs fixes

    plus misc stuff all over the place"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (101 commits)
    ecryptfs: ->f_op is never NULL
    locks: break delegations on any attribute modification
    locks: break delegations on link
    locks: break delegations on rename
    locks: helper functions for delegation breaking
    locks: break delegations on unlink
    namei: minor vfs_unlink cleanup
    locks: implement delegations
    locks: introduce new FL_DELEG lock flag
    vfs: take i_mutex on renamed file
    vfs: rename I_MUTEX_QUOTA now that it's not used for quotas
    vfs: don't use PARENT/CHILD lock classes for non-directories
    vfs: pull ext4's double-i_mutex-locking into common code
    exportfs: fix quadratic behavior in filehandle lookup
    exportfs: better variable name
    exportfs: move most of reconnect_path to helper function
    exportfs: eliminate unused "noprogress" counter
    exportfs: stop retrying once we race with rename/remove
    exportfs: clear DISCONNECTED on all parents sooner
    exportfs: more detailed comment for path_reconnect
    ...

    Linus Torvalds
     

10 Nov, 2013

1 commit


09 Nov, 2013

4 commits

  • NFSv4 uses leases to guarantee that clients can cache metadata as well
    as data.

    Cc: Mikulas Patocka
    Cc: David Howells
    Cc: Tyler Hicks
    Cc: Dustin Kirkland
    Acked-by: Jeff Layton
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Al Viro

    J. Bruce Fields
     
  • Cc: Tyler Hicks
    Cc: Dustin Kirkland
    Acked-by: Jeff Layton
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Al Viro

    J. Bruce Fields
     
  • Cc: David Howells
    Acked-by: Jeff Layton
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Al Viro

    J. Bruce Fields
     
  • We need to break delegations on any operation that changes the set of
    links pointing to an inode. Start with unlink.

    Such operations also hold the i_mutex on a parent directory. Breaking a
    delegation may require waiting for a timeout (by default 90 seconds) in
    the case of a unresponsive NFS client. To avoid blocking all directory
    operations, we therefore drop locks before waiting for the delegation.
    The logic then looks like:

    acquire locks
    ...
    test for delegation; if found:
    take reference on inode
    release locks
    wait for delegation break
    drop reference on inode
    retry

    It is possible this could never terminate. (Even if we take precautions
    to prevent another delegation being acquired on the same inode, we could
    get a different inode on each retry.) But this seems very unlikely.

    The initial test for a delegation happens after the lock on the target
    inode is acquired, but the directory inode may have been acquired
    further up the call stack. We therefore add a "struct inode **"
    argument to any intervening functions, which we use to pass the inode
    back up to the caller in the case it needs a delegation synchronously
    broken.

    Cc: David Howells
    Cc: Tyler Hicks
    Cc: Dustin Kirkland
    Acked-by: Jeff Layton
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Al Viro

    J. Bruce Fields
     

25 Oct, 2013

7 commits


17 Oct, 2013

1 commit


07 Sep, 2013

2 commits


12 Jul, 2013

1 commit

  • …el/git/tyhicks/ecryptfs

    Pull eCryptfs updates from Tyler Hicks:
    "Code cleanups and improved buffer handling during page crypto
    operations:
    - Remove redundant code by merging some encrypt and decrypt functions
    - Get rid of a helper page allocation during page decryption by using
    in-place decryption
    - Better use of entire pages during page crypto operations
    - Several code cleanups"

    * tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
    Use ecryptfs_dentry_to_lower_path in a couple of places
    eCryptfs: Make extent and scatterlist crypt function parameters similar
    eCryptfs: Collapse crypt_page_offset() into crypt_extent()
    eCryptfs: Merge ecryptfs_encrypt_extent() and ecryptfs_decrypt_extent()
    eCryptfs: Combine page_offset crypto functions
    eCryptfs: Combine encrypt_scatterlist() and decrypt_scatterlist()
    eCryptfs: Decrypt pages in-place
    eCryptfs: Accept one offset parameter in page offset crypto functions
    eCryptfs: Simplify lower file offset calculation
    eCryptfs: Read/write entire page during page IO
    eCryptfs: Use entire helper page during page crypto operations
    eCryptfs: Cocci spatch "memdup.spatch"

    Linus Torvalds
     

10 Jul, 2013

1 commit

  • There are two places in ecryptfs that benefit from using
    ecryptfs_dentry_to_lower_path() instead of separate calls to
    ecryptfs_dentry_to_lower() and ecryptfs_dentry_to_lower_mnt(). Both
    sites use fewer instructions and less stack (determined by examining
    objdump output).

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Tyler Hicks

    Matthew Wilcox
     

05 Jul, 2013

1 commit


29 Jun, 2013

3 commits


08 Jun, 2013

11 commits


05 Jun, 2013

1 commit


25 May, 2013

1 commit

  • When msync is called on a memory mapped file, that
    data is not flushed to the disk.

    In Linux, msync calls fsync for the file. For ecryptfs,
    fsync just calls the lower level file system's fsync.
    Changed the ecryptfs fsync code to call filemap_write_and_wait
    before calling the lower level fsync.

    Addresses the problem described in http://crbug.com/239536

    Signed-off-by: Paul Taysom
    Signed-off-by: Tyler Hicks
    Cc: stable@vger.kernel.org # v3.6+

    Paul Taysom
     

11 May, 2013

1 commit

  • …ernel/git/tyhicks/ecryptfs

    Pull eCryptfs update from Tyler Hicks:
    "Improve performance when AES-NI (and most likely other crypto
    accelerators) is available by moving to the ablkcipher crypto API.
    The improvement is more apparent on faster storage devices.

    There's no noticeable change when hardware crypto is not available"

    * tag 'ecryptfs-3.10-rc1-ablkcipher' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
    eCryptfs: Use the ablkcipher crypto API

    Linus Torvalds