13 Jul, 2005

1 commit

  • inotify is intended to correct the deficiencies of dnotify, particularly
    its inability to scale and its terrible user interface:

    * dnotify requires the opening of one fd per each directory
    that you intend to watch. This quickly results in too many
    open files and pins removable media, preventing unmount.
    * dnotify is directory-based. You only learn about changes to
    directories. Sure, a change to a file in a directory affects
    the directory, but you are then forced to keep a cache of
    stat structures.
    * dnotify's interface to user-space is awful. Signals?

    inotify provides a more usable, simple, powerful solution to file change
    notification:

    * inotify's interface is a system call that returns a fd, not SIGIO.
    You get a single fd, which is select()-able.
    * inotify has an event that says "the filesystem that the item
    you were watching is on was unmounted."
    * inotify can watch directories or files.

    Inotify is currently used by Beagle (a desktop search infrastructure),
    Gamin (a FAM replacement), and other projects.

    See Documentation/filesystems/inotify.txt.

    Signed-off-by: Robert Love
    Cc: John McCutchan
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert Love
     

08 Jul, 2005

1 commit


24 Jun, 2005

1 commit


07 Jun, 2005

19 commits

  • __do_follow_link() passes potentially worng vfsmount to touch_atime(). It
    matters only in (currently impossible) case of symlink mounted on something,
    but it's trivial to fix and that actually makes more sense.

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

    Al Viro
     
  • Cosmetical cleanups - __follow_mount() calls in __link_path_walk() absorbed
    into do_lookup().

    Obviously equivalent transformation.

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

    Al Viro
     
  • follow_mount() made void, reordered dput()/mntput() in it.

    follow_dotdot() switched from struct vfmount ** + struct dentry ** to
    struct nameidata *; callers updated.

    Equivalent transformation + fix for too-early-mntput() race.

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

    Al Viro
     
  • Conditional mntput() moved into __do_follow_link(). There it collapses with
    unconditional mntget() on the same sucker, closing another too-early-mntput()
    race.

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

    Al Viro
     
  • Getting rid of sloppy logics:

    a) in do_follow_link() we have the wrong vfsmount dropped if our symlink
    had been mounted on something. Currently it worls only because we never
    get such situation (modulo filesystem playing dirty tricks on us). And
    it obfuscates already convoluted logics...

    b) same goes for open_namei().

    c) in __link_path_walk() we have another "it should never happen" sloppiness -
    out_dput: there does double-free on underlying vfsmount and leaks the covering
    one if we hit it just after crossing a mountpoint. Again, wrong vfsmount
    getting dropped.

    d) another too-early-mntput() race - in do_follow_mount() we need to postpone
    conditional mntput(path->mnt) until after dput(path->dentry). Again, this one
    happens only in it-currently-never-happens-unless-some-fs-plays-dirty
    scenario...

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

    Al Viro
     
  • shifted conditional mntput() into do_follow_link() - all callers were doing
    the same thing.

    Obviously equivalent transformation.

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

    Al Viro
     
  • In open_namei() exit_dput: we have mntput() done in the wrong order -
    if nd->mnt != path.mnt we end up doing
    mntput(nd->mnt);
    nd->mnt = path.mnt;
    dput(nd->dentry);
    mntput(nd->mnt);
    which drops nd->dentry too late. Fixed by having path.mnt go first.
    That allows to switch O_NOFOLLOW under if (__follow_mount(...)) back
    to exit_dput, while we are at it.

    Fix for early-mntput() race + equivalent transformation.

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

    Al Viro
     
  • In open_namei() we take mntput(nd->mnt);nd->mnt=path.mnt; out of the if
    (__follow_mount(...)), making it conditional on nd->mnt != path.mnt instead.

    Then we shift the result downstream.

    Equivalent transformations.

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

    Al Viro
     
  • shifted conditional mntput() calls in __link_path_walk() downstream.

    Obviously equivalent transformation.

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

    Al Viro
     
  • In open_namei(), __follow_down() loop turned into __follow_mount().
    Instead of
    if we are on a mountpoint dentry
    if O_NOFOLLOW checks fail
    drop path.dentry
    drop nd
    return
    do equivalent of follow_mount(&path.mnt, &path.dentry)
    nd->mnt = path.mnt
    we do
    if __follow_mount(path) had, indeed, traversed mountpoint
    /* now both nd->mnt and path.mnt are pinned down */
    if O_NOFOLLOW checks fail
    drop path.dentry
    drop path.mnt
    drop nd
    return
    mntput(nd->mnt)
    nd->mnt = path.mnt

    Now __follow_down() can be folded into follow_down() - no other callers left.
    We need to reorder dput()/mntput() there - same problem as in follow_mount().

    Equivalent transformation + fix for a bug in O_NOFOLLOW handling - we used to
    get -ELOOP if we had the same fs mounted on /foo and /bar, had something bound
    on /bar/baz and tried to open /foo/baz with O_NOFOLLOW. And fix of
    too-early-mntput() race in follow_down()

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

    Al Viro
     
  • New helper: __follow_mount(struct path *path). Same as follow_mount(), except
    that we do *not* do mntput() after the first lookup_mnt().

    IOW, original path->mnt stays pinned down. We also take care to do dput()
    before mntput() in the loop body (follow_mount() also needs that reordering,
    but that will be done later in the series).

    The following are equivalent, assuming that path.mnt == x:
    (1)
    follow_mount(&path.mnt, &path.dentry)
    (2)
    __follow_mount(&path);
    if (path->mnt != x)
    mntput(x);
    (3)
    if (__follow_mount(&path))
    mntput(x);

    Callers of follow_mount() in __link_path_walk() converted to (2).

    Equivalent transformation + fix for too-late-mntput() race in __follow_mount()
    loop.

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

    Al Viro
     
  • In open_namei() we never use path.mnt or path.dentry after exit: or ok:.
    Assignment of path.dentry in case of LAST_BIND is dead code and only
    obfuscates already convoluted function; assignment of path.mnt after
    __do_follow_link() can be moved down to the place where we set path.dentry.

    Obviously equivalent transformations, just to clean the air a bit in that
    region.

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

    Al Viro
     
  • The first argument of __do_follow_link() switched to struct path *
    (__do_follow_link(path->dentry, ...) -> __do_follow_link(path, ...)).

    All callers have the same calls of mntget() right before and dput()/mntput()
    right after __do_follow_link(); these calls have been moved inside.

    Obviously equivalent transformations.

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

    Al Viro
     
  • mntget(path->mnt) in do_follow_link() moved down to right before the
    __do_follow_link() call and rigth after loop: resp.

    dput()+mntput() on non-ELOOP branch moved up to right after __do_follow_link()
    call.

    resulting
    loop:
    mntget(path->mnt);
    path_release(nd);
    dput(path->mnt);
    mntput(path->mnt);
    replaced with equivalent
    dput(path->mnt);
    path_release(nd);

    Equivalent transformations - the reason why we have that mntget() is that
    __do_follow_link() can drop a reference to nd->mnt and that's what holds
    path->mnt. So that call can happen at any point prior to __do_follow_link()
    touching nd->mnt. The rest is obvious.

    NOTE: current tree relies on symlinks *never* being mounted on anything. It's
    not hard to get rid of that assumption (actually, that will come for free
    later in the series). For now we are just not making the situation worse than
    it is.

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

    Al Viro
     
  • fix for too early mntput() in open_namei() - we pin path.mnt down for the
    duration of __do_follow_link(). Otherwise we could get the fs where our
    symlink lived unmounted while we were in __do_follow_link(). That would end
    up with dentry of symlink staying pinned down through the fs shutdown.

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

    Al Viro
     
  • path.mnt in open_namei() set to mirror nd->mnt.

    nd->mnt is set in 3 places in that function - path_lookup() in the beginning,
    __follow_down() loop after do_last: and __do_follow_link() call after
    do_link:.

    We set path.mnt to nd->mnt after path_lookup() and __do_follow_link(). In
    __follow_down() loop we use &path.mnt instead of &nd->mnt and set nd->mnt to
    path.mnt immediately after that loop.

    Obviously equivalent transformation.

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

    Al Viro
     
  • Replaced struct dentry *dentry in namei with struct path path. All uses of
    dentry replaced with path.dentry there.

    Obviously equivalent transformation.

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

    Al Viro
     
  • All callers of do_follow_link() do mntget() right before it and
    dput()+mntput() right after. These calls are moved inside do_follow_link()
    now.

    Obviously equivalent transformation.

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

    Al Viro
     
  • OK, here comes a patch series that hopefully should close all
    too-early-mntput() races in fs/namei.c. Entire area is convoluted as hell, so
    I'm splitting that series into _very_ small chunks.

    Patches alread in the tree close only (very wide) races in following symlinks
    (see "busy inodes after umount" thread some time ago). Unfortunately, quite a
    few narrower races of the same nature were not closed. Hopefully this should
    take care of all of them.

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

    Al Viro
     

20 May, 2005

1 commit

  • currently it opencodes it, but that's in the way of chaning the
    lookup_hash interface.

    I'd prefer to disallow modular af_unix over exporting lookup_create,
    but I'll leave that to you.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

06 May, 2005

1 commit


29 Apr, 2005

1 commit

  • Main change is in path_lookup: added a goto to do audit_inode
    instead of return statement, when emul_lookup_dentry for root
    is successful.The existing code does audit_inode only when
    lookup is done in normal root or cwd.

    Other changes: Some lookup routines are returning zero on success,
    and some are returning zero on failure. I documented the related
    function signatures in this code path, so that one can glance over
    abstract functions without understanding the entire code.

    Signed-off-by: Prasanna Meda
    Signed-off-by: David Woodhouse

    Prasanna Meda
     

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