14 Dec, 2006

1 commit

  • 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
     

09 Dec, 2006

1 commit


08 Dec, 2006

1 commit

  • When kernel is compiled with old version of autofs (CONFIG_AUTOFS_FS), and
    new (observed at least with 5.x.x) automount deamon is started, kernel
    correctly reports incompatible version of kernel and userland daemon, but
    then screws things up instead of correct handling of the error:

    autofs: kernel does not match daemon version
    =====================================
    [ BUG: bad unlock balance detected! ]
    -------------------------------------
    automount/4199 is trying to release lock (&type->s_umount_key) at:
    [] get_sb_nodev+0x76/0xa4
    but there are no more locks to release!

    other info that might help us debug this:
    no locks held by automount/4199.

    stack backtrace:
    [] dump_trace+0x68/0x1b2
    [] show_trace_log_lvl+0x18/0x2c
    [] show_trace+0xf/0x11
    [] dump_stack+0x12/0x14
    [] print_unlock_inbalance_bug+0xe7/0xf3
    [] lock_release+0x8d/0x164
    [] up_write+0x14/0x27
    [] get_sb_nodev+0x76/0xa4
    [] vfs_kern_mount+0x83/0xf6
    [] do_kern_mount+0x2d/0x3e
    [] do_mount+0x607/0x67a
    [] sys_mount+0x72/0xa4
    [] sysenter_past_esp+0x5f/0x99
    DWARF2 unwinder stuck at sysenter_past_esp+0x5f/0x99
    Leftover inexact backtrace:
    =======================

    and then deadlock comes.

    The problem: autofs_fill_super() returns EINVAL to get_sb_nodev(), but
    before that, it calls kill_anon_super() to destroy the superblock which
    won't be needed. This is however way too soon to call kill_anon_super(),
    because get_sb_nodev() has to perform its own cleanup of the superblock
    first (deactivate_super(), etc.). The correct time to call
    kill_anon_super() is in the autofs_kill_sb() callback, which is called by
    deactivate_super() at proper time, when the superblock is ready to be
    killed.

    I can see the same faulty codepath also in autofs4. This patch solves
    issues in both filesystems in a same way - it postpones the
    kill_anon_super() until the proper time is signalized by deactivate_super()
    calling the kill_sb() callback.

    [raven@themaw.net: update comment]
    Signed-off-by: Jiri Kosina
    Acked-by: Ian Kent
    Cc:
    Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     

15 Nov, 2006

1 commit

  • Resolve the panic on failed mount of an autofs filesystem originally
    reported by Mao Bibo.

    It addresses two issues that happen after the mount fail. The first a NULL
    pointer reference to a field (pipe) in the autofs superblock info structure
    and second the lack of super block cleanup by the autofs and autofs4
    modules.

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

    Ian Kent
     

12 Oct, 2006

1 commit

  • Make sure all dentries refs are released before calling kill_anon_super() so
    that the assumption that generic_shutdown_super() can completely destroy the
    dentry tree for there will be no external references holds true.

    What was being done in the put_super() superblock op, is now done in the
    kill_sb() filesystem op instead, prior to calling kill_anon_super().

    This makes the struct autofs_sb_info::root member variable redundant (since
    sb->s_root is still available), and so that is removed. The calls to
    shrink_dcache_sb() are also removed since they're also redundant as
    shrink_dcache_for_umount() will now be called after the cleanup routine.

    Signed-off-by: David Howells
    Acked-by: Ian Kent
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

01 Oct, 2006

3 commits

  • Some filesystems, instead of simply decrementing i_nlink, simply zero it
    during an unlink operation. We need to catch these in addition to the
    decrement operations.

    Signed-off-by: Dave Hansen
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     
  • This is mostly included for parity with dec_nlink(), where we will have some
    more hooks. This one should stay pretty darn straightforward for now.

    Signed-off-by: Dave Hansen
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     
  • When a filesystem decrements i_nlink to zero, it means that a write must be
    performed in order to drop the inode from the filesystem.

    We're shortly going to have keep filesystems from being remounted r/o between
    the time that this i_nlink decrement and that write occurs.

    So, add a little helper function to do the decrements. We'll tie into it in a
    bit to note when i_nlink hits zero.

    Signed-off-by: Dave Hansen
    Acked-by: Christoph Hellwig
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Hansen
     

30 Sep, 2006

