11 Mar, 2013

1 commit


27 Feb, 2013

1 commit

  • Pull vfs pile (part one) from Al Viro:
    "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent
    locking violations, etc.

    The most visible changes here are death of FS_REVAL_DOT (replaced with
    "has ->d_weak_revalidate()") and a new helper getting from struct file
    to inode. Some bits of preparation to xattr method interface changes.

    Misc patches by various people sent this cycle *and* ocfs2 fixes from
    several cycles ago that should've been upstream right then.

    PS: the next vfs pile will be xattr stuff."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
    saner proc_get_inode() calling conventions
    proc: avoid extra pde_put() in proc_fill_super()
    fs: change return values from -EACCES to -EPERM
    fs/exec.c: make bprm_mm_init() static
    ocfs2/dlm: use GFP_ATOMIC inside a spin_lock
    ocfs2: fix possible use-after-free with AIO
    ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path
    get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero
    target: writev() on single-element vector is pointless
    export kernel_write(), convert open-coded instances
    fs: encode_fh: return FILEID_INVALID if invalid fid_type
    kill f_vfsmnt
    vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
    nfsd: handle vfs_getattr errors in acl protocol
    switch vfs_getattr() to struct path
    default SET_PERSONALITY() in linux/elf.h
    ceph: prepopulate inodes only when request is aborted
    d_hash_and_lookup(): export, switch open-coded instances
    9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()
    9p: split dropping the acls from v9fs_set_create_acl()
    ...

    Linus Torvalds
     

26 Feb, 2013

2 commits

  • According to SUSv3:

    [EACCES] Permission denied. An attempt was made to access a file in a way
    forbidden by its file access permissions.

    [EPERM] Operation not permitted. An attempt was made to perform an operation
    limited to processes with appropriate privileges or to the owner of a file
    or other resource.

    So -EPERM should be returned if capability checks fails.

    Strictly speaking this is an API change since the error code user sees is
    altered.

    Signed-off-by: Zhao Hongjiang
    Acked-by: Jan Kara
    Acked-by: Steven Whitehouse
    Acked-by: Ian Kent
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Zhao Hongjiang
     
  • This patch is a follow up on below patch:

    [PATCH] exportfs: add FILEID_INVALID to indicate invalid fid_type
    commit: 216b6cbdcbd86b1db0754d58886b466ae31f5a63

    Signed-off-by: Namjae Jeon
    Signed-off-by: Vivek Trivedi
    Acked-by: Steven Whitehouse
    Acked-by: Sage Weil
    Signed-off-by: Al Viro

    Namjae Jeon
     

23 Feb, 2013

1 commit


06 Feb, 2013

3 commits

  • s_extLength was assigned to but the value was never really used. So
    just remove the field.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • struct udf_bitmap has array of buffer pointers attached to it. The code
    unnecessarily used s_block_bitmap as a pointer to the array instead of
    the standard trick of using 0 length array in the declaration. Change
    that to make code more readable and actually shrink the structure by one
    pointer.

    Signed-off-by: Jan Kara

    Jan Kara
     
  • For large UDF filesystems with 512-byte blocks the number of necessary
    bitmap blocks is larger than 2^16 so s_nr_groups in udf_bitmap overflows
    (the number will overflow for filesystems larger than 128 GB with
    512-byte blocks). That results in ENOSPC errors despite the filesystem
    has plenty of free space.

    Fix the problem by changing s_nr_groups' type to 'int'. That is enough
    even for filesystems 2^32 blocks (UDF maximum) and 512-byte blocksize.

    Reported-and-tested-by: v10lator@myway.de
    Signed-off-by: Jan Kara

    Jan Kara
     

22 Jan, 2013

1 commit

  • This patch implements extent caching in case of file reading.
    While reading a file, currently, UDF reads metadata serially
    which takes a lot of time depending on the number of extents present
    in the file. Caching last accessd extent improves metadata read time.
    Instead of reading file metadata from start, now we read from
    the cached extent.

    This patch considerably improves the time spent by CPU in kernel mode.
    For example, while reading a 10.9 GB file using dd:
    Time before applying patch:
    11677022208 bytes (10.9GB) copied, 1529.748921 seconds, 7.3MB/s
    real 25m 29.85s
    user 0m 12.41s
    sys 15m 34.75s

    Time after applying patch:
    11677022208 bytes (10.9GB) copied, 1469.338231 seconds, 7.6MB/s
    real 24m 29.44s
    user 0m 15.73s
    sys 3m 27.61s

    [JK: Fix bh refcounting issues, simplify initialization]

    Signed-off-by: Namjae Jeon
    Signed-off-by: Ashish Sangwan
    Signed-off-by: Bonggil Bak
    Signed-off-by: Jan Kara

    Namjae Jeon
     

