1. 21 9月, 2017 5 次提交
  2. 20 9月, 2017 4 次提交
  3. 18 9月, 2017 3 次提交
  4. 13 9月, 2017 1 次提交
  5. 07 9月, 2017 1 次提交
  6. 05 9月, 2017 3 次提交
    • S
      cifs: Check for timeout on Negotiate stage · 76e75270
      Samuel Cabrero 提交于
      Some servers seem to accept connections while booting but never send
      the SMBNegotiate response neither close the connection, causing all
      processes accessing the share hang on uninterruptible sleep state.
      
      This happens when the cifs_demultiplex_thread detects the server is
      unresponsive so releases the socket and start trying to reconnect.
      At some point, the faulty server will accept the socket and the TCP
      status will be set to NeedNegotiate. The first issued command accessing
      the share will start the negotiation (pid 5828 below), but the response
      will never arrive so other commands will be blocked waiting on the mutex
      (pid 55352).
      
      This patch checks for unresponsive servers also on the negotiate stage
      releasing the socket and reconnecting if the response is not received
      and checking again the tcp state when the mutex is acquired.
      
      PID: 55352  TASK: ffff880fd6cc02c0  CPU: 0   COMMAND: "ls"
       #0 [ffff880fd9add9f0] schedule at ffffffff81467eb9
       #1 [ffff880fd9addb38] __mutex_lock_slowpath at ffffffff81468fe0
       #2 [ffff880fd9addba8] mutex_lock at ffffffff81468b1a
       #3 [ffff880fd9addbc0] cifs_reconnect_tcon at ffffffffa042f905 [cifs]
       #4 [ffff880fd9addc60] smb_init at ffffffffa042faeb [cifs]
       #5 [ffff880fd9addca0] CIFSSMBQPathInfo at ffffffffa04360b5 [cifs]
       ....
      
      Which is waiting a mutex owned by:
      
      PID: 5828   TASK: ffff880fcc55e400  CPU: 0   COMMAND: "xxxx"
       #0 [ffff880fbfdc19b8] schedule at ffffffff81467eb9
       #1 [ffff880fbfdc1b00] wait_for_response at ffffffffa044f96d [cifs]
       #2 [ffff880fbfdc1b60] SendReceive at ffffffffa04505ce [cifs]
       #3 [ffff880fbfdc1bb0] CIFSSMBNegotiate at ffffffffa0438d79 [cifs]
       #4 [ffff880fbfdc1c50] cifs_negotiate_protocol at ffffffffa043b383 [cifs]
       #5 [ffff880fbfdc1c80] cifs_reconnect_tcon at ffffffffa042f911 [cifs]
       #6 [ffff880fbfdc1d20] smb_init at ffffffffa042faeb [cifs]
       #7 [ffff880fbfdc1d60] CIFSSMBQFSInfo at ffffffffa0434eb0 [cifs]
       ....
      Signed-off-by: NSamuel Cabrero <scabrero@suse.de>
      Reviewed-by: NAurélien Aptel <aaptel@suse.de>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      76e75270
    • R
      cifs: Add support for writing attributes on SMB2+ · 5517554e
      Ronnie Sahlberg 提交于
      This adds support for writing extended attributes on SMB2+ shares.
      Attributes can be written using the setfattr command.
      
      RH-bz: 1110709
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      5517554e
    • R
      cifs: Add support for reading attributes on SMB2+ · 95907fea
      Ronnie Sahlberg 提交于
      SMB1 already has support to read attributes. This adds similar support
      to SMB2+.
      
      With this patch, tools such as 'getfattr' will now work with SMB2+ shares.
      
      RH-bz: 1110709
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      95907fea
  7. 01 9月, 2017 1 次提交
  8. 31 8月, 2017 2 次提交
  9. 24 8月, 2017 2 次提交
    • R
      cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup() · d3edede2
      Ronnie Sahlberg 提交于
      Add checking for the path component length and verify it is <= the maximum
      that the server advertizes via FileFsAttributeInformation.
      
      With this patch cifs.ko will now return ENAMETOOLONG instead of ENOENT
      when users to access an overlong path.
      
      To test this, try to cd into a (non-existing) directory on a CIFS share
      that has a too long name:
      cd /mnt/aaaaaaaaaaaaaaa...
      
      and it now should show a good error message from the shell:
      bash: cd: /mnt/aaaaaaaaaaaaaaaa...aaaaaa: File name too long
      
      rh bz 1153996
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Cc: <stable@vger.kernel.org>
      d3edede2
    • S
      cifs: Fix df output for users with quota limits · 42bec214
      Sachin Prabhu 提交于
      The df for a SMB2 share triggers a GetInfo call for
      FS_FULL_SIZE_INFORMATION. The values returned are used to populate
      struct statfs.
      
      The problem is that none of the information returned by the call
      contains the total blocks available on the filesystem. Instead we use
      the blocks available to the user ie. quota limitation when filling out
      statfs.f_blocks. The information returned does contain Actual free units
      on the filesystem and is used to populate statfs.f_bfree. For users with
      quota enabled, it can lead to situations where the total free space
      reported is more than the total blocks on the system ending up with df
      reports like the following
      
       # df -h /mnt/a
      Filesystem         Size  Used Avail Use% Mounted on
      //192.168.22.10/a  2.5G -2.3G  2.5G    - /mnt/a
      
      To fix this problem, we instead populate both statfs.f_bfree with the
      same value as statfs.f_bavail ie. CallerAvailableAllocationUnits. This
      is similar to what is done already in the code for cifs and df now
      reports the quota information for the user used to mount the share.
      
       # df --si /mnt/a
      Filesystem         Size  Used Avail Use% Mounted on
      //192.168.22.10/a  2.7G  101M  2.6G   4% /mnt/a
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Signed-off-by: NPierguido Lambri <plambri@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Cc: <stable@vger.kernel.org>
      42bec214
  10. 01 8月, 2017 1 次提交
    • J
      fs: convert a pile of fsync routines to errseq_t based reporting · 3b49c9a1
      Jeff Layton 提交于
      This patch converts most of the in-kernel filesystems that do writeback
      out of the pagecache to report errors using the errseq_t-based
      infrastructure that was recently added. This allows them to report
      errors once for each open file description.
      
      Most filesystems have a fairly straightforward fsync operation. They
      call filemap_write_and_wait_range to write back all of the data and
      wait on it, and then (sometimes) sync out the metadata.
      
      For those filesystems this is a straightforward conversion from calling
      filemap_write_and_wait_range in their fsync operation to calling
      file_write_and_wait_range.
      Acked-by: NJan Kara <jack@suse.cz>
      Acked-by: NDave Kleikamp <dave.kleikamp@oracle.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      3b49c9a1
  11. 16 7月, 2017 1 次提交
    • B
      fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks · 9d5b86ac
      Benjamin Coddington 提交于
      Since commit c69899a1 "NFSv4: Update of VFS byte range lock must be
      atomic with the stateid update", NFSv4 has been inserting locks in rpciod
      worker context.  The result is that the file_lock's fl_nspid is the
      kworker's pid instead of the original userspace pid.
      
      The fl_nspid is only used to represent the namespaced virtual pid number
      when displaying locks or returning from F_GETLK.  There's no reason to set
      it for every inserted lock, since we can usually just look it up from
      fl_pid.  So, instead of looking up and holding struct pid for every lock,
      let's just look up the virtual pid number from fl_pid when it is needed.
      That means we can remove fl_nspid entirely.
      
      The translaton and presentation of fl_pid should handle the following four
      cases:
      
      1 - F_GETLK on a remote file with a remote lock:
          In this case, the filesystem should determine the l_pid to return here.
          Filesystems should indicate that the fl_pid represents a non-local pid
          value that should not be translated by returning an fl_pid <= 0.
      
      2 - F_GETLK on a local file with a remote lock:
          This should be the l_pid of the lock manager process, and translated.
      
      3 - F_GETLK on a remote file with a local lock, and
      4 - F_GETLK on a local file with a local lock:
          These should be the translated l_pid of the local locking process.
      
      Fuse was already doing the correct thing by translating the pid into the
      caller's namespace.  With this change we must update fuse to translate
      to init's pid namespace, so that the locks API can then translate from
      init's pid namespace into the pid namespace of the caller.
      
      With this change, the locks API will expect that if a filesystem returns
      a remote pid as opposed to a local pid for F_GETLK, that remote pid will
      be <= 0.  This signifies that the pid is remote, and the locks API will
      forego translating that pid into the pid namespace of the local calling
      process.
      
      Finally, we convert remote filesystems to present remote pids using
      negative numbers. Have lustre, 9p, ceph, cifs, and dlm negate the remote
      pid returned for F_GETLK lock requests.
      
      Since local pids will never be larger than PID_MAX_LIMIT (which is
      currently defined as <= 4 million), but pid_t is an unsigned int, we
      should have plenty of room to represent remote pids with negative
      numbers if we assume that remote pid numbers are similarly limited.
      
      If this is not the case, then we run the risk of having a remote pid
      returned for which there is also a corresponding local pid.  This is a
      problem we have now, but this patch should reduce the chances of that
      occurring, while also returning those remote pid numbers, for whatever
      that may be worth.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      9d5b86ac
  12. 10 7月, 2017 1 次提交
  13. 09 7月, 2017 6 次提交
  14. 06 7月, 2017 9 次提交