1. 15 Oct, 2020 1 commit
  2. 13 Oct, 2020 1 commit
  3. 12 Oct, 2020 1 commit
  4. 09 Oct, 2020 2 commits
  5. 07 Oct, 2020 10 commits
  6. 06 Oct, 2020 1 commit
  7. 02 Oct, 2020 3 commits
    • Yang Shi's avatar
      fs: nfs: return per memcg count for xattr shrinkers · 5904c16d
      Yang Shi authored
      The list_lru_count() returns the pre node count, but the new xattr
      shrinkers are memcg aware, so the shrinkers should return per memcg
      count by calling list_lru_shrink_count() instead.  Otherwise over-shrink
      might be experienced.  The problem was spotted by visual code
      inspection.
      
      Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
      Cc: Anna Schumaker <anna.schumaker@netapp.com>
      Cc: Frank van der Linden <fllinden@amazon.com>
      Signed-off-by: default avatarYang Shi <shy828301@gmail.com>
      Reviewed-by: default avatarFrank van der Linden <fllinden@amazon.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      5904c16d
    • Benjamin Coddington's avatar
      NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE · b4868b44
      Benjamin Coddington authored
      Since commit 0e0cb35b ("NFSv4: Handle NFS4ERR_OLD_STATEID in
      CLOSE/OPEN_DOWNGRADE") the following livelock may occur if a CLOSE races
      with the update of the nfs_state:
      
      Process 1           Process 2           Server
      =========           =========           ========
       OPEN file
                          OPEN file
                                              Reply OPEN (1)
                                              Reply OPEN (2)
       Update state (1)
       CLOSE file (1)
                                              Reply OLD_STATEID (1)
       CLOSE file (2)
                                              Reply CLOSE (-1)
                          Update state (2)
                          wait for state change
       OPEN file
                          wake
       CLOSE file
       OPEN file
                          wake
       CLOSE file
       ...
                          ...
      
      We can avoid this situation by not issuing an immediate retry with a bumped
      seqid when CLOSE/OPEN_DOWNGRADE receives NFS4ERR_OLD_STATEID.  Instead,
      take the same approach used by OPEN and wait at least 5 seconds for
      outstanding stateid updates to complete if we can detect that we're out of
      sequence.
      
      Note that after this change it is still possible (though unlikely) that
      CLOSE waits a full 5 seconds, bumps the seqid, and retries -- and that
      attempt races with another OPEN at the same time.  In order to avoid this
      race (which would result in the livelock), update
      nfs_need_update_open_stateid() to handle the case where:
       - the state is NFS_OPEN_STATE, and
       - the stateid doesn't match the current open stateid
      
      Finally, nfs_need_update_open_stateid() is modified to be idempotent and
      renamed to better suit the purpose of signaling that the stateid passed
      is the next stateid in sequence.
      
      Fixes: 0e0cb35b ("NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE")
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      b4868b44
    • Nick Desaulniers's avatar
      nfs: remove incorrect fallthrough label · fb08334b
      Nick Desaulniers authored
      There is no case after the default from which to fallthrough to. Clang
      will error in this case (unhelpfully without context, see link below)
      and GCC will with -Wswitch-unreachable.
      
      The previous commit should have just replaced the comment with a break
      statement.
      
      If we consider implicit fallthrough to be a design mistake of C, then
      all case statements should be terminated with one of the following
      statements:
      * break
      * continue
      * return
      * fallthrough
      * goto
      * (call of function with __attribute__(__noreturn__))
      
      Fixes: 2a1390c95a69 ("nfs: Convert to use the preferred fallthrough macro")
      Link: https://bugs.llvm.org/show_bug.cgi?id=47539Acked-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Suggested-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      fb08334b
  8. 24 Sep, 2020 2 commits
  9. 21 Sep, 2020 19 commits