Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jul 26, 2024
  2. Jul 23, 2024
  3. Jul 20, 2024
  4. Jul 19, 2024
    • David Howells's avatar
      cifs: Add a tracepoint to track credits involved in R/W requests · 519be989
      David Howells authored
      
      Add a tracepoint to track the credit changes and server in_flight value
      involved in the lifetime of a R/W request, logging it against the
      request/subreq debugging ID.  This requires the debugging IDs to be
      recorded in the cifs_credits struct.
      
      The tracepoint can be enabled with:
      
      	echo 1 >/sys/kernel/debug/tracing/events/cifs/smb3_rw_credits/enable
      
      Also add a three-state flag to struct cifs_credits to note if we're
      interested in determining when the in_flight contribution ends and, if so,
      to track whether we've decremented the contribution yet.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      cc: netfs@lists.linux.dev
      cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      519be989
    • David Howells's avatar
      cifs: Fix setting of zero_point after DIO write · 61ea6b3a
      David Howells authored
      At the moment, at the end of a DIO write, cifs calls netfs_resize_file() to
      adjust the size of the file if it needs it.  This will reduce the
      zero_point (the point above which we assume a read will just return zeros)
      if it's more than the new i_size, but won't increase it.
      
      With DIO writes, however, we definitely want to increase it as we have
      clobbered the local pagecache and then written some data that's not
      available locally.
      
      Fix cifs to make the zero_point above the end of a DIO or unbuffered write.
      
      This fixes corruption seen occasionally with the generic/708 xfs-test.  In
      that case, the read-back of some of the written data is being
      short-circuited and replaced with zeroes.
      
      Fixes: 3ee1a1fc
      
       ("cifs: Cut over to using netfslib")
      Cc: stable@vger.kernel.org
      Reported-by: default avatarSteve French <sfrench@samba.org>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      cc: netfs@lists.linux.dev
      cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      61ea6b3a
    • David Howells's avatar
      cifs: Fix missing error code set · d2c5eb57
      David Howells authored
      In cifs_strict_readv(), the default rc (-EACCES) is accidentally cleared by
      a successful return from netfs_start_io_direct(), such that if
      cifs_find_lock_conflict() fails, we don't return an error.
      
      Fix this by resetting the default error code.
      
      Fixes: 14b1cd25
      
       ("cifs: Fix locking in cifs_strict_readv()")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: linux-cifs@vger.kernel.org
      cc: netfs@lists.linux.dev
      cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      d2c5eb57
    • David Howells's avatar
      cifs: Fix server re-repick on subrequest retry · de40579b
      David Howells authored
      When a subrequest is marked for needing retry, netfs will call
      cifs_prepare_write() which will make cifs repick the server for the op
      before renegotiating credits; it then calls cifs_issue_write() which
      invokes smb2_async_writev() - which re-repicks the server.
      
      If a different server is then selected, this causes the increment of
      server->in_flight to happen against one record and the decrement to happen
      against another, leading to misaccounting.
      
      Fix this by just removing the repick code in smb2_async_writev().  As this
      is only called from netfslib-driven code, cifs_prepare_write() should
      always have been called first, and so server should never be NULL and the
      preparatory step is repeated in the event that we do a retry.
      
      The problem manifests as a warning looking something like:
      
       WARNING: CPU: 4 PID: 72896 at fs/smb/client/smb2ops.c:97 smb2_add_credits+0x3f0/0x9e0 [cifs]
       ...
       RIP: 0010:smb2_add_credits+0x3f0/0x9e0 [cifs]
       ...
        smb2_writev_callback+0x334/0x560 [cifs]
        cifs_demultiplex_thread+0x77a/0x11b0 [cifs]
        kthread+0x187/0x1d0
        ret_from_fork+0x34/0x60
        ret_from_fork_asm+0x1a/0x30
      
      Which may be triggered by a number of different xfstests running against an
      Azure server in multichannel mode.  generic/249 seems the most repeatable,
      but generic/215, generic/249 and generic/308 may also show it.
      
      Fixes: 3ee1a1fc
      
       ("cifs: Cut over to using netfslib")
      Cc: stable@vger.kernel.org
      Reported-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.com>
      Acked-by: default avatarTom Talpey <tom@talpey.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Jeff Layton <jlayton@kernel.org>
      cc: Aurelien Aptel <aaptel@suse.com>
      cc: linux-cifs@vger.kernel.org
      cc: netfs@lists.linux.dev
      cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      de40579b
    • Steve French's avatar
      cifs: fix noisy message on copy_file_range · ae4ccca4
      Steve French authored
      
      There are common cases where copy_file_range can noisily
      log "source and target of copy not on same server"
      e.g. the mv command across mounts to two different server's shares.
      Change this to informational rather than logging as an error.
      
      A followon patch will add dynamic trace points e.g. for
      cifs_file_copychunk_range
      
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      ae4ccca4
    • Qu Wenruo's avatar
      btrfs: change BTRFS_MOUNT_* flags to 64bit type · c3ece6b7
      Qu Wenruo authored
      Currently the BTRFS_MOUNT_* flags are already beyond 32 bits, this is
      going to cause compilation errors for some 32 bit systems, as their
      unsigned long is only 32 bits long, thus flag
      BTRFS_MOUNT_IGNORESUPERFLAGS overflows and can lead to errors.
      
      Fix the problem by:
      
      - Migrate all existing BTRFS_MOUNT_* flags to unsigned long long
      - Migrate all mount option related variables to unsigned long long
        * btrfs_fs_info::mount_opt
        * btrfs_fs_context::mount_opt
        * mount_opt parameter of btrfs_check_options()
        * old_opts parameter of btrfs_remount_begin()
        * old_opts parameter of btrfs_remount_cleanup()
        * mount_opt parameter of btrfs_check_mountopts_zoned()
        * mount_opt and opt parameters of check_ro_option()
      
      Fixes: 32e62165
      
       ("btrfs: introduce new "rescue=ignoresuperflags" mount option")
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      c3ece6b7
  5. Jul 18, 2024
  6. Jul 17, 2024
  7. Jul 15, 2024
  8. Jul 14, 2024