1. 08 Jul, 2021 16 commits
  2. 29 Jun, 2021 3 commits
  3. 28 Jun, 2021 4 commits
    • Zhang Xiaoxu's avatar
      SUNRPC: Should wake up the privileged task firstly. · 5483b904
      Zhang Xiaoxu authored
      When find a task from wait queue to wake up, a non-privileged task may
      be found out, rather than the privileged. This maybe lead a deadlock
      same as commit dfe1fe75 ("NFSv4: Fix deadlock between nfs4_evict_inode()
      and nfs4_opendata_get_inode()"):
      
      Privileged delegreturn task is queued to privileged list because all
      the slots are assigned. If there has no enough slot to wake up the
      non-privileged batch tasks(session less than 8 slot), then the privileged
      delegreturn task maybe lost waked up because the found out task can't
      get slot since the session is on draining.
      
      So we should treate the privileged task as the emergency task, and
      execute it as for as we can.
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Fixes: 5fcdfacc ("NFSv4: Return delegations synchronously in evict_inode")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      5483b904
    • Zhang Xiaoxu's avatar
      SUNRPC: Fix the batch tasks count wraparound. · fcb170a9
      Zhang Xiaoxu authored
      The 'queue->nr' will wraparound from 0 to 255 when only current
      priority queue has tasks. This maybe lead a deadlock same as commit
      dfe1fe75 ("NFSv4: Fix deadlock between nfs4_evict_inode()
      and nfs4_opendata_get_inode()"):
      
      Privileged delegreturn task is queued to privileged list because all
      the slots are assigned. When non-privileged task complete and release
      the slot, a non-privileged maybe picked out. It maybe allocate slot
      failed when the session on draining.
      
      If the 'queue->nr' has wraparound to 255, and no enough slot to
      service it, then the privileged delegreturn will lost to wake up.
      
      So we should avoid the wraparound on 'queue->nr'.
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Fixes: 5fcdfacc ("NFSv4: Return delegations synchronously in evict_inode")
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      fcb170a9
    • Dave Wysochanski's avatar
      NFS: Remove unnecessary inode parameter from nfs_pageio_complete_read() · b42ad64f
      Dave Wysochanski authored
      Simplify nfs_pageio_complete_read() by using the inode pointer saved
      inside nfs_pageio_descriptor.
      Signed-off-by: default avatarDave Wysochanski <dwysocha@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      b42ad64f
    • Scott Mayhew's avatar
      nfs: update has_sec_mnt_opts after cloning lsm options from parent · eae00c5d
      Scott Mayhew authored
      After calling security_sb_clone_mnt_opts() in nfs_get_root(), it's
      necessary to copy the value of has_sec_mnt_opts from the cloned
      super_block's nfs_server.  Otherwise, calls to nfs_compare_super()
      using this super_block may not return the correct result, leading to
      mount failures.
      
      For example, mounting an nfs server with the following in /etc/exports:
      /export *(rw,insecure,crossmnt,no_root_squash,security_label)
      and having /export/scratch on a separate block device.
      
      mount -o v4.2,context=system_u:object_r:root_t:s0 server:/export/test /mnt/test
      mount -o v4.2,context=system_u:object_r:swapfile_t:s0 server:/export/scratch /mnt/scratch
      
      The second mount would fail with "mount.nfs: /mnt/scratch is busy or
      already mounted or sharecache fail" and "SELinux: mount invalid.  Same
      superblock, different security settings for..." would appear in the
      syslog.
      
      Also while we're in there, replace several instances of "NFS_SB(s)"
      with "server", which was already declared at the top of the
      nfs_get_root().
      
      Fixes: ec1ade6a ("nfs: account for selinux security context when deciding to share superblock")
      Signed-off-by: default avatarScott Mayhew <smayhew@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      eae00c5d
  4. 26 Jun, 2021 3 commits
  5. 21 Jun, 2021 3 commits
  6. 13 Jun, 2021 10 commits
  7. 12 Jun, 2021 1 commit