2 commits

  • During testing I've found that the mount pending flag can be left set at
    exit from autofs4_lookup after a failed mount request. This shouldn't be
    allowed to happen and causes incorrect error returns.

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

    Ian Kent
     
  • The check for an empty directory in the autofs4_follow_link method fails
    occassionally due to old dentrys. We had the same problem
    autofs4_revalidate ages ago. I thought we wouldn't need this in
    autofs4_follow_link, silly me.

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

    Ian Kent
     

27 Sep, 2006

2 commits

  • This eliminates the i_blksize field from struct inode. Filesystems that want
    to provide a per-inode st_blksize can do so by providing their own getattr
    routine instead of using the generic_fillattr() function.

    Note that some filesystems were providing pretty much random (and incorrect)
    values for i_blksize.

    [bunk@stusta.de: cleanup]
    [akpm@osdl.org: generic_fillattr() fix]
    Signed-off-by: "Theodore Ts'o"
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Theodore Ts'o
     
  • For a long time now I have had a problem with not being able to return a
    lookup failure on an existsing directory. In autofs this corresponds to a
    mount failure on a autofs managed mount entry that is browsable (and so the
    mount point directory exists).

    While this problem has been present for a long time I've avoided resolving
    it because it was not very visible. But now that autofs v5 has "mount and
    expire on demand" of nested multiple mounts, such as is found when mounting
    an export list from a server, solving the problem cannot be avoided any
    longer.

    I've tried very hard to find a way to do this entirely within the autofs4
    module but have not been able to find a satisfactory way to achieve it.

    So, I need to propose a change to the VFS.

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

    Ian Kent
     

26 Sep, 2006

1 commit

  • If the timeout of an autofs mount is set to zero then umounts are disabled.
    This works fine, however the kernel module checks the expire timeout and
    goes no further if it is zero. This is not the right thing to do at
    shutdown as the module is passed an option to expire mounts regardless of
    their timeout setting.

    This patch allows autofs to honor the force expire option.

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

    Ian Kent
     

24 Sep, 2006

1 commit


27 Jun, 2006

1 commit

  • This patch converts the combination of list_del(A) and list_add(A, B) to
    list_move(A, B) under fs/.

    Cc: Ian Kent
    Acked-by: Joel Becker
    Cc: Neil Brown
    Cc: Hans Reiser
    Cc: Urban Widmark
    Acked-by: David Howells
    Acked-by: Mark Fasheh
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

26 Jun, 2006

1 commit

  • I've found a case where invalid dentrys in a mount tree, waiting to be
    cleaned up by d_invalidate, prevent the expected expire.

    In this case dentrys created during a lookup for which a mount fails or has
    no entry in the mount map contribute to the d_count of the parent dentry.
    These dentrys may not be invalidated prior to comparing the interanl usage
    count of valid autofs dentrys against the dentry d_count which makes a
    mount tree appear busy so it doesn't expire.

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

    Ian Kent
     

23 Jun, 2006