21 Jan, 2013

1 commit

  • So far we just marked the buffer as dirty and left writing on flusher thread
    but especially on opening that opens possible race window where we could write
    other modified fs structures to disk before we mark filesystem as open. So sync
    LVID buffer to disk after opening and closing fs.

    Reported-by: Steve Nickel
    Signed-off-by: Jan Kara

    Jan Kara
     

15 Jan, 2013

1 commit

  • This patch fixes a regression caused by commit bff943af6fe "udf: Fix memory
    leak when mounting" due to which it was triggering a kernel null point
    dereference in case of interrupted mount OR when allocating memory to
    sbi->s_partmaps failed in function udf_sb_alloc_partition_maps.

    Reported-and-tested-by: James Hogan
    Signed-off-by: Namjae Jeon
    Signed-off-by: Ashish Sangwan
    Signed-off-by: Jan Kara

    Namjae Jeon
     

13 Dec, 2012

3 commits


05 Oct, 2012

1 commit

  • Pull ext3 & udf fixes from Jan Kara:
    "Shortlog pretty much says it all.

    The interesting bits are UDF support for direct IO and ext3 fix for a
    long standing oops in data=journal mode."

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    jbd: Fix assertion failure in commit code due to lacking transaction credits
    UDF: Add support for O_DIRECT
    ext3: Replace 0 with NULL for pointer in super.c file
    udf: add writepages support for udf
    ext3: don't clear orphan list on ro mount with errors
    reiserfs: Make reiserfs_xattr_handlers static

    Linus Torvalds
     

03 Oct, 2012

