1. 04 12月, 2019 1 次提交
    • S
      smb3: query attributes on file close · 43f8a6a7
      Steve French 提交于
      Since timestamps on files on most servers can be updated at
      close, and since timestamps on our dentries default to one
      second we can have stale timestamps in some common cases
      (e.g. open, write, close, stat, wait one second, stat - will
      show different mtime for the first and second stat).
      
      The SMB2/SMB3 protocol allows querying timestamps at close
      so add the code to request timestamp and attr information
      (which is cheap for the server to provide) to be returned
      when a file is closed (it is not needed for the many
      paths that call SMB2_close that are from compounded
      query infos and close nor is it needed for some of
      the cases where a directory close immediately follows a
      directory open.
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Acked-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      43f8a6a7
  2. 03 12月, 2019 4 次提交
  3. 28 11月, 2019 1 次提交
  4. 27 11月, 2019 8 次提交
    • J
      io_uring: make poll->wait dynamically allocated · e944475e
      Jens Axboe 提交于
      In the quest to bring io_kiocb down to 3 cachelines, this one does
      the trick. Make the wait_queue_entry for the poll command come out
      of kmalloc instead of embedding it in struct io_poll_iocb, as the
      latter is the largest member of io_kiocb. Once we trim this down a
      bit, we're back at a healthy 192 bytes for struct io_kiocb.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e944475e
    • J
      io-wq: shrink io_wq_work a bit · 6206f0e1
      Jens Axboe 提交于
      Currently we're using 40 bytes for the io_wq_work structure, and 16 of
      those is the doubly link list node. We don't need doubly linked lists,
      we always add to tail to keep things ordered, and any other use case
      is list traversal with deletion. For the deletion case, we can easily
      support any node deletion by keeping track of the previous entry.
      
      This shrinks io_wq_work to 32 bytes, and subsequently io_kiock from
      io_uring to 216 to 208 bytes.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      6206f0e1
    • J
      io-wq: fix handling of NUMA node IDs · 3fc50ab5
      Jann Horn 提交于
      There are several things that can go wrong in the current code on NUMA
      systems, especially if not all nodes are online all the time:
      
       - If the identifiers of the online nodes do not form a single contiguous
         block starting at zero, wq->wqes will be too small, and OOB memory
         accesses will occur e.g. in the loop in io_wq_create().
       - If a node comes online between the call to num_online_nodes() and the
         for_each_node() loop in io_wq_create(), an OOB write will occur.
       - If a node comes online between io_wq_create() and io_wq_enqueue(), a
         lookup is performed for an element that doesn't exist, and an OOB read
         will probably occur.
      
      Fix it by:
      
       - using nr_node_ids instead of num_online_nodes() for the allocation size;
         nr_node_ids is calculated by setup_nr_node_ids() to be bigger than the
         highest node ID that could possibly come online at some point, even if
         those nodes' identifiers are not a contiguous block
       - creating workers for all possible CPUs, not just all online ones
      
      This is basically what the normal workqueue code also does, as far as I can
      tell.
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      3fc50ab5
    • J
      io_uring: use kzalloc instead of kcalloc for single-element allocations · ad6e005c
      Jann Horn 提交于
      These allocations are single-element allocations, so don't use the array
      allocation wrapper for them.
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ad6e005c
    • P
      io_uring: cleanup io_import_fixed() · 7d009165
      Pavel Begunkov 提交于
      Clean io_import_fixed() call site and make it return proper type.
      Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7d009165
    • P
      io_uring: inline struct sqe_submit · cf6fd4bd
      Pavel Begunkov 提交于
      There is no point left in keeping struct sqe_submit. Inline it
      into struct io_kiocb, so any req->submit.field is now just req->field
      
      - moves initialisation of ring_file into io_get_req()
      - removes duplicated req->sequence.
      Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      cf6fd4bd
    • P
      io_uring: store timeout's sqe->off in proper place · cc42e0ac
      Pavel Begunkov 提交于
      Timeouts' sequence offset (i.e. sqe->off) is stored in
      req->submit.sequence under a false name. Keep it in timeout.data
      instead. The unused space for sequence will be reclaimed in the
      following patches.
      Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      cc42e0ac
    • L
      Revert "vfs: properly and reliably lock f_pos in fdget_pos()" · 2be7d348
      Linus Torvalds 提交于
      This reverts commit 0be0ee71.
      
      I was hoping it would be benign to switch over entirely to FMODE_STREAM,
      and we'd have just a couple of small fixups we'd need, but it looks like
      we're not quite there yet.
      
      While it worked fine on both my desktop and laptop, they are fairly
      similar in other respects, and run mostly the same loads.  Kenneth
      Crudup reports that it seems to break both his vmware installation and
      the KDE upower service.  In both cases apparently leading to timeouts
      due to waitinmg for the f_pos lock.
      
      There are a number of character devices in particular that definitely
      want stream-like behavior, but that currently don't get marked as
      streams, and as a result get the exclusion between concurrent
      read()/write() on the same file descriptor.  Which doesn't work well for
      them.
      
      The most obvious example if this is /dev/console and /dev/tty, which use
      console_fops and tty_fops respectively (and ptmx_fops for the pty master
      side).  It may be that it's just this that causes problems, but we
      clearly weren't ready yet.
      
      Because there's a number of other likely common cases that don't have
      llseek implementations and would seem to act as stream devices:
      
        /dev/fuse		(fuse_dev_operations)
        /dev/mcelog		(mce_chrdev_ops)
        /dev/mei0		(mei_fops)
        /dev/net/tun		(tun_fops)
        /dev/nvme0		(nvme_dev_fops)
        /dev/tpm0		(tpm_fops)
        /proc/self/ns/mnt	(ns_file_operations)
        /dev/snd/pcm*		(snd_pcm_f_ops[])
      
      and while some of these could be trivially automatically detected by the
      vfs layer when the character device is opened by just noticing that they
      have no read or write operations either, it often isn't that obvious.
      
      Some character devices most definitely do use the file position, even if
      they don't allow seeking: the firmware update code, for example, uses
      simple_read_from_buffer() that does use f_pos, but doesn't allow seeking
      back and forth.
      
      We'll revisit this when there's a better way to detect the problem and
      fix it (possibly with a coccinelle script to do more of the FMODE_STREAM
      annotations).
      Reported-by: NKenneth R. Crudup <kenny@panix.com>
      Cc: Kirill Smelkov <kirr@nexedi.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2be7d348
  5. 26 11月, 2019 26 次提交