15 Jul, 2013

1 commit

  • Pull more vfs stuff from Al Viro:
    "O_TMPFILE ABI changes, Oleg's fput() series, misc cleanups, including
    making simple_lookup() usable for filesystems with non-NULL s_d_op,
    which allows us to get rid of quite a bit of ugliness"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    sunrpc: now we can just set ->s_d_op
    cgroup: we can use simple_lookup() now
    efivarfs: we can use simple_lookup() now
    make simple_lookup() usable for filesystems that set ->s_d_op
    configfs: don't open-code d_alloc_name()
    __rpc_lookup_create_exclusive: pass string instead of qstr
    rpc_create_*_dir: don't bother with qstr
    llist: llist_add() can use llist_add_batch()
    llist: fix/simplify llist_add() and llist_add_batch()
    fput: turn "list_head delayed_fput_list" into llist_head
    fs/file_table.c:fput(): add comment
    Safer ABI for O_TMPFILE

    Linus Torvalds
     

14 Jul, 2013

6 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • Pull networking fixes from David Miller:
    "Just a bunch of small fixes and tidy ups:

    1) Finish the "busy_poll" renames, from Eliezer Tamir.

    2) Fix RCU stalls in IFB driver, from Ding Tianhong.

    3) Linearize buffers properly in tun/macvtap zerocopy code.

    4) Don't crash on rmmod in vxlan, from Pravin B Shelar.

    5) Spinlock used before init in alx driver, from Maarten Lankhorst.

    6) A sparse warning fix in bnx2x broke TSO checksums, fix from Dmitry
    Kravkov.

    7) Dummy and ifb driver load failure paths can oops, fixes from Tan
    Xiaojun and Ding Tianhong.

    8) Correct MTU calculations in IP tunnels, from Alexander Duyck.

    9) Account all TCP retransmits in SNMP stats properly, from Yuchung
    Cheng.

    10) atl1e and via-rhine do not handle DMA mapping failures properly,
    from Neil Horman.

    11) Various equal-cost multipath route fixes in ipv6 from Hannes
    Frederic Sowa"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (36 commits)
    ipv6: only static routes qualify for equal cost multipathing
    via-rhine: fix dma mapping errors
    atl1e: fix dma mapping warnings
    tcp: account all retransmit failures
    usb/net/r815x: fix cast to restricted __le32
    usb/net/r8152: fix integer overflow in expression
    net: access page->private by using page_private
    net: strict_strtoul is obsolete, use kstrtoul instead
    drivers/net/ieee802154: don't use devm_pinctrl_get_select_default() in probe
    drivers/net/ethernet/cadence: don't use devm_pinctrl_get_select_default() in probe
    drivers/net/can/c_can: don't use devm_pinctrl_get_select_default() in probe
    net/usb: add relative mii functions for r815x
    net/tipc: use %*phC to dump small buffers in hex form
    qlcnic: Adding Maintainers.
    gre: Fix MTU sizing check for gretap tunnels
    pkt_sched: sch_qfq: remove forward declaration of qfq_update_agg_ts
    pkt_sched: sch_qfq: improve efficiency of make_eligible
    gso: Update tunnel segmentation to support Tx checksum offload
    inet: fix spacing in assignment
    ifb: fix oops when loading the ifb failed
    ...

    Linus Torvalds
     
  • Pull more xfs updates from Ben Myers:
    "Here are a fix for xfs_fsr, a cleanup in bulkstat, a cleanup in
    xfs_open_by_handle, updated mount options documentation, a cleanup in
    xfs_bmapi_write, a fix for the size of dquot log reservations, a fix
    for sgid inheritance when acls are in use, a fix for cleaning up
    quotainfo structures, and some more of the work which allows group and
    project quotas to be used together.

    We had a few more in this last quota category that we might have liked
    to get in, but it looks there are still a few items that need to be
    addressed.

    - fix for xfs_fsr returning -EINVAL
    - cleanup in xfs_bulkstat
    - cleanup in xfs_open_by_handle
    - update mount options documentation
    - clean up local format handling in xfs_bmapi_write
    - fix dquot log reservations which were too small
    - fix sgid inheritance for subdirectories when default acls are in use
    - add project quota fields to various structures
    - fix teardown of quotainfo structures when quotas are turned off"

    * tag 'for-linus-v3.11-rc1-2' of git://oss.sgi.com/xfs/xfs:
    xfs: Fix the logic check for all quotas being turned off
    xfs: Add pquota fields where gquota is used.
    xfs: fix sgid inheritance for subdirectories inheriting default acls [V3]
    xfs: dquot log reservations are too small
    xfs: remove local fork format handling from xfs_bmapi_write()
    xfs: update mount options documentation
    xfs: use get_unused_fd_flags(0) instead of get_unused_fd()
    xfs: clean up unused codes at xfs_bulkstat()
    xfs: use XFS_BMAP_BMDR_SPACE vs. XFS_BROOT_SIZE_ADJ

    Linus Torvalds
     
  • Pull cifs fixes from Steve French:
    "Fixes for 4 cifs bugs, including a reconnect problem, a problem
    parsing responses to SMB2 open request, and setting nlink incorrectly
    to some servers which don't report it properly on the wire. Also
    improves data integrity on reconnect with series from Pavel which adds
    durable handle support for SMB2."

    * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
    CIFS: Fix a deadlock when a file is reopened
    CIFS: Reopen the file if reconnect durable handle failed
    [CIFS] Fix minor endian error in durable handle patch series
    CIFS: Reconnect durable handles for SMB2
    CIFS: Make SMB2_open use cifs_open_parms struct
    CIFS: Introduce cifs_open_parms struct
    CIFS: Request durable open for SMB2 opens
    CIFS: Simplify SMB2 create context handling
    CIFS: Simplify SMB2_open code path
    CIFS: Respect create_options in smb2_open_file
    CIFS: Fix lease context buffer parsing
    [CIFS] use sensible file nlink values if unprovided
    Limit allocation of crypto mechanisms to dialect which requires

    Linus Torvalds
     