3 commits

  • Pull vfs update from Al Viro:

    - big one - consolidation of descriptor-related logics; almost all of
    that is moved to fs/file.c

    (BTW, I'm seriously tempted to rename the result to fd.c. As it is,
    we have a situation when file_table.c is about handling of struct
    file and file.c is about handling of descriptor tables; the reasons
    are historical - file_table.c used to be about a static array of
    struct file we used to have way back).

    A lot of stray ends got cleaned up and converted to saner primitives,
    disgusting mess in android/binder.c is still disgusting, but at least
    doesn't poke so much in descriptor table guts anymore. A bunch of
    relatively minor races got fixed in process, plus an ext4 struct file
    leak.

    - related thing - fget_light() partially unuglified; see fdget() in
    there (and yes, it generates the code as good as we used to have).

    - also related - bits of Cyrill's procfs stuff that got entangled into
    that work; _not_ all of it, just the initial move to fs/proc/fd.c and
    switch of fdinfo to seq_file.

    - Alex's fs/coredump.c spiltoff - the same story, had been easier to
    take that commit than mess with conflicts. The rest is a separate
    pile, this was just a mechanical code movement.

    - a few misc patches all over the place. Not all for this cycle,
    there'll be more (and quite a few currently sit in akpm's tree)."

    Fix up trivial conflicts in the android binder driver, and some fairly
    simple conflicts due to two different changes to the sock_alloc_file()
    interface ("take descriptor handling from sock_alloc_file() to callers"
    vs "net: Providing protocol type via system.sockprotoname xattr of
    /proc/PID/fd entries" adding a dentry name to the socket)

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (72 commits)
    MAX_LFS_FILESIZE should be a loff_t
    compat: fs: Generic compat_sys_sendfile implementation
    fs: push rcu_barrier() from deactivate_locked_super() to filesystems
    btrfs: reada_extent doesn't need kref for refcount
    coredump: move core dump functionality into its own file
    coredump: prevent double-free on an error path in core dumper
    usb/gadget: fix misannotations
    fcntl: fix misannotations
    ceph: don't abuse d_delete() on failure exits
    hypfs: ->d_parent is never NULL or negative
    vfs: delete surplus inode NULL check
    switch simple cases of fget_light to fdget
    new helpers: fdget()/fdput()
    switch o2hb_region_dev_write() to fget_light()
    proc_map_files_readdir(): don't bother with grabbing files
    make get_file() return its argument
    vhost_set_vring(): turn pollstart/pollstop into bool
    switch prctl_set_mm_exe_file() to fget_light()
    switch xfs_find_handle() to fget_light()
    switch xfs_swapext() to fget_light()
    ...

    Linus Torvalds
     
  • There's no reason to call rcu_barrier() on every
    deactivate_locked_super(). We only need to make sure that all delayed rcu
    free inodes are flushed before we destroy related cache.

    Removing rcu_barrier() from deactivate_locked_super() affects some fast
    paths. E.g. on my machine exit_group() of a last process in IPC
    namespace takes 0.07538s. rcu_barrier() takes 0.05188s of that time.

    Signed-off-by: Kirill A. Shutemov
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Kirill A. Shutemov
     
  • Pull user namespace changes from Eric Biederman:
    "This is a mostly modest set of changes to enable basic user namespace
    support. This allows the code to code to compile with user namespaces
    enabled and removes the assumption there is only the initial user
    namespace. Everything is converted except for the most complex of the
    filesystems: autofs4, 9p, afs, ceph, cifs, coda, fuse, gfs2, ncpfs,
    nfs, ocfs2 and xfs as those patches need a bit more review.

    The strategy is to push kuid_t and kgid_t values are far down into
    subsystems and filesystems as reasonable. Leaving the make_kuid and
    from_kuid operations to happen at the edge of userspace, as the values
    come off the disk, and as the values come in from the network.
    Letting compile type incompatible compile errors (present when user
    namespaces are enabled) guide me to find the issues.

    The most tricky areas have been the places where we had an implicit
    union of uid and gid values and were storing them in an unsigned int.
    Those places were converted into explicit unions. I made certain to
    handle those places with simple trivial patches.

    Out of that work I discovered we have generic interfaces for storing
    quota by projid. I had never heard of the project identifiers before.
    Adding full user namespace support for project identifiers accounts
    for most of the code size growth in my git tree.

    Ultimately there will be work to relax privlige checks from
    "capable(FOO)" to "ns_capable(user_ns, FOO)" where it is safe allowing
    root in a user names to do those things that today we only forbid to
    non-root users because it will confuse suid root applications.

    While I was pushing kuid_t and kgid_t changes deep into the audit code
    I made a few other cleanups. I capitalized on the fact we process
    netlink messages in the context of the message sender. I removed
    usage of NETLINK_CRED, and started directly using current->tty.

    Some of these patches have also made it into maintainer trees, with no
    problems from identical code from different trees showing up in
    linux-next.

    After reading through all of this code I feel like I might be able to
    win a game of kernel trivial pursuit."

    Fix up some fairly trivial conflicts in netfilter uid/git logging code.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (107 commits)
    userns: Convert the ufs filesystem to use kuid/kgid where appropriate
    userns: Convert the udf filesystem to use kuid/kgid where appropriate
    userns: Convert ubifs to use kuid/kgid
    userns: Convert squashfs to use kuid/kgid where appropriate
    userns: Convert reiserfs to use kuid and kgid where appropriate
    userns: Convert jfs to use kuid/kgid where appropriate
    userns: Convert jffs2 to use kuid and kgid where appropriate
    userns: Convert hpfs to use kuid and kgid where appropriate
    userns: Convert btrfs to use kuid/kgid where appropriate
    userns: Convert bfs to use kuid/kgid where appropriate
    userns: Convert affs to use kuid/kgid wherwe appropriate
    userns: On alpha modify linux_to_osf_stat to use convert from kuids and kgids
    userns: On ia64 deal with current_uid and current_gid being kuid and kgid
    userns: On ppc convert current_uid from a kuid before printing.
    userns: Convert s390 getting uid and gid system calls to use kuid and kgid
    userns: Convert s390 hypfs to use kuid and kgid where appropriate
    userns: Convert binder ipc to use kuids
    userns: Teach security_path_chown to take kuids and kgids
    userns: Add user namespace support to IMA
    userns: Convert EVM to deal with kuids and kgids in it's hmac computation
    ...

    Linus Torvalds
     

21 Sep, 2012

1 commit


06 Sep, 2012

1 commit

  • Add support for the O_DIRECT flag. There are two cases to deal with:

    1. Small files stored in the ICB (inode control block?): just return 0
    from the new udf_adinicb_direct_IO() handler to fall back to buffered
    I/O.

    2. Larger files, not stored in the ICB: nothing special here. Just call
    blockdev_direct_IO() from our new udf_direct_IO() handler and tidy up
    any blocks instantiated outside i_size on error. This is pretty
    standard. Factor error handling code out of udf_write_begin() into new
    function udf_write_failed() so it can also be called by udf_direct_IO().

    Also change the whitespace in udf_aops to make it a bit neater.

    Signed-off-by: Ian Abbott
    Signed-off-by: Jan Kara

    Ian Abbott
     

05 Sep, 2012

2 commits

  • Jan Kara
     
  • When a file is stored in ICB (inode), we overwrite part of the file, and
    the page containing file's data is not in page cache, we end up corrupting
    file's data by overwriting them with zeros. The problem is we use
    simple_write_begin() which simply zeroes parts of the page which are not
    written to. The problem has been introduced by be021ee4 (udf: convert to
    new aops).

    Fix the problem by providing a ->write_begin function which makes the page
    properly uptodate.

    CC: # >= 2.6.24
    Reported-by: Ian Abbott
    Signed-off-by: Jan Kara

    Jan Kara
     

04 Sep, 2012

1 commit

  • Use mpage_writepages() instead of multiple calls to udf_writepage()
    to make performance higher.

    *Write Speed with writepage() =
    RecSize ReadSpeed WriteSpeed RanReadSpeed RanWriteSpeed
    10485760 0.00MB/sec 8.56MB/sec 0.00MB/sec 8.20MB/sec
    1048576 0.00MB/sec 8.57MB/sec 0.00MB/sec 6.42MB/sec
    524288 0.00MB/sec 8.59MB/sec 0.00MB/sec 5.24MB/sec
    262144 0.00MB/sec 8.59MB/sec 0.00MB/sec 4.17MB/sec
    131072 0.00MB/sec 8.53MB/sec 0.00MB/sec 3.32MB/sec
    65536 0.00MB/sec 8.49MB/sec 0.00MB/sec 2.31MB/sec

    *Write Speed with writepages()
    RecSize ReadSpeed WriteSpeed RanReadSpeed RanWriteSpeed
    10485760 0.00MB/sec 9.88MB/sec 0.00MB/sec 9.60MB/sec
    1048576 0.00MB/sec 9.95MB/sec 0.00MB/sec 7.52MB/sec
    524288 0.00MB/sec 9.98MB/sec 0.00MB/sec 6.16MB/sec
    262144 0.00MB/sec 9.90MB/sec 0.00MB/sec 4.98MB/sec
    131072 0.00MB/sec 9.89MB/sec 0.00MB/sec 3.78MB/sec
    65536 0.00MB/sec 9.81MB/sec 0.00MB/sec 2.50MB/sec

    There is about 1.4MB/sec speed improvement over 8.5MB/sec,
    which comes out around 16% improvement.

    Signed-off-by: Namjae Jeon
    Signed-off-by: Ashish Sangwan
    Signed-off-by: Jan Kara

    Namjae Jeon
     

15 Aug, 2012

3 commits


25 Jul, 2012

1 commit

  • Pull misc udf, ext2, ext3, and isofs fixes from Jan Kara:
    "Assorted, mostly trivial, fixes for udf, ext2, ext3, and isofs. I'm
    on vacation and scarcely checking email since we are expecting baby
    any day now but these fixes should be safe to go in and I don't want
    to delay them unnecessarily."

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: avoid info leak on export
    isofs: avoid info leak on export
    udf: Improve table length check to avoid possible overflow
    ext3: Check return value of blkdev_issue_flush()
    jbd: Check return value of blkdev_issue_flush()
    udf: Do not decrement i_blocks when freeing indirect extent block
    udf: Fix memory leak when mounting
    ext2: cleanup the confused goto label
    UDF: Remove unnecessary variable "offset" from udf_fill_inode
    udf: stop using s_dirt
    ext3: force ro mount if ext3_setup_super() fails
    quota: fix checkpatch.pl warning by replacing with

    Linus Torvalds
     

14 Jul, 2012

2 commits

  • boolean "does it have to be exclusive?" flag is passed instead;
    Local filesystem should just ignore it - the object is guaranteed
    not to be there yet.

    Signed-off-by: Al Viro

    Al Viro
     
  • Just the flags; only NFS cares even about that, but there are
    legitimate uses for such argument. And getting rid of that
    completely would require splitting ->lookup() into a couple
    of methods (at least), so let's leave that alone for now...

    Signed-off-by: Al Viro

    Al Viro
     

13 Jul, 2012

1 commit


11 Jul, 2012

1 commit

  • When a partition table length is corrupted to be close to 1 << 32, the
    check for its length may overflow on 32-bit systems and we will think
    the length is valid. Later on the kernel can crash trying to read beyond
    end of buffer. Fix the check to avoid possible overflow.

    CC: stable@vger.kernel.org
    Reported-by: Ben Hutchings
    Signed-off-by: Jan Kara

    Jan Kara
     

09 Jul, 2012

4 commits


29 Jun, 2012

4 commits


30 May, 2012

1 commit

  • pass inode + parent's inode or NULL instead of dentry + bool saying
    whether we want the parent or not.

    NOTE: that needs ceph fix folded in.

    Signed-off-by: Al Viro

    Al Viro