11 May, 2007

1 commit

  • Fix coding style errors (extra spaces, long lines) in autofs and autofs4 files
    being modified for container/pidspace issues.

    Signed-off-by: Sukadev Bhattiprolu
    Cc: Cedric Le Goater
    Cc: Dave Hansen
    Cc: Serge Hallyn
    Cc:
    Cc: Eric W. Biederman
    Cc: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sukadev Bhattiprolu
     

09 May, 2007

1 commit


13 Apr, 2007

1 commit

  • Commit f50b6f8691cae2e0064c499dd3ef3f31142987f0 introduced a race in
    autofs4 between autofs_lookup_unhashed() and autofs_dentry_release().

    autofs_dentry_release() ends up clearing the ->dentry and ->inode members
    of autofs_info before removing it from the rehash list. The list is
    protected by the rehash lock in both functions, but since
    autofs_dentry_release() starts tearing the autofs_info struct down before
    removing it from the list, autofs_lookup_unhashed() can get a autofs_info
    with a NULL dentry.

    This patch moves the clearing of ->dentry and ->inode after the removal
    from the rehash list.

    Signed-off-by: Jeff Mahoney
    Acked-by: Ian Kent
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     

21 Feb, 2007

2 commits

  • This problem was identified and fixed some time ago by Jeff Moyer but it fell
    through the cracks somehow.

    It is possible that a user space application could remove and re-create a
    directory during a request. To avoid returning a failure from lookup
    incorrectly when our current dentry is unhashed we need to check if another
    positive, hashed dentry matching this one exists and if so return it instead
    of a fail.

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

    Ian Kent
     
  • Jeff Moyer has identified a race between mount and expire.

    What happens is that during an expire the situation can arise that a directory
    is removed and another lookup is done before the expire issues a completion
    status to the kernel module. In this case, since the the lookup gets a new
    dentry, it doesn't know that there is an expire in progress and when it posts
    its mount request, matches the existing expire request and waits for its
    completion. ENOENT is then returned to user space from lookup (as the dentry
    passed in is now unhashed) without having performed the mount request.

    The solution used here is to keep track of dentrys in this unhashed state and
    reuse them, if possible, in order to preserve the flags. Additionally, this
    infrastructure will provide the framework for the reintroduction of caching of
    mount fails removed earlier in development.

    Signed-off-by: Ian Kent
    Acked-by: Jeff Moyer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ian Kent
     

13 Feb, 2007

1 commit

  • Many struct inode_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

09 Dec, 2006

1 commit


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

1 commit

  • 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
     

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

1 commit

  • This is a conversion to make the various file_operations structs in fs/
    const. Basically a regexp job, with a few manual fixups

    The goal is both to increase correctness (harder to accidentally write to
    shared datastructures) and reducing the false sharing of cachelines with
    things that get dirty in .data (while .rodata is nicely read only and thus
    cache clean)

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

28 Mar, 2006

10 commits

  • 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
     
  • 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
     
  • 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
     
  • 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
     

15 Jan, 2006

1 commit


12 Jan, 2006

1 commit


11 Jan, 2006

1 commit

  • After my lookup_hash patch ->d_revalidate always gets a valid struct nameidata
    passed (unless you use lookup_one_len which autofs4 doesn't), so we can switch
    it from update_atime to touch_atime. This is a bit of an academic excercise
    because autofs has a 1:1 vfsmount superblock relation, but I want to get rid
    of update_atime so filesystems authors can't easily screw up per-mountpoint
    noatime support.

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

    Christoph Hellwig
     

10 Jan, 2006

1 commit


09 Jan, 2006

1 commit

  • Some long time ago, dentry struct was carefully tuned so that on 32 bits
    UP, sizeof(struct dentry) was exactly 128, ie a power of 2, and a multiple
    of memory cache lines.

    Then RCU was added and dentry struct enlarged by two pointers, with nice
    results for SMP, but not so good on UP, because breaking the above tuning
    (128 + 8 = 136 bytes)

    This patch reverts this unwanted side effect, by using an union (d_u),
    where d_rcu and d_child are placed so that these two fields can share their
    memory needs.

    At the time d_free() is called (and d_rcu is really used), d_child is known
    to be empty and not touched by the dentry freeing.

    Lockless lookups only access d_name, d_parent, d_lock, d_op, d_flags (so
    the previous content of d_child is not needed if said dentry was unhashed
    but still accessed by a CPU because of RCU constraints)

    As dentry cache easily contains millions of entries, a size reduction is
    worth the extra complexity of the ugly C union.

    Signed-off-by: Eric Dumazet
    Cc: Dipankar Sarma
    Cc: Maneesh Soni
    Cc: Miklos Szeredi
    Cc: "Paul E. McKenney"
    Cc: Ian Kent
    Cc: Paul Jackson
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Trond Myklebust
    Cc: Neil Brown
    Cc: James Morris
    Cc: Stephen Smalley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

22 Jun, 2005

2 commits

  • For browsable autofs maps, a mount request that arrives at the same time an
    expire is happening can fail to perform the needed mount.

    This happens becuase the directory exists and so the revalidate succeeds when
    we need it to fail so that lookup is called on the same dentry to do the
    mount. Instead lookup is called on the next path component which should be
    whithin the mount, but the parent isn't mounted.

    The solution is to allow the revalidate to continue and perform the mount as
    no directory creation (at mount time) is needed for browsable mount entries.

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

    Ian Kent
     
  • While this is not a solution to bind and move mounts on autofs owned
    directories it is necessary to fix the trady error handling.

    At least it avoids the kernel panic I observed checking out bug #4589.

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

    Ian Kent
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds