07 Jan, 2012

2 commits


04 Jan, 2012

1 commit


29 Oct, 2011

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue: (21 commits)
    leases: fix write-open/read-lease race
    nfs: drop unnecessary locking in llseek
    ext4: replace cut'n'pasted llseek code with generic_file_llseek_size
    vfs: add generic_file_llseek_size
    vfs: do (nearly) lockless generic_file_llseek
    direct-io: merge direct_io_walker into __blockdev_direct_IO
    direct-io: inline the complete submission path
    direct-io: separate map_bh from dio
    direct-io: use a slab cache for struct dio
    direct-io: rearrange fields in dio/dio_submit to avoid holes
    direct-io: fix a wrong comment
    direct-io: separate fields only used in the submission path from struct dio
    vfs: fix spinning prevention in prune_icache_sb
    vfs: add a comment to inode_permission()
    vfs: pass all mask flags check_acl and posix_acl_permission
    vfs: add hex format for MAY_* flag values
    vfs: indicate that the permission functions take all the MAY_* flags
    compat: sync compat_stats with statfs.
    vfs: add "device" tag to /proc/self/mountstats
    cleanup: vfs: small comment fix for block_invalidatepage
    ...

    Fix up trivial conflict in fs/gfs2/file.c (llseek changes)

    Linus Torvalds
     

28 Oct, 2011

1 commit

  • The i_mutex lock use of generic _file_llseek hurts. Independent processes
    accessing the same file synchronize over a single lock, even though
    they have no need for synchronization at all.

    Under high utilization this can cause llseek to scale very poorly on larger
    systems.

    This patch does some rethinking of the llseek locking model:

    First the 64bit f_pos is not necessarily atomic without locks
    on 32bit systems. This can already cause races with read() today.
    This was discussed on linux-kernel in the past and deemed acceptable.
    The patch does not change that.

    Let's look at the different seek variants:

    SEEK_SET: Doesn't really need any locking.
    If there's a race one writer wins, the other loses.

    For 32bit the non atomic update races against read()
    stay the same. Without a lock they can also happen
    against write() now. The read() race was deemed
    acceptable in past discussions, and I think if it's
    ok for read it's ok for write too.

    => Don't need a lock.

    SEEK_END: This behaves like SEEK_SET plus it reads
    the maximum size too. Reading the maximum size would have the
    32bit atomic problem. But luckily we already have a way to read
    the maximum size without locking (i_size_read), so we
    can just use that instead.

    Without i_mutex there is no synchronization with write() anymore,
    however since the write() update is atomic on 64bit it just behaves
    like another racy SEEK_SET. On non atomic 32bit it's the same
    as SEEK_SET.

    => Don't need a lock, but need to use i_size_read()

    SEEK_CUR: This has a read-modify-write race window
    on the same file. One could argue that any application
    doing unsynchronized seeks on the same file is already broken.
    But for the sake of not adding a regression here I'm
    using the file->f_lock to synchronize this. Using this
    lock is much better than the inode mutex because it doesn't
    synchronize between processes.

    => So still need a lock, but can use a f_lock.

    This patch implements this new scheme in generic_file_llseek.
    I dropped generic_file_llseek_unlocked and changed all callers.

    Signed-off-by: Andi Kleen
    Signed-off-by: Christoph Hellwig

    Andi Kleen
     

20 Oct, 2011

3 commits


14 Oct, 2011

1 commit


13 Oct, 2011

3 commits

  • Thus spake Jeff Layton:

    "Making that a module parm would allow you to set that parameter at boot
    time without needing to add special startup scripts. IMO, all of the
    procfile "switches" under /proc/fs/cifs should be module parms
    instead."

    This patch doesn't alter the default behavior (Oplocks are enabled by
    default).

    To disable oplocks when loading the module, use

    modprobe cifs enable_oplocks=0

    (any of '0' or 'n' or 'N' conventions can be used).

    To disable oplocks at runtime using the new interface, use

    echo 0 > /sys/module/cifs/parameters/enable_oplocks

    The older /proc/fs/cifs/OplockEnabled interface will be deprecated
    after two releases. A subsequent patch will add an warning message
    about this deprecation.

    Changes since v2:
    - make enable_oplocks a 'bool'

    Changes since v1:
    - eliminate the use of extra variable by renaming the old one to
    enable_oplocks and make it an 'int' type.

    Reported-by: Alexander Swen
    Reviewed-by: Jeff Layton
    Signed-off-by: Suresh Jayaraman
    Signed-off-by: Steve French

    Steve French
     
  • It should be 'CONFIG_CIFS_NFSD_EXPORT'. No-one noticed because that
    symbol depends on BROKEN.

    Signed-off-by: Paul Bolle
    Signed-off-by: Steve French

    Paul Bolle
     
  • Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

12 Oct, 2011

1 commit


20 Sep, 2011

1 commit


05 Aug, 2011

1 commit

  • The loop around lookup_one_len doesn't handle the case where it might
    return a negative dentry, which can cause an oops on the next pass
    through the loop. Check for that and break out of the loop with an
    error of -ENOENT if there is one.

    Fixes the panic reported here:

    https://bugzilla.redhat.com/show_bug.cgi?id=727927

    Reported-by: TR Bentley
    Reported-by: Iain Arnell
    Cc: Al Viro
    Cc: stable@kernel.org
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

01 Aug, 2011

1 commit

  • Currently, we take a sb->s_active reference and a cifsFileInfo reference
    when an oplock break workqueue job is queued. This is unnecessary and
    more complicated than it needs to be. Also as Al points out,
    deactivate_super has non-trivial locking implications so it's best to
    avoid that if we can.

    Instead, just cancel any pending oplock breaks for this filehandle
    synchronously in cifsFileInfo_put after taking it off the lists.
    That should ensure that this job doesn't outlive the structures it
    depends on.

    Reported-by: Al Viro
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

21 Jul, 2011

1 commit

  • This converts everybody to handle SEEK_HOLE/SEEK_DATA properly. In some cases
    we just return -EINVAL, in others we do the normal generic thing, and in others
    we're simply making sure that the properly due-dilligence is done. For example
    in NFS/CIFS we need to make sure the file size is update properly for the
    SEEK_HOLE and SEEK_DATA case, but since it calls the generic llseek stuff itself
    that is all we have to do. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Al Viro

    Josef Bacik
     

20 Jul, 2011

3 commits


19 Jul, 2011

1 commit

  • Add missing ->i_mutex, convert to lookup_one_len() instead of
    (broken) open-coded analog, cope with getting something like
    a//b as relative pathname. Simplify the hell out of it, while
    we are there...

    Signed-off-by: Al Viro
    Reviewed-by: Jeff Layton

    Al Viro
     

08 Jul, 2011

1 commit


07 Jul, 2011

1 commit


25 Jun, 2011

15 commits


20 Jun, 2011

1 commit


14 Jun, 2011

1 commit