13 Jul, 2013

3 commits

  • fput() and delayed_fput() can use llist and avoid the locking.

    This is unlikely path, it is not that this change can improve
    the performance, but this way the code looks simpler.

    Signed-off-by: Oleg Nesterov
    Suggested-by: Andrew Morton
    Cc: Al Viro
    Cc: Andrey Vagin
    Cc: "Eric W. Biederman"
    Cc: David Howells
    Cc: Huang Ying
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Oleg Nesterov
     
  • A missed update to "fput: task_work_add() can fail if the caller has
    passed exit_task_work()".

    Cc: "Eric W. Biederman"
    Cc: Al Viro
    Cc: Andrey Vagin
    Cc: David Howells
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Andrew Morton
     
  • [suggested by Rasmus Villemoes] make O_DIRECTORY | O_RDWR part of O_TMPFILE;
    that will fail on old kernels in a lot more cases than what I came up with.
    And make sure O_CREAT doesn't get there...

    Signed-off-by: Al Viro

    Al Viro
     

12 Jul, 2013

9 commits

  • If we request reading or writing on a file that needs to be
    reopened, it causes the deadlock: we are already holding rw
    semaphore for reading and then we try to acquire it for writing
    in cifs_relock_file. Fix this by acquiring the semaphore for
    reading in cifs_relock_file due to we don't make any changes in
    locks and don't need a write access.

    CC:
    Signed-off-by: Pavel Shilovsky
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Pavel Shilovsky
     
  • This is a follow-on patch for 8/8 patch from the durable handles
    series. It fixes the problem when durable file handle timeout
    expired on the server and reopen returns -ENOENT for such files.
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Pavel Shilovsky
     
  • During the review of seperate pquota inode patches, David noticed
    that the test to detect all quotas being turned off was
    incorrect, and hence the block was not freeing all the quota
    information.

    The check made sense in Irix, but in Linux, quota is turned off
    one at a time, which makes the test invalid for Linux.

    This problem existed since XFS was ported to Linux.

    David suggested to fix the problem by detecting when all quotas are
    turned off by checking m_qflags.

    Signed-off-by: Chandra Seetharaman
    Reviewed-by: Ben Myers
    Signed-off-by: Ben Myers

    Chandra Seetharaman
     
  • Pull core block IO updates from Jens Axboe:
    "Here are the core IO block bits for 3.11. It contains:

    - A tweak to the reserved tag logic from Jan, for weirdo devices with
    just 3 free tags. But for those it improves things substantially
    for random writes.

    - Periodic writeback fix from Jan. Marked for stable as well.

    - Fix for a race condition in IO scheduler switching from Jianpeng.

    - The hierarchical blk-cgroup support from Tejun. This is the grunt
    of the series.

    - blk-throttle fix from Vivek.

    Just a note that I'm in the middle of a relocation, whole family is
    flying out tomorrow. Hence I will be awal the remainder of this week,
    but back at work again on Monday the 15th. CC'ing Tejun, since any
    potential "surprises" will most likely be from the blk-cgroup work.
    But it's been brewing for a while and sitting in my tree and
    linux-next for a long time, so should be solid."

    * 'for-3.11/core' of git://git.kernel.dk/linux-block: (36 commits)
    elevator: Fix a race in elevator switching
    block: Reserve only one queue tag for sync IO if only 3 tags are available
    writeback: Fix periodic writeback after fs mount
    blk-throttle: implement proper hierarchy support
    blk-throttle: implement throtl_grp->has_rules[]
    blk-throttle: Account for child group's start time in parent while bio climbs up
    blk-throttle: add throtl_qnode for dispatch fairness
    blk-throttle: make throtl_pending_timer_fn() ready for hierarchy
    blk-throttle: make tg_dispatch_one_bio() ready for hierarchy
    blk-throttle: make blk_throtl_bio() ready for hierarchy
    blk-throttle: make blk_throtl_drain() ready for hierarchy
    blk-throttle: dispatch from throtl_pending_timer_fn()
    blk-throttle: implement dispatch looping
    blk-throttle: separate out throtl_service_queue->pending_timer from throtl_data->dispatch_work
    blk-throttle: set REQ_THROTTLED from throtl_charge_bio() and gate stats update with it
    blk-throttle: implement sq_to_tg(), sq_to_td() and throtl_log()
    blk-throttle: add throtl_service_queue->parent_sq
    blk-throttle: generalize update_disptime optimization in blk_throtl_bio()
    blk-throttle: dispatch to throtl_data->service_queue.bio_lists[]
    blk-throttle: move bio_lists[] and friends to throtl_service_queue
    ...

    Linus Torvalds
     
  • Pull second set of NFS client updates from Trond Myklebust:
    "This mainly contains some small readdir optimisations that had
    dependencies on Al Viro's readdir rewrite. There is also a fix for a
    nasty deadlock which surfaced earlier in this merge window.

    Highlights include:
    - Fix an_rpc pipefs regression that causes a deadlock on mount
    - Readdir optimisations by Scott Mayhew and Jeff Layton
    - clean up the rpc_pipefs dentry operation setup"

    * tag 'nfs-for-3.11-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    SUNRPC: Fix a deadlock in rpc_client_register()
    rpc_pipe: rpc_dir_inode_operations can be static
    NFS: Allow nfs_updatepage to extend a write under additional circumstances
    NFS: Make nfs_readdir revalidate less often
    NFS: Make nfs_attribute_cache_expired() non-static
    rpc_pipe: set dentry operations at d_alloc time
    nfs: set verifier on existing dentries in nfs_prime_dcache

    Linus Torvalds
     
  • …inux/kernel/git/ericvh/v9fs

    Pull second round of 9p patches from Eric Van Hensbergen:
    "Several of these patches were rebased in order to correct style
    issues. Only stylistic changes were made versus the patches which
    were in linux-next for two weeks. The rebases have been in linux-next
    for 3 days and have passed my regressions.

    The bulk of these are RDMA fixes and improvements. There's also some
    additions on the extended attributes front to support some additional
    namespaces and a new option for TCP to force allocation of mount
    requests from a priviledged port"

    * tag 'for-linus-3.11-merge-window-part-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    fs/9p: Remove the unused variable "err" in v9fs_vfs_getattr()
    9P: Add cancelled() to the transport functions.
    9P/RDMA: count posted buffers without a pending request
    9P/RDMA: Improve error handling in rdma_request
    9P/RDMA: Do not free req->rc in error handling in rdma_request()
    9P/RDMA: Use a semaphore to protect the RQ
    9P/RDMA: Protect against duplicate replies
    9P/RDMA: increase P9_RDMA_MAXSIZE to 1MB
    9pnet: refactor struct p9_fcall alloc code
    9P/RDMA: rdma_request() needs not allocate req->rc
    9P: Fix fcall allocation for rdma
    fs/9p: xattr: add trusted and security namespaces
    net/9p: add privport option to 9p tcp transport

    Linus Torvalds
     
  • …el/git/tyhicks/ecryptfs

    Pull eCryptfs updates from Tyler Hicks:
    "Code cleanups and improved buffer handling during page crypto
    operations:
    - Remove redundant code by merging some encrypt and decrypt functions
    - Get rid of a helper page allocation during page decryption by using
    in-place decryption
    - Better use of entire pages during page crypto operations
    - Several code cleanups"

    * tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
    Use ecryptfs_dentry_to_lower_path in a couple of places
    eCryptfs: Make extent and scatterlist crypt function parameters similar
    eCryptfs: Collapse crypt_page_offset() into crypt_extent()
    eCryptfs: Merge ecryptfs_encrypt_extent() and ecryptfs_decrypt_extent()
    eCryptfs: Combine page_offset crypto functions
    eCryptfs: Combine encrypt_scatterlist() and decrypt_scatterlist()
    eCryptfs: Decrypt pages in-place
    eCryptfs: Accept one offset parameter in page offset crypto functions
    eCryptfs: Simplify lower file offset calculation
    eCryptfs: Read/write entire page during page IO
    eCryptfs: Use entire helper page during page crypto operations
    eCryptfs: Cocci spatch "memdup.spatch"

    Linus Torvalds
     
  • Pull jfs update from Dave Kleikamp:
    "A couple cleanups to JFS for 3.11"

    * tag 'jfs-3.11' of git://github.com/kleikamp/linux-shaggy:
    jfs: Update jfs_error
    jfs: fix sparse warning in fs/jfs/xattr.c

    Linus Torvalds
     
  • Pull nfsd changes from Bruce Fields:
    "Changes this time include:

    - 4.1 enabled on the server by default: the last 4.1-specific issues
    I know of are fixed, so we're not going to find the rest of the
    bugs without more exposure.
    - Experimental support for NFSv4.2 MAC Labeling (to allow running
    selinux over NFS), from Dave Quigley.
    - Fixes for some delicate cache/upcall races that could cause rare
    server hangs; thanks to Neil Brown and Bodo Stroesser for extreme
    debugging persistence.
    - Fixes for some bugs found at the recent NFS bakeathon, mostly v4
    and v4.1-specific, but also a generic bug handling fragmented rpc
    calls"

    * 'for-3.11' of git://linux-nfs.org/~bfields/linux: (31 commits)
    nfsd4: support minorversion 1 by default
    nfsd4: allow destroy_session over destroyed session
    svcrpc: fix failures to handle -1 uid's
    sunrpc: Don't schedule an upcall on a replaced cache entry.
    net/sunrpc: xpt_auth_cache should be ignored when expired.
    sunrpc/cache: ensure items removed from cache do not have pending upcalls.
    sunrpc/cache: use cache_fresh_unlocked consistently and correctly.
    sunrpc/cache: remove races with queuing an upcall.
    nfsd4: return delegation immediately if lease fails
    nfsd4: do not throw away 4.1 lock state on last unlock
    nfsd4: delegation-based open reclaims should bypass permissions
    svcrpc: don't error out on small tcp fragment
    svcrpc: fix handling of too-short rpc's
    nfsd4: minor read_buf cleanup
    nfsd4: fix decoding of compounds across page boundaries
    nfsd4: clean up nfs4_open_delegation
    NFSD: Don't give out read delegations on creates
    nfsd4: allow client to send no cb_sec flavors
    nfsd4: fail attempts to request gss on the backchannel
    nfsd4: implement minimal SP4_MACH_CRED
    ...

    Linus Torvalds
     

11 Jul, 2013

12 commits


10 Jul, 2013

9 commits

  • XFS removes sgid bits of subdirectories under a directory containing a default
    acl.

    When a default acl is set, it implies xfs to call xfs_setattr_nonsize() in its
    code path. Such function is shared among mkdir and chmod system calls, and
    does some checks unneeded by mkdir (calling inode_change_ok()). Such checks
    remove sgid bit from the inode after it has been granted.

    With this patch, we extend the meaning of XFS_ATTR_NOACL flag to avoid these
    checks when acls are being inherited (thanks hch).

    Also, xfs_setattr_mode, doesn't need to re-check for group id and capabilities
    permissions, this only implies in another try to remove sgid bit from the
    directories. Such check is already done either on inode_change_ok() or
    xfs_setattr_nonsize().

    Changelog:

    V2: Extends the meaning of XFS_ATTR_NOACL instead of wrap the tests into another
    function

    V3: Remove S_ISDIR check in xfs_setattr_nonsize() from the patch

    Signed-off-by: Carlos Maiolino
    Reviewed-by: Ben Myers
    Signed-off-by: Ben Myers

    Carlos Maiolino
     
  • There are two places in ecryptfs that benefit from using
    ecryptfs_dentry_to_lower_path() instead of separate calls to
    ecryptfs_dentry_to_lower() and ecryptfs_dentry_to_lower_mnt(). Both
    sites use fewer instructions and less stack (determined by examining
    objdump output).

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Tyler Hicks

    Matthew Wilcox
     
  • Pull networking updates from David Miller:
    "This is a re-do of the net-next pull request for the current merge
    window. The only difference from the one I made the other day is that
    this has Eliezer's interface renames and the timeout handling changes
    made based upon your feedback, as well as a few bug fixes that have
    trickeled in.

    Highlights:

    1) Low latency device polling, eliminating the cost of interrupt
    handling and context switches. Allows direct polling of a network
    device from socket operations, such as recvmsg() and poll().

    Currently ixgbe, mlx4, and bnx2x support this feature.

    Full high level description, performance numbers, and design in
    commit 0a4db187a999 ("Merge branch 'll_poll'")

    From Eliezer Tamir.

    2) With the routing cache removed, ip_check_mc_rcu() gets exercised
    more than ever before in the case where we have lots of multicast
    addresses. Use a hash table instead of a simple linked list, from
    Eric Dumazet.

    3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
    Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
    Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

    4) Support reporting the TUN device persist flag to userspace, from
    Pavel Emelyanov.

    5) Allow controlling network device VF link state using netlink, from
    Rony Efraim.

    6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

    7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
    Daniel Borkmann and Eric Dumazet.

    8) Allow controlling of TCP quickack behavior on a per-route basis,
    from Cong Wang.

    9) Several bug fixes and improvements to vxlan from Stephen
    Hemminger, Pravin B Shelar, and Mike Rapoport. In particular,
    support receiving on multiple UDP ports.

    10) Major cleanups, particular in the area of debugging and cookie
    lifetime handline, to the SCTP protocol code. From Daniel
    Borkmann.

    11) Allow packets to cross network namespaces when traversing tunnel
    devices. From Nicolas Dichtel.

    12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
    manner akin to how we monitor real network traffic via ptype_all.
    From Daniel Borkmann.

    13) Several bug fixes and improvements for the new alx device driver,
    from Johannes Berg.

    14) Fix scalability issues in the netem packet scheduler's time queue,
    by using an rbtree. From Eric Dumazet.

    15) Several bug fixes in TCP loss recovery handling, from Yuchung
    Cheng.

    16) Add support for GSO segmentation of MPLS packets, from Simon
    Horman.

    17) Make network notifiers have a real data type for the opaque
    pointer that's passed into them. Use this to properly handle
    network device flag changes in arp_netdev_event(). From Jiri
    Pirko and Timo Teräs.

    18) Convert several drivers over to module_pci_driver(), from Peter
    Huewe.

    19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
    O(1) calculation instead. From Eric Dumazet.

    20) Support setting of explicit tunnel peer addresses in ipv6, just
    like ipv4. From Nicolas Dichtel.

    21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

    22) Prevent a single high rate flow from overruning an individual cpu
    during RX packet processing via selective flow shedding. From
    Willem de Bruijn.

    23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
    Dumazet.

    24) Don't just drop GSO packets which are above the TBF scheduler's
    burst limit, chop them up so they are in-bounds instead. Also
    from Eric Dumazet.

    25) VLAN offloads are missed when configured on top of a bridge, fix
    from Vlad Yasevich.

    26) Support IPV6 in ping sockets. From Lorenzo Colitti.

    27) Receive flow steering targets should be updated at poll() time
    too, from David Majnemer.

    28) Fix several corner case regressions in PMTU/redirect handling due
    to the routing cache removal, from Timo Teräs.

    29) We have to be mindful of ipv4 mapped ipv6 sockets in
    upd_v6_push_pending_frames(). From Hannes Frederic Sowa.

    30) Fix L2TP sequence number handling bugs, from James Chapman."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
    drivers/net: caif: fix wrong rtnl_is_locked() usage
    drivers/net: enic: release rtnl_lock on error-path
    vhost-net: fix use-after-free in vhost_net_flush
    net: mv643xx_eth: do not use port number as platform device id
    net: sctp: confirm route during forward progress
    virtio_net: fix race in RX VQ processing
    virtio: support unlocked queue poll
    net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
    Documentation: Fix references to defunct linux-net@vger.kernel.org
    net/fs: change busy poll time accounting
    net: rename low latency sockets functions to busy poll
    bridge: fix some kernel warning in multicast timer
    sfc: Fix memory leak when discarding scattered packets
    sit: fix tunnel update via netlink
    dt:net:stmmac: Add dt specific phy reset callback support.
    dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
    dt:net:stmmac: Allocate platform data only if its NULL.
    net:stmmac: fix memleak in the open method
    ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
    net: ipv6: fix wrong ping_v6_sendmsg return value
    ...

    Linus Torvalds
     
  • Currently nfs_updatepage allows a write to be extended to cover a full
    page only if we don't have a byte range lock lock on the file... but if
    we have a write delegation on the file or if we have the whole file
    locked for writing then we should be allowed to extend the write as
    well.

    Signed-off-by: Scott Mayhew
    [Trond: fix up call to nfs_have_delegation()]
    Signed-off-by: Trond Myklebust

    Scott Mayhew
     
  • During review of the separate project quota inode patches, it became
    obvious that the dquot log reservation calculation underestimated
    the number dquots that can be modified in a transaction. This has
    it's roots way back in the Irix quota implementation.

    That is, when quotas were first implemented in XFS, it only
    supported user and project quotas as Irix did not have group quotas.
    Hence the worst case operation involving dquot modification was
    calculated to involve 2 user dquots and 1 project dquot or 1 user
    dequot and 2 project dquots. i.e. 3 dquots. This was determined back
    in 1996, and has remained unchanged ever since.

    However, back in 2001, the Linux XFS port dropped all support for
    project quota and implmented group quotas over the top. This was
    effectively done with a search-and-replace of project with group,
    and as such the log reservation was not changed. However, with the
    advent of group quotas, chmod and rename now could modify more than
    3 dquots in a single transaction - both could modify 4 dquots. Hence
    this log reservation has been wrong for a long time.

    In 2005, project quota support was reintroduced into Linux, but it
    was implemented to be mutually exclusive to group quotas and so this
    didn't add any new changes to the dquot log reservation. Hence when
    project quotas were in use (rather than group quotas) the log
    reservation was again valid, just like in the Irix days.

    Now, with the addition of the separate project quota inode, group
    and project quotas are no longer mutually exclusive, and hence
    operations can now modify three dquots per inode where previously it
    was only two. The worst case here is the rename transaction, which
    can allocate/free space on two different directory inodes, and if
    they have different uid/gid/prid configurations and are world
    writeable, then rename can actually modify 6 different dquots now.

    Further, the dquot log reservation doesn't take into account the
    space used by the dquot log format structure that precedes the dquot
    that is logged, and hence further underestimates the worst case
    log space required by dquots during a transaction. This has been
    missing since the first commit in 1996.

    Hence the worst case log reservation needs to be increased from 3 to
    6, and it needs to take into account a log format header for each of
    those dquots.

    Signed-off-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Dave Chinner
     
  • The conversion from local format to extent format requires
    interpretation of the data in the fork being converted, so it cannot
    be done in a generic way. It is up to the caller to convert the fork
    format to extent format before calling into xfs_bmapi_write() so
    format conversion can be done correctly.

    The code in xfs_bmapi_write() to convert the format is used
    implicitly by the attribute and directory code, but they
    specifically zero the fork size so that the conversion does not do
    any allocation or manipulation. Move this conversion into the
    shortform to leaf functions for the dir/attr code so the conversions
    are explicitly controlled by all callers.

    Now we can remove the conversion code in xfs_bmapi_write.

    Signed-off-by: Dave Chinner
    Reviewed-by: Mark Tinguely
    Signed-off-by: Ben Myers

    Dave Chinner
     
  • Make nfs_readdir revalidate only when we're at the beginning of the directory or
    if the cached attributes have expired.

    Signed-off-by: Scott Mayhew
    Signed-off-by: Trond Myklebust

    Scott Mayhew
     
  • NFS: Make nfs_attribute_cache_expired() non-static so we can call it from
    nfs_readdir().

    Signed-off-by: Scott Mayhew
    Signed-off-by: Trond Myklebust

    Scott Mayhew
     
  • nfs_prime_dcache currently only sets the verifier when it doesn't
    initially a matching dentry in the dcache. Set the verifier in the case
    where we do find a dentry in the dcache. This ensures that we don't
    have to look up the dentry again if we want to use it after a readdir.

    Cc: Scott Mayhew
    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton