30 Oct, 2016

3 commits

  • Pull networking fixes from David Miller:
    "Lots of fixes, mostly drivers as is usually the case.

    1) Don't treat zero DMA address as invalid in vmxnet3, from Alexey
    Khoroshilov.

    2) Fix element timeouts in netfilter's nft_dynset, from Anders K.
    Pedersen.

    3) Don't put aead_req crypto struct on the stack in mac80211, from
    Ard Biesheuvel.

    4) Several uninitialized variable warning fixes from Arnd Bergmann.

    5) Fix memory leak in cxgb4, from Colin Ian King.

    6) Fix bpf handling of VLAN header push/pop, from Daniel Borkmann.

    7) Several VRF semantic fixes from David Ahern.

    8) Set skb->protocol properly in ip6_tnl_xmit(), from Eli Cooper.

    9) Socket needs to be locked in udp_disconnect(), from Eric Dumazet.

    10) Div-by-zero on 32-bit fix in mlx4 driver, from Eugenia Emantayev.

    11) Fix stale link state during failover in NCSCI driver, from Gavin
    Shan.

    12) Fix netdev lower adjacency list traversal, from Ido Schimmel.

    13) Propvide proper handle when emitting notifications of filter
    deletes, from Jamal Hadi Salim.

    14) Memory leaks and big-endian issues in rtl8xxxu, from Jes Sorensen.

    15) Fix DESYNC_FACTOR handling in ipv6, from Jiri Bohac.

    16) Several routing offload fixes in mlxsw driver, from Jiri Pirko.

    17) Fix broadcast sync problem in TIPC, from Jon Paul Maloy.

    18) Validate chunk len before using it in SCTP, from Marcelo Ricardo
    Leitner.

    19) Revert a netns locking change that causes regressions, from Paul
    Moore.

    20) Add recursion limit to GRO handling, from Sabrina Dubroca.

    21) GFP_KERNEL in irq context fix in ibmvnic, from Thomas Falcon.

    22) Avoid accessing stale vxlan/geneve socket in data path, from
    Pravin Shelar"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (189 commits)
    geneve: avoid using stale geneve socket.
    vxlan: avoid using stale vxlan socket.
    qede: Fix out-of-bound fastpath memory access
    net: phy: dp83848: add dp83822 PHY support
    enic: fix rq disable
    tipc: fix broadcast link synchronization problem
    ibmvnic: Fix missing brackets in init_sub_crq_irqs
    ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context
    Revert "ibmvnic: Fix releasing of sub-CRQ IRQs in interrupt context"
    arch/powerpc: Update parameters for csum_tcpudp_magic & csum_tcpudp_nofold
    net/mlx4_en: Save slave ethtool stats command
    net/mlx4_en: Fix potential deadlock in port statistics flow
    net/mlx4: Fix firmware command timeout during interrupt test
    net/mlx4_core: Do not access comm channel if it has not yet been initialized
    net/mlx4_en: Fix panic during reboot
    net/mlx4_en: Process all completions in RX rings after port goes up
    net/mlx4_en: Resolve dividing by zero in 32-bit system
    net/mlx4_core: Change the default value of enable_qos
    net/mlx4_core: Avoid setting ports to auto when only one port type is supported
    net/mlx4_core: Fix the resource-type enum in res tracker to conform to FW spec
    ...

    Linus Torvalds
     
  • Pull ubi/ubifs fixes from Richard Weinberger:
    "This contains fixes for issues in both UBI and UBIFS:

    - A regression wrt overlayfs, introduced in -rc2.
    - An UBI issue, found by Dan Carpenter's static checker"

    * tag 'upstream-4.9-rc3' of git://git.infradead.org/linux-ubifs:
    ubifs: Fix regression in ubifs_readdir()
    ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap()

    Linus Torvalds
     
  • Pull driver core fixes from Greg KH:
    "Here are two small driver core / kernfs fixes for 4.9-rc3.

    One makes the Kconfig entry for DEBUG_TEST_DRIVER_REMOVE a bit more
    explicit that this is a crazy thing to enable for a distro kernel
    (thanks for trying Fedora!), the other resolves an issue with vim
    opening kernfs files (sysfs, configfs, etc.)

    Both have been in linux-next with no reported issues"

    * tag 'driver-core-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    driver core: Make Kconfig text for DEBUG_TEST_DRIVER_REMOVE stronger
    kernfs: Add noop_fsync to supported kernfs_file_fops

    Linus Torvalds
     

