1. 18 12月, 2019 8 次提交
  2. 16 12月, 2019 2 次提交
  3. 12 12月, 2019 6 次提交
    • J
      io_uring: ensure we return -EINVAL on unknown opcode · 9e3aa61a
      Jens Axboe 提交于
      If we submit an unknown opcode and have fd == -1, io_op_needs_file()
      will return true as we default to needing a file. Then when we go and
      assign the file, we find the 'fd' invalid and return -EBADF. We really
      should be returning -EINVAL for that case, as we normally do for
      unsupported opcodes.
      
      Change io_op_needs_file() to have the following return values:
      
      0   - does not need a file
      1   - does need a file
      < 0 - error value
      
      and use this to pass back the right value for this invalid case.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      9e3aa61a
    • L
      pipe: simplify signal handling in pipe_read() and add comments · d1c6a2aa
      Linus Torvalds 提交于
      There's no need to separately check for signals while inside the locked
      region, since we're going to do "wait_event_interruptible()" right
      afterwards anyway, and the error handling is much simpler there.
      
      The check for whether we had already read anything was also redundant,
      since we no longer do the odd merging of reads when there are pending
      writers.
      
      But perhaps more importantly, this adds commentary about why we still
      need to wake up possible writers even though we didn't read any data,
      and why we can skip all the finishing touches now if we get a signal (or
      had a signal pending) while waiting for more data.
      
      [ This is a split-out cleanup from my "make pipe IO use exclusive wait
        queues" thing, which I can't apply because it triggers a nasty bug in
        the GNU make jobserver   - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d1c6a2aa
    • D
      afs: Show volume name in /proc/net/afs/<cell>/volumes · 50559800
      David Howells 提交于
      Show the name of each volume in /proc/net/afs/<cell>/volumes to make it
      easier to work out the name corresponding to a volume ID.  This makes it
      easier to work out which mounts in /proc/mounts correspond to which volume
      ID.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NMarc Dionne <marc.dionne@auristor.com>
      50559800
    • D
      afs: Fix missing cell comparison in afs_test_super() · 106bc798
      David Howells 提交于
      Fix missing cell comparison in afs_test_super().  Without this, any pair
      volumes that have the same volume ID will share a superblock, no matter the
      cell, unless they're in different network namespaces.
      
      Normally, most users will only deal with a single cell and so they won't
      see this.  Even if they do look into a second cell, they won't see a
      problem unless they happen to hit a volume with the same ID as one they've
      already got mounted.
      
      Before the patch:
      
          # ls /afs/grand.central.org/archive
          linuxdev/  mailman/  moin/  mysql/  pipermail/  stage/  twiki/
          # ls /afs/kth.se/
          linuxdev/  mailman/  moin/  mysql/  pipermail/  stage/  twiki/
          # cat /proc/mounts | grep afs
          none /afs afs rw,relatime,dyn,autocell 0 0
          #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
          #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
          #grand.central.org:root.archive /afs/kth.se afs ro,relatime 0 0
      
      After the patch:
      
          # ls /afs/grand.central.org/archive
          linuxdev/  mailman/  moin/  mysql/  pipermail/  stage/  twiki/
          # ls /afs/kth.se/
          admin/        common/  install/  OldFiles/  service/  system/
          bakrestores/  home/    misc/     pkg/       src/      wsadmin/
          # cat /proc/mounts | grep afs
          none /afs afs rw,relatime,dyn,autocell 0 0
          #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
          #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
          #kth.se:root.cell /afs/kth.se afs ro,relatime 0 0
      
      Fixes: ^1da177e4 ("Linux-2.6.12-rc2")
      Reported-by: NCarsten Jacobi <jacobi@de.ibm.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NMarc Dionne <marc.dionne@auristor.com>
      Tested-by: NJonathan Billings <jsbillings@jsbillings.org>
      cc: Todd DeSantis <atd@us.ibm.com>
      106bc798
    • D
      afs: Fix creation calls in the dynamic root to fail with EOPNOTSUPP · 1da4bd9f
      David Howells 提交于
      Fix the lookup method on the dynamic root directory such that creation
      calls, such as mkdir, open(O_CREAT), symlink, etc. fail with EOPNOTSUPP
      rather than failing with some odd error (such as EEXIST).
      
      lookup() itself tries to create automount directories when it is invoked.
      These are cached locally in RAM and not committed to storage.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NMarc Dionne <marc.dionne@auristor.com>
      Tested-by: NJonathan Billings <jsbillings@jsbillings.org>
      1da4bd9f
    • D
      afs: Fix mountpoint parsing · 158d5833
      David Howells 提交于
      Each AFS mountpoint has strings that define the target to be mounted.  This
      is required to end in a dot that is supposed to be stripped off.  The
      string can include suffixes of ".readonly" or ".backup" - which are
      supposed to come before the terminal dot.  To add to the confusion, the "fs
      lsmount" afs utility does not show the terminal dot when displaying the
      string.
      
      The kernel mount source string parser, however, assumes that the terminal
      dot marks the suffix and that the suffix is always "" and is thus ignored.
      In most cases, there is no suffix and this is not a problem - but if there
      is a suffix, it is lost and this affects the ability to mount the correct
      volume.
      
      The command line mount command, on the other hand, is expected not to
      include a terminal dot - so the problem doesn't arise there.
      
      Fix this by making sure that the dot exists and then stripping it when
      passing the string to the mount configuration.
      
      Fixes: bec5eb61 ("AFS: Implement an autocell mount capability [ver #2]")
      Reported-by: NJonathan Billings <jsbillings@jsbillings.org>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NMarc Dionne <marc.dionne@auristor.com>
      Tested-by: NJonathan Billings <jsbillings@jsbillings.org>
      158d5833
  4. 11 12月, 2019 9 次提交
  5. 10 12月, 2019 8 次提交
  6. 09 12月, 2019 1 次提交
    • M
      afs: Fix afs_find_server lookups for ipv4 peers · 9bd0160d
      Marc Dionne 提交于
      afs_find_server tries to find a server that has an address that
      matches the transport address of an rxrpc peer.  The code assumes
      that the transport address is always ipv6, with ipv4 represented
      as ipv4 mapped addresses, but that's not the case.  If the transport
      family is AF_INET, srx->transport.sin6.sin6_addr.s6_addr32[] will
      be beyond the actual ipv4 address and will always be 0, and all
      ipv4 addresses will be seen as matching.
      
      As a result, the first ipv4 address seen on any server will be
      considered a match, and the server returned may be the wrong one.
      
      One of the consequences is that callbacks received over ipv4 will
      only be correctly applied for the server that happens to have the
      first ipv4 address on the fs_addresses4 list.  Callbacks over ipv4
      from all other servers are dropped, causing the client to serve stale
      data.
      
      This is fixed by looking at the transport family, and comparing ipv4
      addresses based on a sockaddr_in structure rather than a sockaddr_in6.
      
      Fixes: d2ddc776 ("afs: Overhaul volume and server record caching and fileserver rotation")
      Signed-off-by: NMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      9bd0160d
  7. 08 12月, 2019 6 次提交
    • S
      smb3: improve check for when we send the security descriptor context on create · 231e2a0b
      Steve French 提交于
      We had cases in the previous patch where we were sending the security
      descriptor context on SMB3 open (file create) in cases when we hadn't
      mounted with with "modefromsid" mount option.
      
      Add check for that mount flag before calling ad_sd_context in
      open init.
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      231e2a0b
    • L
      pipe: don't use 'pipe_wait() for basic pipe IO · 85190d15
      Linus Torvalds 提交于
      pipe_wait() may be simple, but since it relies on the pipe lock, it
      means that we have to do the wakeup while holding the lock.  That's
      unfortunate, because the very first thing the waked entity will want to
      do is to get the pipe lock for itself.
      
      So get rid of the pipe_wait() usage by simply releasing the pipe lock,
      doing the wakeup (if required) and then using wait_event_interruptible()
      to wait on the right condition instead.
      
      wait_event_interruptible() handles races on its own by comparing the
      wakeup condition before and after adding itself to the wait queue, so
      you can use an optimistic unlocked condition for it.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      85190d15
    • L
      pipe: remove 'waiting_writers' merging logic · a28c8b9d
      Linus Torvalds 提交于
      This code is ancient, and goes back to when we only had a single page
      for the pipe buffers.  The exact history is hidden in the mists of time
      (ie "before git", and in fact predates the BK repository too).
      
      At that long-ago point in time, it actually helped to try to merge big
      back-and-forth pipe reads and writes, and not limit pipe reads to the
      single pipe buffer in length just because that was all we had at a time.
      
      However, since then we've expanded the pipe buffers to multiple pages,
      and this logic really doesn't seem to make sense.  And a lot of it is
      somewhat questionable (ie "hmm, the user asked for a non-blocking read,
      but we see that there's a writer pending, so let's wait anyway to get
      the extra data that the writer will have").
      
      But more importantly, it makes the "go to sleep" logic much less
      obvious, and considering the wakeup issues we've had, I want to make for
      less of those kinds of things.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a28c8b9d
    • L
      pipe: fix and clarify pipe read wakeup logic · f467a6a6
      Linus Torvalds 提交于
      This is the read side version of the previous commit: it simplifies the
      logic to only wake up waiting writers when necessary, and makes sure to
      use a synchronous wakeup.  This time not so much for GNU make jobserver
      reasons (that pipe never fills up), but simply to get the writer going
      quickly again.
      
      A bit less verbose commentary this time, if only because I assume that
      the write side commentary isn't going to be ignored if you touch this
      code.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f467a6a6
    • L
      pipe: fix and clarify pipe write wakeup logic · 1b6b26ae
      Linus Torvalds 提交于
      The pipe rework ends up having been extra painful, partly becaused of
      actual bugs with ordering and caching of the pipe state, but also
      because of subtle performance issues.
      
      In particular, the pipe rework caused the kernel build to inexplicably
      slow down.
      
      The reason turns out to be that the GNU make jobserver (which limits the
      parallelism of the build) uses a pipe to implement a "token" system: a
      parallel submake will read a character from the pipe to get the job
      token before starting a new job, and will write a character back to the
      pipe when it is done.  The overall job limit is thus easily controlled
      by just writing the appropriate number of initial token characters into
      the pipe.
      
      But to work well, that really means that the old behavior of write
      wakeups being synchronous (WF_SYNC) is very important - when the pipe
      writer wakes up a reader, we want the reader to actually get scheduled
      immediately.  Otherwise you lose the parallelism of the build.
      
      The pipe rework lost that synchronous wakeup on write, and we had
      clearly all forgotten the reasons and rules for it.
      
      This rewrites the pipe write wakeup logic to do the required Wsync
      wakeups, but also clarifies the logic and avoids extraneous wakeups.
      
      It also ends up addign a number of comments about what oit does and why,
      so that we hopefully don't end up forgetting about this next time we
      change this code.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1b6b26ae
    • L
      pipe: fix poll/select race introduced by the pipe rework · ad910e36
      Linus Torvalds 提交于
      The kernel wait queues have a basic rule to them: you add yourself to
      the wait-queue first, and then you check the things that you're going to
      wait on.  That avoids the races with the event you're waiting for.
      
      The same goes for poll/select logic: the "poll_wait()" goes first, and
      then you check the things you're polling for.
      
      Of course, if you use locking, the ordering doesn't matter since the
      lock will serialize with anything that changes the state you're looking
      at. That's not the case here, though.
      
      So move the poll_wait() first in pipe_poll(), before you start looking
      at the pipe state.
      
      Fixes: 8cefc107 ("pipe: Use head and tail pointers for the ring, not cursor and length")
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ad910e36
新手
引导
客服 返回
顶部