14 Dec, 2006

34 commits

  • Fix file and directory removal in debugfs. Add inotify support for file removal.

    The following scenario :
    create dir a
    create dir a/b

    cd a/b (some process goes in cwd a/b)

    rmdir a/b
    rmdir a

    fails due to the fact that "a" appears to be non empty. It is because
    the "b" dentry is not deleted from "a" and still in use. The same
    problem happens if "b" is a file. d_delete is nice enough to know when
    it needs to unhash and free the dentry if nothing else is using it or,
    if someone is using it, to remove it from the hash queues and wait for
    it to be deleted when it has no users.

    The nice side-effect of this fix is that it calls the file removal
    notification.

    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Greg Kroah-Hartman

    Mathieu Desnoyers
     
  • Correct dentry count to handle creation errors.

    This patch puts a dput at the file creation instead of the file removal :
    lookup_one_len already returns a dentry with reference count of 1. Then,
    the dget() in simple_mknod increments it when the dentry is associated
    with a file. In a scenario where simple_create or simple_mkdir returns
    an error, this would lead to an unwanted increment of the reference
    counter, therefore making file removal impossible.

    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Greg Kroah-Hartman

    Mathieu Desnoyers
     
  • Fix error handling of file and directory creation in DebugFS.

    The error path should release the file system because no _remove will be called
    for this erroneous creation.

    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Greg Kroah-Hartman

    Mathieu Desnoyers
     
  • Minor coding style fixes along the way : 80 cols and a white space.

    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Greg Kroah-Hartman

    Mathieu Desnoyers
     
  • Add inotify create and mkdir events to DebugFS.

    Signed-off-by: Mathieu Desnoyers
    Signed-off-by: Greg Kroah-Hartman

    Mathieu Desnoyers
     
  • Run this:

    #!/bin/sh
    for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
    echo "De-casting $f..."
    perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
    done

    And then go through and reinstate those cases where code is casting pointers
    to non-pointers.

    And then drop a few hunks which conflicted with outstanding work.

    Cc: Russell King , Ian Molton
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Kyle McMartin
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Greg KH
    Cc: Jens Axboe
    Cc: Paul Fulghum
    Cc: Alan Cox
    Cc: Karsten Keil
    Cc: Mauro Carvalho Chehab
    Cc: Jeff Garzik
    Cc: James Bottomley
    Cc: Ian Kent
    Cc: Steven French
    Cc: David Woodhouse
    Cc: Neil Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • The nfsservctl system call isn't used but recent nfs-utils releases for
    exporting filesystems, and consequently the code that is uses - exp_export -
    has suffered some bitrot.

    Particular:
    - some newly added fields in 'struct svc_export' are being initialised
    properly.
    - the return value is now always -ENOMEM ...

    This patch fixes both these problems.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Kill another big "if" clause.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • I'm not too fond of these big if conditions. Replace them by checks of a flag
    in the operation descriptor. To my eye this makes the code a bit more
    self-documenting, and makes the complicated part of the code (proc_compound) a
    little more compact.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Define an op descriptor struct, use it to simplify nfsd4_proc_compound().

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Make wrappers for verify and nverify, for consistency with other ops.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • The inlining contributes to bloating the stack of nfsd4_compound, and I want
    to change the compound op functions to function pointers anyway.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Tuck away the replay_owner in the cstate while we're at it.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • OK, this is embarassing--I've even looked back at the history, and cannot for
    the life of me figure out why I added this check.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Pass the saved and current filehandles together into all the nfsd4 compound
    operations.

    I want a unified interface to these operations so we can just call them by
    pointer and throw out the huge switch statement.

    Also I'll eventually want a structure like this--that holds the state used
    during compound processing--for deferral.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • To avoid tying up server threads when nfsd makes an upcall (to mountd, to get
    export options, to idmapd, for nfsv4 nameid mapping, etc.), we temporarily
    "drop" the request and save enough information so that we can revisit it
    later.

    Certain failures during the deferral process can cause us to really drop the
    request and never revisit it.

    This is often less than ideal, and is unacceptable in the NFSv4 case--rfc 3530
    forbids the server from dropping a request without also closing the
    connection.

    As a first step, we modify the deferral code to return -ETIMEDOUT (which is
    translated to nfserr_jukebox in the v3 and v4 cases, and remains a drop in the
    v2 case).

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • This patch on its own causes no change in behavior, since nfsd_cross_mnt()
    only returns -EAGAIN; but in the future I'd like it to also be able to return
    -ETIMEDOUT, so we may as well handle any possible error here.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Note there's no need for special handling of -EAGAIN here; nfserrno() does
    what we want already. So this is a pure cleanup with no change in
    functionality.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Since exp_parent can fail by returning an error (-EAGAIN) in addition to by
    returning NULL, we should check for that case in exp_rootfh.

    (TODO: we should check that userland handles these errors too.)

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • A comment here incorrectly states that "slack_space" is measured in words, not
    bytes. Remove the comment, and adjust a variable name and a few comments to
    clarify the situation.

    This is pure cleanup; there should be no change in functionality.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • This dprintk is printing the wrong error now, but it's probably an unnecessary
    dprintk anyway; just remove it.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • As Adrian pointed out recently, there were still a couple of places where
    I should have fixed my email address.

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

    Tigran Aivazian
     
  • This took a little refactoring but now errors are handled cleanly. When
    this code used pid_t values this wasn't necessary because you can't
    leak a pid_t.

    Thanks to Peter Vandrovec for spotting this.

    Signed-off-by: Eric W. Biederman
    Cc: Peter Vandrovec
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • This patch converts the tracking of the user space watchdog process from using
    a pid_t to use struct pid. This makes us safe from pid wrap around issues and
    prepares the way for the pid namespace.

    Signed-off-by: Eric W. Biederman
    Cc: Petr Vandrovec
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • smbfs keeps track of the user space server process in conn_pid. This converts
    that track to use a struct pid instead of pid_t. This keeps us safe from pid
    wrap around issues and prepares the way for the pid namespace.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • Annotated, all places switched to keeping status net-endian.

    Signed-off-by: Al Viro
    Acked-by: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • All kcalloc() calls of the form "kcalloc(1,...)" are converted to the
    equivalent kzalloc() calls, and a few kcalloc() calls with the incorrect
    ordering of the first two arguments are fixed.

    Signed-off-by: Robert P. J. Day
    Cc: Jeff Garzik
    Cc: Alan Cox
    Cc: Dominik Brodowski
    Cc: Adam Belay
    Cc: James Bottomley
    Cc: Greg KH
    Cc: Mark Fasheh
    Cc: Trond Myklebust
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • activate_mm() is not the right thing to be using in use_mm(). It should be
    switch_mm().

    On normal x86, they're synonymous, but for the Xen patches I'm adding a
    hook which assumes that activate_mm is only used the first time a new mm
    is used after creation (I have another hook for dealing with dup_mm). I
    think this use of activate_mm() is the only place where it could be used
    a second time on an mm.

    >From a quick look at the other architectures I think this is OK (most
    simply implement one in terms of the other), but some are doing some
    subtly different stuff between the two.

    Acked-by: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • Implement block device specific .direct_IO method instead of going through
    generic direct_io_worker for block device.

    direct_io_worker() is fairly complex because it needs to handle O_DIRECT on
    file system, where it needs to perform block allocation, hole detection,
    extents file on write, and tons of other corner cases. The end result is
    that it takes tons of CPU time to submit an I/O.

    For block device, the block allocation is much simpler and a tight triple
    loop can be written to iterate each iovec and each page within the iovec in
    order to construct/prepare bio structure and then subsequently submit it to
    the block layer. This significantly speeds up O_D on block device.

    [akpm@osdl.org: small speedup]
    Signed-off-by: Ken Chen
    Cc: Christoph Hellwig
    Cc: Zach Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen, Kenneth W
     
  • Update ocfs2_should_update_atime() to understand the MNT_RELATIME flag and
    to test against mtime / ctime accordingly.

    [akpm@osdl.org: cleanups]
    Signed-off-by: Mark Fasheh
    Cc: Valerie Henson
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Fasheh
     
  • Add "relatime" (relative atime) support. Relative atime only updates the
    atime if the previous atime is older than the mtime or ctime. Like
    noatime, but useful for applications like mutt that need to know when a
    file has been read since it was last modified.

    A corresponding patch against mount(8) is available at
    http://userweb.kernel.org/~akpm/mount-relative-atime.txt

    Signed-off-by: Valerie Henson
    Cc: Mark Fasheh
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Karel Zak
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Valerie Henson
     
  • Simplify touch_atime() layout.

    Cc: Valerie Henson
    Cc: Mark Fasheh
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • - pipe/splice should use const pipe_buf_operations and file_operations

    - struct pipe_inode_info has an unused field "start" : get rid of it.

    Signed-off-by: Eric Dumazet
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

13 Dec, 2006

5 commits


12 Dec, 2006

1 commit