1 commit

  • Extend the get_sb() filesystem operation to take an extra argument that
    permits the VFS to pass in the target vfsmount that defines the mountpoint.

    The filesystem is then required to manually set the superblock and root dentry
    pointers. For most filesystems, this should be done with simple_set_mnt()
    which will set the superblock pointer and then set the root dentry to the
    superblock's s_root (as per the old default behaviour).

    The get_sb() op now returns an integer as there's now no need to return the
    superblock pointer.

    This patch permits a superblock to be implicitly shared amongst several mount
    points, such as can be done with NFS to avoid potential inode aliasing. In
    such a case, simple_set_mnt() would not be called, and instead the mnt_root
    and mnt_sb would be set directly.

    The patch also makes the following changes:

    (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
    pointer argument and return an integer, so most filesystems have to change
    very little.

    (*) If one of the convenience function is not used, then get_sb() should
    normally call simple_set_mnt() to instantiate the vfsmount. This will
    always return 0, and so can be tail-called from get_sb().

    (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
    dcache upon superblock destruction rather than shrink_dcache_anon().

    This is required because the superblock may now have multiple trees that
    aren't actually bound to s_root, but that still need to be cleaned up. The
    currently called functions assume that the whole tree is rooted at s_root,
    and that anonymous dentries are not the roots of trees which results in
    dentries being left unculled.

    However, with the way NFS superblock sharing are currently set to be
    implemented, these assumptions are violated: the root of the filesystem is
    simply a dummy dentry and inode (the real inode for '/' may well be
    inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
    with child trees.

    [*] Anonymous until discovered from another tree.

    (*) The documentation has been adjusted, including the additional bit of
    changing ext2_* into foo_* in the documentation.

    [akpm@osdl.org: convert ipath_fs, do other stuff]
    Signed-off-by: David Howells
    Acked-by: Al Viro
    Cc: Nathan Scott
    Cc: Roland Dreier
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

16 May, 2006

1 commit

  • This patch fixes two problems.

    First, the comparison of entries in the waitq.c was incorrect.

    Second, the NFY_NONE check was incorrect. The test of whether the dentry
    is mounted if ineffective, for example, if an expire fails then we could
    wait forever on a non existant expire. The bug was identified by Jeff
    Moyer.

    The patch changes autofs4 to wait on expires only as this is all that's
    needed. If there is no existing wait when autofs4_wait is call with a type
    of NFY_NONE it delays until either a wait appears or the the expire flag is
    cleared.

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

    Ian Kent
     

29 Mar, 2006

2 commits


28 Mar, 2006

19 commits

  • Fix accidental underflow of the atomic counter.

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

    Ian Kent
     
  • This functionality is also need for operation of autofs v5 direct mounts.

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

    Ian Kent
     
  • We have to have a valid sbi here, or we'd have oopsed already. (There's a
    dereference of sbi->catatonic a few lines above)

    Coverity #740

    Signed-off-by: Dave Jones
    Cc: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • Signed-off-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This patch define a new autofs packet for autofs v5 and updates the waitq.c
    functions to handle the additional packet type.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This patch adds expire logic for autofs direct mounts.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • This patch adds a follow_link inode method for the root of an autofs direct
    mount trigger. It also adds the corresponding mount options and updates the
    show_mount method.

    Signed-off-by: Ian Kent
    Cc: Al Viro
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     
  • Change the functions may_umount and may_umount_tree to boolean functions to
    aid code readability.

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

    Ian Kent
     
  • Rename the function simple_empty_nolock to __simple_empty in line with kernel
    naming conventions.

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

    Ian Kent
     
  • Whitespace and formating changes to waitq code.

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

    Ian Kent
     
  • Add show_options method to display autofs4 mount options in the proc
    filesystem.

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

    Ian Kent
     
  • Remove the update of i_atime from autofs4 in favour of having VFS update it.
    i_atime is never used for expire in autofs4.

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

    Ian Kent
     
  • Alter the expire semantics that define how "busyness" is determined.
    Currently a last_used counter is updated on every revalidate from processes
    other than the mount owner process group.

    This patch changes that so that an expire candidate is busy only if it has a
    reference count greater than the expected minimum, such as when there is an
    open file or working directory in use.

    This method is the only way that busyness can be established for direct mounts
    within the new implementation. For consistency the expire semantic is made
    the same for all mounts.

    A side effect of the patch is that mounts which remain mounted unessessarily
    in the presence of some GUI programs that scan the filesystem should now
    expire.

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

    Ian Kent
     
  • Fix the case where an expire returns busy on a tree mount when it is in fact
    not busy. This case was overlooked when the patch to prevent the expiring
    away of "scaffolding" directories for tree mounts was applied.

    The problem arises when a tree of mounts is a member of a map with other keys.
    The current logic will not expire the tree if any other mount in the map is
    busy. The solution is to maintain a "minimum" use count for each autofs
    dentry and compare this to the actual dentry usage count during expire.

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

    Ian Kent
     
  • Simplify the expire tree traversal code by using a function from namespace.c
    to calculate the next entry in the top down tree traversals carried out during
    the expire operation.

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

    Ian Kent
     
  • Change the names of the boolean functions autofs4_check_mount and
    autofs4_check_tree to autofs4_mount_busy and autofs4_tree_busy respectively
    and alters their return codes to suit in order to aid code readabilty.

    A couple of white space cleanups are included as well.

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

    Ian Kent
     
  • Addresse a problem where stale dentrys stop mounts from happening.

    When a mount point directory is pre-created and a non-existent entry within it
    is requested a dentry ends up being created within the mount point directory
    which stops future mounts. The problem is solved by ignoring negative,
    unhashed dentrys in the mount point d_subdirs list.

    Additionally the apparent cacheing of -ENOENT returns from requests is
    removed. The test on d_time is a tautology and d_time is not initialised and
    has an unexpected value. In short it doesn't do what it's meant to.

    The cacheing of failed requests to the daemon is important and will be
    followed up later.

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

    Ian Kent
     
  • Change readdir routines to use the cursor based routines in libfs.c. This
    removes reliance on old readdir code from 2.4 and should improve efficiency of
    readdir in autofs4.

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

    Ian Kent
     
  • Whitespace and formating changes to lookup code.

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

    Ian Kent
     

23 Mar, 2006

1 commit

  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Acked-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar