08 Feb, 2008

5 commits

  • Factor out file-specific ioctl code into smaller helper functions, away from
    file_ioctl(). This helps code readability and also reduces indentation inside
    case statements.

    Signed-off-by: Erez Zadok
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Erez Zadok
     
  • Rename old vfs_ioctl to do_ioctl, because the comment above it clearly
    indicates that it is an internal function not to be exported to modules;
    therefore it should have a more traditional do_XXX name. The new do_ioctl
    is exported in fs.h but not to modules.

    Rename the old do_ioctl to vfs_ioctl because the names vfs_XXX should
    preferably be reserved to callable VFS functions which modules may call, as
    many other vfs_XXX functions already do. Export the new vfs_ioctl to GPL
    modules so others can use it (including Unionfs and eCryptfs). Add DocBook
    for new vfs_ioctl.

    [akpm@linux-foundation.org: fix build]
    Signed-off-by: Erez Zadok
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Erez Zadok
     
  • Signed-off-by: Erez Zadok
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Erez Zadok
     
  • The gl_owner_pid field is used to get the lock owning task by its pid, so make
    it in a proper manner, i.e. by using the struct pid pointer and pid_task()
    function.

    The pid_task() becomes exported for the gfs2 module.

    Signed-off-by: Pavel Emelyanov
    Cc: "Eric W. Biederman"
    Acked-by: Steven Whitehouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     
  • The gl_owner_pid field is used to get the holder task by its pid and check
    whether the current is a holder, so make it in a proper manner, i.e. via the
    struct pid * manipulations.

    Signed-off-by: Pavel Emelyanov
    Cc: "Eric W. Biederman"
    Acked-by: Steven Whitehouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     

07 Feb, 2008

