1. 22 4月, 2011 1 次提交
  2. 19 4月, 2011 1 次提交
  3. 18 4月, 2011 2 次提交
  4. 16 4月, 2011 8 次提交
  5. 15 4月, 2011 5 次提交
  6. 13 4月, 2011 9 次提交
  7. 12 4月, 2011 14 次提交
    • J
      cifs: don't allow mmap'ed pages to be dirtied while under writeback (try #3) · ca83ce3d
      Jeff Layton 提交于
      This is more or less the same patch as before, but with some merge
      conflicts fixed up.
      
      If a process has a dirty page mapped into its page tables, then it has
      the ability to change it while the client is trying to write the data
      out to the server. If that happens after the signature has been
      calculated then that signature will then be wrong, and the server will
      likely reset the TCP connection.
      
      This patch adds a page_mkwrite handler for CIFS that simply takes the
      page lock. Because the page lock is held over the life of writepage and
      writepages, this prevents the page from becoming writeable until
      the write call has completed.
      
      With this, we can also remove the "sign_zero_copy" module option and
      always inline the pages when writing.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ca83ce3d
    • S
      [CIFS] Warn on requesting default security (ntlm) on mount · d9b94201
      Steve French 提交于
      Warn once if default security (ntlm) requested. We will
      update the default to the stronger security mechanism
      (ntlmv2) in 2.6.41.  Kerberos is also stronger than
      ntlm, but more servers support ntlmv2 and ntlmv2
      does not require an upcall, so ntlmv2 is a better
      default.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      CC: Suresh Jayaraman <sjayaraman@suse.de>
      Reviewed-by: NShirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d9b94201
    • S
      [CIFS] cifs: clarify the meaning of tcpStatus == CifsGood · fd88ce93
      Steve French 提交于
      When the TCP_Server_Info is first allocated and connected, tcpStatus ==
      CifsGood means that the NEGOTIATE_PROTOCOL request has completed and the
      socket is ready for other calls. cifs_reconnect however sets tcpStatus
      to CifsGood as soon as the socket is reconnected and the optional
      RFC1001 session setup is done. We have no clear way to tell the
      difference between these two states, and we need to know this in order
      to know whether we can send an echo or not.
      
      Resolve this by adding a new statusEnum value -- CifsNeedNegotiate. When
      the socket has been connected but has not yet had a NEGOTIATE_PROTOCOL
      request done, set it to this value. Once the NEGOTIATE is done,
      cifs_negotiate_protocol will set tcpStatus to CifsGood.
      
      This also fixes and cleans the logic in cifs_reconnect and
      cifs_reconnect_tcon. The old code checked for specific states when what
      it really wants to know is whether the state has actually changed from
      CifsNeedReconnect.
      Reported-and-Tested-by: NJG <jg@cms.ac>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fd88ce93
    • J
      cifs: wrap received signature check in srv_mutex · 157c2491
      Jeff Layton 提交于
      While testing my patchset to fix asynchronous writes, I hit a bunch
      of signature problems when testing with signing on. The problem seems
      to be that signature checks on receive can be running at the same
      time as a process that is sending, or even that multiple receives can
      be checking signatures at the same time, clobbering the same data
      structures.
      
      While we're at it, clean up the comments over cifs_calculate_signature
      and add a note that the srv_mutex should be held when calling this
      function.
      
      This patch seems to fix the problems for me, but I'm not clear on
      whether it's the best approach. If it is, then this should probably
      go to stable too.
      
      Cc: stable@kernel.org
      Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      157c2491
    • J
      cifs: clean up various nits in unicode routines (try #2) · 581ade4d
      Jeff Layton 提交于
      Minor revision to the original patch. Don't abuse the __le16 variable
      on the stack by casting it to wchar_t and handing it off to char2uni.
      Declare an actual wchar_t on the stack instead. This fixes a valid
      sparse warning.
      
      Fix the spelling of UNI_ASTERISK. Eliminate the unneeded len_remaining
      variable in cifsConvertToUCS.
      
      Also, as David Howells points out. We were better off making
      cifsConvertToUCS *not* use put_unaligned_le16 since it means that we
      can't optimize the mapped characters at compile time. Switch them
      instead to use cpu_to_le16, and simply use put_unaligned to set them
      in the string.
      Reported-and-acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      581ade4d
    • J
      cifs: clean up length checks in check2ndT2 · c0c7b905
      Jeff Layton 提交于
      Thus spake David Howells:
      
      The code that follows this:
      
        	remaining = total_data_size - data_in_this_rsp;
      	if (remaining == 0)
      		return 0;
      	else if (remaining < 0) {
      
      generates better code if you drop the 'remaining' variable and compare
      the values directly.
      
      Clean it up per his recommendation...
      Reported-and-acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c0c7b905
    • J
      cifs: set ra_pages in backing_dev_info · 2b6c26a0
      Jeff Layton 提交于
      Commit 522440ed made cifs set backing_dev_info on the mapping attached
      to new inodes. This change caused a fairly significant read performance
      regression, as cifs started doing page-sized reads exclusively.
      
      By virtue of the fact that they're allocated as part of cifs_sb_info by
      kzalloc, the ra_pages on cifs BDIs get set to 0, which prevents any
      readahead. This forces the normal read codepaths to use readpage instead
      of readpages causing a four-fold increase in the number of read calls
      with the default rsize.
      
      Fix it by setting ra_pages in the BDI to the same value as that in the
      default_backing_dev_info.
      
      Fixes https://bugzilla.kernel.org/show_bug.cgi?id=31662
      
      Cc: stable@kernel.org
      Reported-and-Tested-by: NTill <till2.schaefer@uni-dortmund.de>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2b6c26a0
    • J
      cifs: fix broken BCC check in is_valid_oplock_break · 8679b0db
      Jeff Layton 提交于
      The BCC is still __le16 at this point, and in any case we need to
      use the get_bcc_le macro to make sure we don't hit alignment
      problems.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8679b0db
    • J
      cifs: always do is_path_accessible check in cifs_mount · 70945643
      Jeff Layton 提交于
      Currently, we skip doing the is_path_accessible check in cifs_mount if
      there is no prefixpath. I have a report of at least one server however
      that allows a TREE_CONNECT to a share that has a DFS referral at its
      root. The reporter in this case was using a UNC that had no prefixpath,
      so the is_path_accessible check was not triggered and the box later hit
      a BUG() because we were chasing a DFS referral on the root dentry for
      the mount.
      
      This patch fixes this by removing the check for a zero-length
      prefixpath.  That should make the is_path_accessible check be done in
      this situation and should allow the client to chase the DFS referral at
      mount time instead.
      
      Cc: stable@kernel.org
      Reported-and-Tested-by: NYogesh Sharma <ysharma@cymer.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      70945643
    • S
      various endian fixes to cifs · 5443d130
      Steve French 提交于
      make modules C=2 M=fs/cifs CF=-D__CHECK_ENDIAN__
      
      Found for example:
      
       CHECK   fs/cifs/cifssmb.c
      fs/cifs/cifssmb.c:728:22: warning: incorrect type in assignment (different base types)
      fs/cifs/cifssmb.c:728:22:    expected unsigned short [unsigned] [usertype] Tid
      fs/cifs/cifssmb.c:728:22:    got restricted __le16 [usertype] <noident>
      fs/cifs/cifssmb.c:1883:45: warning: incorrect type in assignment (different base types)
      fs/cifs/cifssmb.c:1883:45:    expected long long [signed] [usertype] fl_start
      fs/cifs/cifssmb.c:1883:45:    got restricted __le64 [usertype] start
      fs/cifs/cifssmb.c:1884:54: warning: restricted __le64 degrades to integer
      fs/cifs/cifssmb.c:1885:58: warning: restricted __le64 degrades to integer
      fs/cifs/cifssmb.c:1886:43: warning: incorrect type in assignment (different base types)
      fs/cifs/cifssmb.c:1886:43:    expected unsigned int [unsigned] fl_pid
      fs/cifs/cifssmb.c:1886:43:    got restricted __le32 [usertype] pid
      
      In checking new smb2 code for missing endian conversions, I noticed
      some endian errors had crept in over the last few releases into the
      cifs code (symlink, ntlmssp, posix lock, and also a less problematic warning
      in fscache).  A followon patch will address a few smb2 endian
      problems.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5443d130
    • S
      Elminate sparse __CHECK_ENDIAN__ warnings on port conversion · 6da97910
      Steve French 提交于
      Ports are __be16 not unsigned short int
      
      Eliminates the remaining fixable endian warnings:
      
      ~/cifs-2.6$ make modules C=1 M=fs/cifs CF=-D__CHECK_ENDIAN__
        CHECK   fs/cifs/connect.c
      fs/cifs/connect.c:2408:23: warning: incorrect type in assignment (different base types)
      fs/cifs/connect.c:2408:23:    expected unsigned short *sport
      fs/cifs/connect.c:2408:23:    got restricted __be16 *<noident>
      fs/cifs/connect.c:2410:23: warning: incorrect type in assignment (different base types)
      fs/cifs/connect.c:2410:23:    expected unsigned short *sport
      fs/cifs/connect.c:2410:23:    got restricted __be16 *<noident>
      fs/cifs/connect.c:2416:24: warning: incorrect type in assignment (different base types)
      fs/cifs/connect.c:2416:24:    expected unsigned short [unsigned] [short] <noident>
      fs/cifs/connect.c:2416:24:    got restricted __be16 [usertype] <noident>
      fs/cifs/connect.c:2423:24: warning: incorrect type in assignment (different base types)
      fs/cifs/connect.c:2423:24:    expected unsigned short [unsigned] [short] <noident>
      fs/cifs/connect.c:2423:24:    got restricted __be16 [usertype] <noident>
      fs/cifs/connect.c:2326:23: warning: incorrect type in assignment (different base types)
      fs/cifs/connect.c:2326:23:    expected unsigned short [unsigned] sport
      fs/cifs/connect.c:2326:23:    got restricted __be16 [usertype] sin6_port
      fs/cifs/connect.c:2330:23: warning: incorrect type in assignment (different base types)
      fs/cifs/connect.c:2330:23:    expected unsigned short [unsigned] sport
      fs/cifs/connect.c:2330:23:    got restricted __be16 [usertype] sin_port
      fs/cifs/connect.c:2394:22: warning: restricted __be16 degrades to integer
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      6da97910
    • S
      Max share size is too small · 2e325d59
      Steve French 提交于
      Max share name was set to 64, and (at least for Windows)
      can be 80.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2e325d59
    • A
      btrfs: using cached extent_state in set/unlock combinations · 507903b8
      Arne Jansen 提交于
      In several places the sequence (set_extent_uptodate, unlock_extent) is used.
      This leads to a duplicate lookup of the extent state. This patch lets
      set_extent_uptodate return a cached extent_state which can be passed to
      unlock_extent_cached.
      The occurences of the above sequences are updated to use the cache. Only
      end_bio_extent_readpage is updated that it first gets a cached state to
      pass it to the readpage_end_io_hook as the prototype requested and is later
      on being used for set/unlock.
      Signed-off-by: NArne Jansen <sensille@gmx.net>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      507903b8
    • J
      Btrfs: avoid taking the trans_mutex in btrfs_end_transaction · 13c5a93e
      Josef Bacik 提交于
      I've been working on making our O_DIRECT latency not suck and I noticed we were
      taking the trans_mutex in btrfs_end_transaction.  So to do this we convert
      num_writers and use_count to atomic_t's and just decrement them in
      btrfs_end_transaction.  Instead of deleting the transaction from the trans list
      in put_transaction we do that in btrfs_commit_transaction() since that's the
      only time it actually needs to be removed from the list.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      13c5a93e