29 Oct, 2016

1 commit

  • Pull btrfs fixes from Chris Mason:
    "My patch fixes the btrfs list_head abuse that we tracked down during
    Dave Jones' memory corruption investigation. With both Jens and my
    patches in place, I'm no longer able to trigger problems.

    Filipe is fixing a difficult old bug between snapshots, balance and
    send. Dave is cooking a few more for the next rc, but these are tested
    and ready"

    * 'for-linus-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    btrfs: fix races on root_log_ctx lists
    btrfs: fix incremental send failure caused by balance

    Linus Torvalds
     

28 Oct, 2016

7 commits

  • Commit c83ed4c9dbb35 ("ubifs: Abort readdir upon error") broke
    overlayfs support because the fix exposed an internal error
    code to VFS.

    Reported-by: Peter Rosin
    Tested-by: Peter Rosin
    Reported-by: Ralph Sennhauser
    Tested-by: Ralph Sennhauser
    Fixes: c83ed4c9dbb35 ("ubifs: Abort readdir upon error")
    Cc: stable@vger.kernel.org
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • Merge misc fixes from Andrew Morton:
    "20 fixes"

    * emailed patches from Andrew Morton :
    drivers/misc/sgi-gru/grumain.c: remove bogus 0x prefix from printk
    cris/arch-v32: cryptocop: print a hex number after a 0x prefix
    ipack: print a hex number after a 0x prefix
    block: DAC960: print a hex number after a 0x prefix
    fs: exofs: print a hex number after a 0x prefix
    lib/genalloc.c: start search from start of chunk
    mm: memcontrol: do not recurse in direct reclaim
    CREDITS: update credit information for Martin Kepplinger
    proc: fix NULL dereference when reading /proc//auxv
    mm: kmemleak: ensure that the task stack is not freed during scanning
    lib/stackdepot.c: bump stackdepot capacity from 16MB to 128MB
    latent_entropy: raise CONFIG_FRAME_WARN by default
    kconfig.h: remove config_enabled() macro
    ipc: account for kmem usage on mqueue and msg
    mm/slab: improve performance of gathering slabinfo stats
    mm: page_alloc: use KERN_CONT where appropriate
    mm/list_lru.c: avoid error-path NULL pointer deref
    h8300: fix syscall restarting
    kcov: properly check if we are in an interrupt
    mm/slab: fix kmemcg cache creation delayed issue

    Linus Torvalds
     
  • It makes the message hard to interpret correctly if a base 10 number is
    prefixed by 0x. So change to a hex number.

    Link: http://lkml.kernel.org/r/20161026125658.25728-2-u.kleine-koenig@pengutronix.de
    Signed-off-by: Uwe Kleine-König
    Cc: Boaz Harrosh
    Cc: Benny Halevy
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     
  • Reading auxv of any kernel thread results in NULL pointer dereferencing
    in auxv_read() where mm can be NULL. Fix that by checking for NULL mm
    and bailing out early. This is also the original behavior changed by
    recent commit c5317167854e ("proc: switch auxv to use of __mem_open()").

    # cat /proc/2/auxv
    Unable to handle kernel NULL pointer dereference at virtual address 000000a8
    Internal error: Oops: 17 [#1] PREEMPT SMP ARM
    CPU: 3 PID: 113 Comm: cat Not tainted 4.9.0-rc1-ARCH+ #1
    Hardware name: BCM2709
    task: ea3b0b00 task.stack: e99b2000
    PC is at auxv_read+0x24/0x4c
    LR is at do_readv_writev+0x2fc/0x37c
    Process cat (pid: 113, stack limit = 0xe99b2210)
    Call chain:
    auxv_read
    do_readv_writev
    vfs_readv
    default_file_splice_read
    splice_direct_to_actor
    do_splice_direct
    do_sendfile
    SyS_sendfile64
    ret_fast_syscall

    Fixes: c5317167854e ("proc: switch auxv to use of __mem_open()")
    Link: http://lkml.kernel.org/r/1476966200-14457-1-git-send-email-chianglungyu@gmail.com
    Signed-off-by: Leon Yu
    Acked-by: Oleg Nesterov
    Acked-by: Michal Hocko
    Cc: Al Viro
    Cc: Kees Cook
    Cc: John Stultz
    Cc: Mateusz Guzik
    Cc: Janis Danisevskis
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Leon Yu
     
  • Pull oreangefs updates from Mike Marshall:
    "A couple of orangefs cleanups sent in by other developers:

    - use d_fsdata instead of d_time (Miklos Szeredi)

    - use file_inode(file) instead of file->f_path.dentry->d_inode (Amir
    Goldstein)"

    * tag 'for-linus-4.9-rc2-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
    orangefs: don't use d_time
    orangefs: user file_inode() where it is due

    Linus Torvalds
     
  • …rnel/git/dgc/linux-xfs

    Pull xfs fixes from Dave Chinner:
    "This update contains fixes for most of the outstanding regressions
    introduced with the 4.9-rc1 XFS merge. There is also a fix for an
    iomap bug, too.

    This is a quite a bit larger than I'd prefer for a -rc3, but most of
    the change comes from cleaning up the new reflink copy on write code;
    it's much simpler and easier to understand now. These changes fixed
    several bugs in the new code, and it wasn't clear that there was an
    easier/simpler way to fix them. The rest of the fixes are the usual
    size you'd expect at this stage.

    I've left the commits to soak in linux-next for a some extra time
    because of the size before asking you to pull, no new problems with
    them have been reported so I think it's all OK.

    Summary:
    - iomap page offset masking fix for page faults
    - add IOMAP_REPORT to distinguish between read and fiemap map
    requests
    - cleanups to new shared data extent code
    - fix mount active status on failed log recovery
    - fix broken dquots in a buffer calculation
    - fix locking order issues and merge xfs_reflink_remap_range and
    xfs_file_share_range
    - rework unmapping of CoW extents and remove now unused functions
    - clean state when CoW is done"

    * tag 'xfs-fixes-for-linus-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs: (25 commits)
    xfs: clear cowblocks tag when cow fork is emptied
    xfs: fix up inode cowblocks tracking tracepoints
    fs: Do to trim high file position bits in iomap_page_mkwrite_actor
    xfs: remove xfs_bunmapi_cow
    xfs: optimize xfs_reflink_end_cow
    xfs: optimize xfs_reflink_cancel_cow_blocks
    xfs: refactor xfs_bunmapi_cow
    xfs: optimize writes to reflink files
    xfs: don't bother looking at the refcount tree for reads
    xfs: handle "raw" delayed extents xfs_reflink_trim_around_shared
    xfs: add xfs_trim_extent
    iomap: add IOMAP_REPORT
    xfs: merge xfs_reflink_remap_range and xfs_file_share_range
    xfs: remove xfs_file_wait_for_io
    xfs: move inode locking from xfs_reflink_remap_range to xfs_file_share_range
    xfs: fix the same_inode check in xfs_file_share_range
    xfs: remove the same fs check from xfs_file_share_range
    libxfs: v3 inodes are only valid on crc-enabled filesystems
    libxfs: clean up _calc_dquots_per_chunk
    xfs: unset MS_ACTIVE if mount fails
    ...

    Linus Torvalds
     
  • btrfs_remove_all_log_ctxs takes a shortcut where it avoids walking the
    list because it knows all of the waiters are patiently waiting for the
    commit to finish.

    But, there's a small race where btrfs_sync_log can remove itself from
    the list if it finds a log commit is already done. Also, it uses
    list_del_init() to remove itself from the list, but there's no way to
    know if btrfs_remove_all_log_ctxs has already run, so we don't know for
    sure if it is safe to call list_del_init().

    This gets rid of all the shortcuts for btrfs_remove_all_log_ctxs(), and
    just calls it with the proper locking.

    This is part two of the corruption fixed by cbd60aa7cd1. I should have
    done this in the first place, but convinced myself the optimizations were
    safe. A 12 hour run of dbench 2048 will eventually trigger a list debug
    WARN_ON for the list_del_init() in btrfs_sync_log().

    Fixes: d1433debe7f4346cf9fc0dafc71c3137d2a97bc4
    Reported-by: Dave Jones
    cc: stable@vger.kernel.org # 3.15+
    Signed-off-by: Chris Mason

    Chris Mason
     

27 Oct, 2016

1 commit


25 Oct, 2016

3 commits

  • Now that Lorenzo cleaned things up and made the FOLL_FORCE users
    explicit, it becomes obvious how some of them don't really need
    FOLL_FORCE at all.

    So remove FOLL_FORCE from the proc code that reads the command line and
    arguments from user space.

    The mem_rw() function actually does want FOLL_FORCE, because gdd (and
    possibly many other debuggers) use it as a much more convenient version
    of PTRACE_PEEKDATA, but we should consider making the FOLL_FORCE part
    conditional on actually being a ptracer. This does not actually do
    that, just moves adds a comment to that effect and moves the gup_flags
    settings next to each other.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Instead use d_fsdata which is the same size. Hoping to get rid of d_time,
    which is used by very few filesystems by this time.

    Signed-off-by: Miklos Szeredi
    Reviewed-by: Martin Brandenburg
    Signed-off-by: Mike Marshall

    Miklos Szeredi
     
  • Replace wrong use of file->f_path.dentry->d_inode with file_inode(file).
    In case orangefs ever finds itself as an overelayfs layer, it would want
    to get its own inode and not overlayfs's inode.

    DISCLAIMER: I did not test this patch because I do not know how to setup
    an orangefs mount

    Signed-off-by: Amir Goldstein
    Signed-off-by: Mike Marshall

    Amir Goldstein
     

24 Oct, 2016

5 commits

  • The background cowblocks scan job takes care of scanning for inodes with
    potentially lingering blocks in the cow fork and clearing them out. If
    the background scanner reclaims the cow fork blocks, however, it doesn't
    immediately clear the cowblocks tag from the inode. Instead, the inode
    remains tagged until the background scanner comes around again,
    discovers the inode cow fork has no blocks, clears the tag and fires the
    trace_xfs_inode_free_cowblocks_invalid() tracepoint to indicate that the
    inode may have been incorrectly tagged.

    This is not a major functional problem as the tag is ultimately cleared.
    Nonetheless, clear the tag when an inode cow fork is explicitly emptied
    to avoid the extra round trip through the background scanner and
    spurious "invalid" tracepoint.

    Signed-off-by: Brian Foster
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Brian Foster
     
  • These calls are still using the eofblocks tracepoints. The cowblocks
    equivalents are already defined, we just aren't actually calling them.

    Signed-off-by: Brian Foster
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Brian Foster
     
  • iomap_page_mkwrite_actor() calls __block_write_begin_int() with position
    masked as pos & ~PAGE_MASK which is equivalent to pos & (PAGE_SIZE-1).
    Thus it masks off high bits of file position. However
    __block_write_begin_int() expects full file position on input. This does
    not cause any visible issues because all __block_write_begin_int()
    really cares about are low file position bits but still it is a bug
    waiting to happen.

    Signed-off-by: Jan Kara
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Dave Chinner

    Jan Kara
     
  • Pull UBI[FS] fixes from Richard Weinberger:
    "This contains fixes for issues in both UBI and UBIFS:

    - Fallout from the merge window, refactoring UBI code introduced some
    issues.

    - Fixes for an UBIFS readdir bug which can cause getdents() to busy
    loop for ever and a bug in the UBIFS xattr code"

    * tag 'upstream-4.9-rc2' of git://git.infradead.org/linux-ubifs:
    ubifs: Abort readdir upon error
    UBI: Fix crash in try_recover_peb()
    ubi: fix swapped arguments to call to ubi_alloc_aeb
    ubifs: Fix xattr_names length in exit paths
    ubifs: Rename ubifs_rename2

    Linus Torvalds
     
  • Pull ext4 fixes from Ted Ts'o:
    "A few bug fixes and add some missing KERN_CONT annotations"

    * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: add missing KERN_CONT to a few more debugging uses
    fscrypto: lock inode while setting encryption policy
    ext4: correct endianness conversion in __xattr_check_inode()
    fscrypto: make XTS tweak initialization endian-independent
    ext4: do not advertise encryption support when disabled
    jbd2: fix incorrect unlock on j_list_lock
    ext4: super.c: Update logging style using KERN_CONT

    Linus Torvalds
     

23 Oct, 2016

1 commit

  • Pull vmap stack fixes from Ingo Molnar:
    "This is fallout from CONFIG_HAVE_ARCH_VMAP_STACK=y on x86: stack
    accesses that used to be just somewhat questionable are now totally
    buggy.

    These changes try to do it without breaking the ABI: the fields are
    left there, they are just reporting zero, or reporting narrower
    information (the maps file change)"

    * 'mm-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    mm: Change vm_is_stack_for_task() to vm_is_stack_for_current()
    fs/proc: Stop trying to report thread stacks
    fs/proc: Stop reporting eip and esp in /proc/PID/stat
    mm/numa: Remove duplicated include from mprotect.c

    Linus Torvalds
     

22 Oct, 2016

1 commit


21 Oct, 2016

1 commit

  • Pull Ceph fixes from Ilya Dryomov:
    "An rbd exclusive-lock edge case fix and several filesystem fixups.

    Nikolay's error path patch is tagged for stable, everything else but
    readdir vs frags race was introduced in this merge window"

    * tag 'ceph-for-4.9-rc2' of git://github.com/ceph/ceph-client:
    ceph: fix non static symbol warning
    ceph: fix uninitialized dentry pointer in ceph_real_mount()
    ceph: fix readdir vs fragmentation race
    ceph: fix error handling in ceph_read_iter
    rbd: don't retry watch reregistration if header object is gone
    rbd: don't wait for the lock forever if blacklisted

    Linus Torvalds
     

20 Oct, 2016

17 commits

  • Pull misc filesystem fixes from Jan Kara:
    "A fix for an isofs change apparently breaking mount(8) in some cases
    and one ext2 warning fix"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    ext2: avoid bogus -Wmaybe-uninitialized warning
    isofs: Do not return EACCES for unknown filesystems

    Linus Torvalds
     
  • This reverts more of:

    b76437579d13 ("procfs: mark thread stack correctly in proc//maps")

    ... which was partially reverted by:

    65376df58217 ("proc: revert /proc//maps [stack:TID] annotation")

    Originally, /proc/PID/task/TID/maps was the same as /proc/TID/maps.

    In current kernels, /proc/PID/maps (or /proc/TID/maps even for
    threads) shows "[stack]" for VMAs in the mm's stack address range.

    In contrast, /proc/PID/task/TID/maps uses KSTK_ESP to guess the
    target thread's stack's VMA. This is racy, probably returns garbage
    and, on arches with CONFIG_TASK_INFO_IN_THREAD=y, is also crash-prone:
    KSTK_ESP is not safe to use on tasks that aren't known to be running
    ordinary process-context kernel code.

    This patch removes the difference and just shows "[stack]" for VMAs
    in the mm's stack range. This is IMO much more sensible -- the
    actual "stack" address really is treated specially by the VM code,
    and the current thread stack isn't even well-defined for programs
    that frequently switch stacks on their own.

    Reported-by: Jann Horn
    Signed-off-by: Andy Lutomirski
    Acked-by: Thomas Gleixner
    Cc: Al Viro
    Cc: Andrew Morton
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Johannes Weiner
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Linux API
    Cc: Peter Zijlstra
    Cc: Tycho Andersen
    Link: http://lkml.kernel.org/r/3e678474ec14e0a0ec34c611016753eea2e1b8ba.1475257877.git.luto@kernel.org
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • Reporting these fields on a non-current task is dangerous. If the
    task is in any state other than normal kernel code, they may contain
    garbage or even kernel addresses on some architectures. (x86_64
    used to do this. I bet lots of architectures still do.) With
    CONFIG_THREAD_INFO_IN_TASK=y, it can OOPS, too.

    As far as I know, there are no use programs that make any material
    use of these fields, so just get rid of them.

    Reported-by: Jann Horn
    Signed-off-by: Andy Lutomirski
    Acked-by: Thomas Gleixner
    Cc: Al Viro
    Cc: Andrew Morton
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Kees Cook
    Cc: Linus Torvalds
    Cc: Linux API
    Cc: Peter Zijlstra
    Cc: Tetsuo Handa
    Cc: Tycho Andersen
    Link: http://lkml.kernel.org/r/a5fed4c3f4e33ed25d4bb03567e329bc5a712bcc.1475257877.git.luto@kernel.org
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • Since no one uses it anymore.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • Instead of doing a full extent list search for each extent that is
    to be deleted using xfs_bmapi_read and then doing another one inside
    of xfs_bunmapi_cow use the same scheme that xfs_bumapi uses: look
    up the last extent to be deleted and then use the extent index to
    walk downward until we are outside the range to be deleted.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • Rewrite xfs_reflink_cancel_cow_blocks so that we only do a search for
    the first extent in the extent list and then iterate over the remaining
    extents using the extent index, passing the extent we operate on
    directly to xfs_bmap_del_extent_delay or xfs_bmap_del_extent_cow instead
    of going through xfs_bunmapi and doing yet another extent list lookup.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • Split out two helpers for deleting delayed or real extents from the COW fork.
    This allows to call them directly from xfs_reflink_cow_end_io once that
    function is refactored to iterate the extent tree. It will also allow
    to reuse the delalloc deletion from xfs_bunmapi in the future.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • Instead of reserving space as the first thing in write_begin move it past
    reading the extent in the data fork. That way we only have to read from
    the data fork once and can reuse that information for trimming the extent
    to the shared/unshared boundary. Additionally this allows to easily
    limit the actual write size to said boundary, and avoid a roundtrip on the
    ilock.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • There is no need to trim an extent into a shared or non-shared one, or
    report any flags for plain old reads.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • Delalloc extents in the extent list contain the number of reserved
    indirect blocks in their startblock value and don't use the magic
    DELAYSTARTBLOCK constant. Ensure that xfs_reflink_trim_around_shared
    handles them properly by checking for isnullstartblock().

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • This helpers allows to trim an extent to a subset of it's original range
    while making sure the block numbers in it remain valid,

    In the future xfs_trim_extent and xfs_bmapi_trim_map should probably be
    merged in some form.

    Signed-off-by: Darrick J. Wong
    [hch: split from a previous patch from Darrick, moved around and added
    support for "raw" delayed extents"]
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Darrick J. Wong
     
  • This allows the file system to tell a FIEMAP from a read operation, and thus
    avoids the need to report flags that aren't actually used in the read path.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Reviewed-by: Brian Foster
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • There is no clear division of responsibility between those functions, so
    just merge them into one to keep the code simple. Also move
    xfs_file_wait_for_io to xfs_reflink.c together with its only caller.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • filemap_write_and_wait_range operates on full pages, so there is no
    need for the rounding operations. Additionally this allows us to
    micro-optimize by skipping the second inode_dio_wait for a
    intra-file clone.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • We need the iolock protection to stabilizie the IS_SWAPFILE and
    IS_IMMUTABLE values, as well as preventing new buffered writers
    re-dirtying the file data that we just wrote out.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • The VFS i_ino is an unsigned long, while XFS inode numbers are 64-bit
    wide, so checking i_ino for equality could lead to rate false positives
    on 32-bit architectures. Just compare the inode pointers themselves
    to be safe.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Christoph Hellwig
     
  • The VFS already does the check, and the placement of this duplicate
    is in the way of the following locking rework.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Darrick J. Wong
    Signed-off-by: Dave Chinner

    Christoph Hellwig