35 commits

  • This merges the mux.c (including the connection interface) with trans_fd
    in preparation for transport API changes. Ultimately, trans_fd will need
    to be rewritten to clean it up and simplify the implementation, but this
    reorganization is viewed as the first step.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • v9fs was allowing writable mmap which could lead to kernel BUG() cases.
    This sets the mmap function to generic_file_readonly_mmap which (correctly)
    returns an error to applications which open mmap for writing.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • GDM gets unhappy if /var/gdm doesn't have the sticky bit set. This patch adds
    support for the sticky bit in much the same way setuid/setgid is supported.

    With this patch, I can launch X from a v9fs rootfs (although I quickly run out
    of fds in the server once gnome starts up).

    Signed-off-by: Anthony Liguori
    Acked-by: Eric Van Hensbergen

    Anthony Liguori
     
  • When a new user attached at a directory other than the root, he would end
    up in the parent directory of the cwd. This was due to a logic error in
    the code which attaches the user at the mount point and walks back to the
    cwd. This patch fixes that.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
    x86: fix deadlock, make pgd_lock irq-safe
    virtio: fix trivial build bug
    x86: fix mttr trimming
    x86: delay CPA self-test and repeat it
    x86: fix 64-bit sections
    generic: add __FINITDATA
    x86: remove suprious ifdefs from pageattr.c
    x86: mark the .rodata section also NX
    x86: fix iret exception recovery on 64-bit
    cpuidle: dubious one-bit signed bitfield in cpuidle.h
    x86: fix sparse warnings in powernow-k8.c
    x86: fix sparse error in traps_32.c
    x86: trivial sparse/checkpatch in quirks.c
    x86 ptrace: disallow null cs/ss
    MAINTAINERS: RDC R-321x SoC maintainer
    brk randomization: introduce CONFIG_COMPAT_BRK
    brk: check the lower bound properly
    x86: remove X2 workaround
    x86: make spurious fault handler aware of large mappings
    x86: make traps on entry code be debuggable in user space, 64-bit

    Linus Torvalds
     
  • based on similar patch from: Pavel Machek

    Introduce CONFIG_COMPAT_BRK. If disabled then the kernel is free
    (but not obliged to) randomize the brk area.

    Heap randomization breaks ancient binaries, so we keep COMPAT_BRK
    enabled by default.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • We cannot start transaction in ext3_direct_IO() and just let it last during
    the whole write because dio_get_page() acquires mmap_sem which ranks above
    transaction start (e.g. because we have dependency chain
    mmap_sem->PageLock->journal_start, or because we update atime while holding
    mmap_sem) and thus deadlocks could happen. We solve the problem by
    starting a transaction separately for each ext3_get_block() call.

    We *could* have a problem that we allocate a block and before its data are
    written out the machine crashes and thus we expose stale data. But that
    does not happen because for hole-filling generic code falls back to
    buffered writes and for file extension, we add inode to orphan list and
    thus in case of crash, journal replay will truncate inode back to the
    original size.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Jan Kara
    Cc:
    Cc: Zach Brown
    Cc: Badari Pulavarty
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Kara
     
  • Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mariusz Kozlowski
     
  • Use ext[234]_bg_has_super() to remove duplicate code.

    Signed-off-by: Akinobu Mita
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • The argument chain for ext[234]_find_goal() is not used. This patch removes
    it and fixes comment as well.

    Cc:
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Use ext[234]_get_group_desc() to get group descriptor from group number.

    Cc:
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • The comment in ext[234]_new_blocks() describes about "i". But there is no
    local variable called "i" in that scope. I guess it has been renamed to
    group_no.

    Cc:
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • ext3 file system was by default ignoring errors and continuing. This is
    not a good default as continuing on error could lead to file system
    corruption. Change the default to mark the file system readonly. Debian
    and ubuntu already does this as the default in their fstab.

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Cc: Eric Sandeen
    Cc: Jan Kara
    Cc: Dave Jones
    Cc: Chuck Ebbert
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • This fixes some instances where we were continuing after calling
    ext3_error. ext3_error calls panic only if errors=panic mount option is
    set. So we need to make sure we return correctly after ext3_error call

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • __journal_abort_hard() can now become static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • None of the callers of this function does actually take the BKL as far as I
    can see. So remove the comment refering to the BKL.

    Signed-off-by: Andi Kleen
    Cc:
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • No BKL used anywhere, so don't mention it.

    Signed-off-by: Andi Kleen
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • I checked ext2_ioctl and could not find anything in there that would need the
    BKL. So convert it over to use unlocked_ioctl

    Signed-off-by: Andi Kleen
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     
  • When a new block bitmap is read from disk in read_block_bitmap() there are a
    few bits that should ALWAYS be set. In particular, the blocks given
    corresponding to block bitmap, inode bitmap and inode tables. Validate the
    block bitmap against these blocks.

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • When a new block bitmap is read from disk in read_block_bitmap() there are a
    few bits that should ALWAYS be set. In particular, the blocks given
    corresponding to block bitmap, inode bitmap and inode tables. Validate the
    block bitmap against these blocks.

    Signed-off-by: Aneesh Kumar K.V
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Aneesh Kumar K.V
     
  • Libfuse basically creates a new thread for each new request. This is fine for
    synchronous requests, which are naturally limited. However background
    requests (especially writepage) can cause a thread creation storm.

    To avoid this, limit the number of background requests available to userspace.

    This is done by introducing another queue for background requests, and a
    counter for the number of "active" requests, which are currently available for
    userspace.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Move the fields 'dentry' and 'vfsmount' into the request specific union, since
    these are only used for the RELEASE request.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Invalidate attributes on create, since st_ctime is updated. Reported by
    Szabolcs Szakacsits.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miklos Szeredi
     
  • Jeff Moyer pointed out that a mount; umount loop of ecryptfs, with the same
    cipher & other mount options, created a new ecryptfs_key_tfm_cache item
    each time, and the cache could grow quite large this way.

    Looking at this with mhalcrow, we saw that ecryptfs_parse_options()
    unconditionally called ecryptfs_add_new_key_tfm(), which is what was adding
    these items.

    Refactor ecryptfs_get_tfm_and_mutex_for_cipher_name() to create a new
    helper function, ecryptfs_tfm_exists(), which checks for the cipher on the
    cached key_tfm_list, and sets a pointer to it if it exists. This can then
    be called from ecryptfs_parse_options(), and new key_tfm's can be added
    only when a cached one is not found.

    With list locking changes suggested by akpm.

    Signed-off-by: Eric Sandeen
    Cc: Michael Halcrow
    Cc: Jeff Moyer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • Only the lower byte of cipher_code is ever used, so it makes sense
    for its type to be u8.

    Signed-off-by: Trevor Highland
    Cc: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Trevor Highland
     
  • The printk statements that result when the user does not have the
    proper key available could use some refining.

    Signed-off-by: Mike Halcrow
    Cc: Mike Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     
  • ecryptfs_debug really should not be a mount option; it is not per-mount,
    but rather sets a global "ecryptfs_verbosity" variable which affects all
    mounted filesysytems. It's already settable as a module load option,
    I think we can leave it at that.

    Also, if set, since secret values come out in debug messages, kick
    things off with a stern warning.

    Signed-off-by: Eric Sandeen
    Acked-by: Mike Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • Change ecryptfs_show_options to reflect the actual mount options in use.
    Note that this does away with the "dir=" output, which is not a valid mount
    option and appears to be unused.

    Mount options such as "ecryptfs_verbose" and "ecryptfs_xattr_metadata" are
    somewhat indeterminate for a given fs, but in any case the reported mount
    options can be used in a new mount command to get the same behavior.

    [akpm@linux-foundation.org: fix printk warning]
    Signed-off-by: Eric Sandeen
    Acked-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Sandeen
     
  • There is no need to keep re-setting the same key for any given eCryptfs inode.
    This patch optimizes the use of the crypto API and helps performance a bit.

    Signed-off-by: Trevor Highland
    Signed-off-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Trevor Highland
     
  • Remove internal references to header extents; just keep track of header bytes
    instead. Headers can easily span multiple pages with the recent persistent
    file changes.

    Signed-off-by: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Halcrow
     
  • - make the following needlessly global code static:
    - crypto.c:ecryptfs_lower_offset_for_extent()
    - crypto.c:key_tfm_list
    - crypto.c:key_tfm_list_mutex
    - inode.c:ecryptfs_getxattr()
    - main.c:ecryptfs_init_persistent_file()

    - remove the no longer used mmap.c:ecryptfs_lower_page_cache

    - #if 0 the unused read_write.c:ecryptfs_read()

    Signed-off-by: Adrian Bunk
    Cc: Michael Halcrow
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • schedule_timeout(jiffies) waits for at least jiffies - 1. Add 1 jiffie to
    the timeout_jiffies calculated in sys_poll() to wait at least
    timeout_msecs, like poll() manpage says.

    Signed-off-by: Karsten Wiese
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Karsten Wiese
     
  • We can use ilog2() in fs/namespace.c to compute hash_bits and hash_mask at
    compile time, not runtime.

    [akpm@linux-foundation.org: clean it all up]
    Signed-off-by: Eric Dumazet
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     
  • Use DEFAULT_SGI_PARTITION for SGI_PARTION default

    Signed-off-by: Thomas Bogendoerfer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Bogendoerfer
     
  • ext2 should not worry about checking sb->s_blocksize for XIP before the
    sb's blocksize actually gets set.

    Signed-off-by: Nick Piggin
    Acked-by: Carsten Otte
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin