02 Oct, 2009

1 commit


23 Sep, 2009

1 commit

  • Make all seq_operations structs const, to help mitigate against
    revectoring user-triggerable function pointers.

    This is derived from the grsecurity patch, although generated from scratch
    because it's simpler than extracting the changes from there.

    Signed-off-by: James Morris
    Acked-by: Serge Hallyn
    Acked-by: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Morris
     

22 Sep, 2009

1 commit


16 Sep, 2009

1 commit


28 Aug, 2009

1 commit

  • kAFS crashes when asked to read a symbolic link because page_getlink()
    passes a NULL file pointer to read_mapping_page(), but afs_readpage()
    expects a file pointer from which to extract a key.

    Modify afs_readpage() to request the appropriate key from the calling
    process's keyrings if a file struct is not supplied with one attached.

    Signed-off-by: David Howells
    Acked-by: Anton Blanchard
    Signed-off-by: Linus Torvalds

    David Howells
     

13 Jul, 2009

2 commits

  • Fix the following warning:

    fs/afs/dir.c: In function 'afs_d_revalidate':
    fs/afs/dir.c:567: warning: 'fid.vnode' may be used uninitialized in this function
    fs/afs/dir.c:567: warning: 'fid.unique' may be used uninitialized in this function

    by marking the 'fid' variable as an uninitialized_var. The problem is
    that gcc doesn't always manage to work out that fid is always set on the
    path through the function that uses it.

    Cc: linux-afs@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Artem Bityutskiy
     
  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

09 Jul, 2009

1 commit

  • Fix various silly problems wrt mnt_namespace.h:

    - exit_mnt_ns() isn't used, remove it
    - done that, sched.h and nsproxy.h inclusions aren't needed
    - mount.h inclusion was need for vfsmount_lock, but no longer
    - remove mnt_namespace.h inclusion from files which don't use anything
    from mnt_namespace.h

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

01 Jul, 2009

1 commit

  • Don't unlock on vfs_rejected_lock path in afs_do_setlk, since the lock
    is unlocked after abort_attempt label.

    Signed-off-by: Jiri Slaby
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

17 Jun, 2009

1 commit

  • Authentication error abort codes should be translated to appropriate
    Linux error codes, rather than all being translated to EREMOTEIO - which
    indicates that the server had internal problems.

    Additionally, a server shouldn't be marked unavailable and the next
    server tried if an authentication error occurs. This will quickly make
    all the servers unavailable to the client. Instead the error should be
    returned straight to the user.

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     

12 Jun, 2009

2 commits

  • Move BKL into ->put_super from the only caller. A couple of
    filesystems had trivial enough ->put_super (only kfree and NULLing of
    s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
    hugetlbfs, omfs, qnx4, shmem, all others got the full treatment. Most
    of them probably don't need it, but I'd rather sort that out individually.
    Preferably after all the other BKL pushdowns in that area.

    [AV: original used to move lock_super() down as well; these changes are
    removed since we don't do lock_super() at all in generic_shutdown_super()
    now]
    [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • Signed-off-by: Al Viro

    Al Viro
     

09 May, 2009

2 commits


18 Apr, 2009

1 commit

  • If CONFIG_AFS_FSCACHE is not defined, the following warning is displayed when
    fs/afs/file.c is compiled:

    fs/afs/file.c:111: warning: ‘afs_file_readpage_read_complete’ defined but not used

    This occurs because all calls to this function are guarded by
    CONFIG_AFS_FSCACHE. Thus, guard its definition as well.

    Signed-off-by: Matt Kraai
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Matt Kraai
     

10 Apr, 2009

1 commit


03 Apr, 2009

1 commit

  • The attached patch makes the kAFS filesystem in fs/afs/ use FS-Cache, and
    through it any attached caches. The kAFS filesystem will use caching
    automatically if it's available.

    Signed-off-by: David Howells
    Acked-by: Steve Dickson
    Acked-by: Trond Myklebust
    Acked-by: Al Viro
    Tested-by: Daire Byrne

    David Howells
     

31 Mar, 2009

1 commit

  • Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
    as correctly noted at bug #12454. Someone can lookup entry with NULL
    ->owner, thus not pinning enything, and release it later resulting
    in module refcount underflow.

    We can keep ->owner and supply it at registration time like ->proc_fops
    and ->data.

    But this leaves ->owner as easy-manipulative field (just one C assignment)
    and somebody will forget to unpin previous/pin current module when
    switching ->owner. ->proc_fops is declared as "const" which should give
    some thoughts.

    ->read_proc/->write_proc were just fixed to not require ->owner for
    protection.

    rmmod'ed directories will be empty and return "." and ".." -- no harm.
    And directories with tricky enough readdir and lookup shouldn't be modular.
    We definitely don't want such modular code.

    Removing ->owner will also make PDE smaller.

    So, let's nuke it.

    Kudos to Jeff Layton for reminding about this, let's say, oversight.

    http://bugzilla.kernel.org/show_bug.cgi?id=12454

    Signed-off-by: Alexey Dobriyan

    Alexey Dobriyan
     

28 Mar, 2009

1 commit


22 Jan, 2009

1 commit


05 Jan, 2009

1 commit

  • With the write_begin/write_end aops, page_symlink was broken because it
    could no longer pass a GFP_NOFS type mask into the point where the
    allocations happened. They are done in write_begin, which would always
    assume that the filesystem can be entered from reclaim. This bug could
    cause filesystem deadlocks.

    The funny thing with having a gfp_t mask there is that it doesn't really
    allow the caller to arbitrarily tinker with the context in which it can be
    called. It couldn't ever be GFP_ATOMIC, for example, because it needs to
    take the page lock. The only thing any callers care about is __GFP_FS
    anyway, so turn that into a single flag.

    Add a new flag for write_begin, AOP_FLAG_NOFS. Filesystems can now act on
    this flag in their write_begin function. Change __grab_cache_page to
    accept a nofs argument as well, to honour that flag (while we're there,
    change the name to grab_cache_page_write_begin which is more instructive
    and does away with random leading underscores).

    This is really a more flexible way to go in the end anyway -- if a
    filesystem happens to want any extra allocations aside from the pagecache
    ones in ints write_begin function, it may now use GFP_KERNEL (rather than
    GFP_NOFS) for common case allocations (eg. ocfs2_alloc_write_ctxt, for a
    random example).

    [kosaki.motohiro@jp.fujitsu.com: fix ubifs]
    [kosaki.motohiro@jp.fujitsu.com: fix fuse]
    Signed-off-by: Nick Piggin
    Reviewed-by: KOSAKI Motohiro
    Cc: [2.6.28.x]
    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    [ Cleaned up the calling convention: just pass in the AOP flags
    untouched to the grab_cache_page_write_begin() function. That
    just simplifies everybody, and may even allow future expansion of the
    logic. - Linus ]
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

31 Oct, 2008

1 commit


23 Oct, 2008

1 commit


17 Oct, 2008

1 commit

  • Cannot assume writes will fully complete, so this conversion goes the easy
    way and always brings the page uptodate before the write.

    [dhowells@redhat.com: style tweaks]
    Signed-off-by: Nick Piggin
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

14 Oct, 2008

1 commit

  • This is a much better version of a previous patch to make the parser
    tables constant. Rather than changing the typedef, we put the "const" in
    all the various places where its required, allowing the __initconst
    exception for nfsroot which was the cause of the previous trouble.

    This was posted for review some time ago and I believe its been in -mm
    since then.

    Signed-off-by: Steven Whitehouse
    Cc: Alexander Viro
    Signed-off-by: Linus Torvalds

    Steven Whitehouse
     

05 Aug, 2008

1 commit

  • Converting page lock to new locking bitops requires a change of page flag
    operation naming, so we might as well convert it to something nicer
    (!TestSetPageLocked_Lock => trylock_page, SetPageLocked => set_page_locked).

    This also facilitates lockdeping of page lock.

    Signed-off-by: Nick Piggin
    Acked-by: KOSAKI Motohiro
    Acked-by: Peter Zijlstra
    Acked-by: Andrew Morton
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Nick Piggin
     

01 Aug, 2008

1 commit


27 Jul, 2008

2 commits

  • * kill nameidata * argument; map the 3 bits in ->flags anybody cares
    about to new MAY_... ones and pass with the mask.
    * kill redundant gfs2_iop_permission()
    * sanitize ecryptfs_permission()
    * fix remaining places where ->permission() instances might barf on new
    MAY_... found in mask.

    The obvious next target in that direction is permission(9)

    folded fix for nfs_permission() breakage from Miklos Szeredi

    Signed-off-by: Al Viro

    Al Viro
     
  • Kmem cache passed to constructor is only needed for constructors that are
    themselves multiplexeres. Nobody uses this "feature", nor does anybody uses
    passed kmem cache in non-trivial way, so pass only pointer to object.

    Non-trivial places are:
    arch/powerpc/mm/init_64.c
    arch/powerpc/mm/hugetlbpage.c

    This is flag day, yes.

    Signed-off-by: Alexey Dobriyan
    Acked-by: Pekka Enberg
    Acked-by: Christoph Lameter
    Cc: Jon Tollefson
    Cc: Nick Piggin
    Cc: Matt Mackall
    [akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
    [akpm@linux-foundation.org: fix mm/slab.c]
    [akpm@linux-foundation.org: fix ubifs]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

07 Jun, 2008

1 commit


30 Apr, 2008

1 commit


29 Apr, 2008

4 commits


16 Apr, 2008

1 commit


04 Apr, 2008

1 commit


02 Apr, 2008

1 commit


29 Mar, 2008

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    [PATCH] mnt_expire is protected by namespace_sem, no need for vfsmount_lock
    [PATCH] do shrink_submounts() for all fs types
    [PATCH] sanitize locking in mark_mounts_for_expiry() and shrink_submounts()
    [PATCH] count ghost references to vfsmounts
    [PATCH] reduce stack footprint in namespace.c

    Linus Torvalds
     
  • kafs doesn't check if the cell already exists - so if you do an echo "add
    newcell.org 1.2.3.4" >/proc/fs/afs/cells it will try to create this cell
    again. kobject will also complain about a double registration. To prevent
    such problems, return -EEXIST in that case.

    Signed-off-by: Sven Schnelle
    Signed-off-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sven Schnelle