1. 11 11月, 2013 1 次提交
    • C
      f2fs: issue more large discard command · 29e59c14
      Changman Lee 提交于
      o Changes from v1
        Use find_next(_zero)_bit suggested by jg.kim
      
      When f2fs issues discard command, if segment is contiguous,
      let's issue more large segment to gather adjacent segments.
      
      ** blktrace **
      179,1    0     5859    42.619023770   971  C   D 131072 + 2097152 [0]
      179,1    0    33665   108.840475468   971  C   D 2228224 + 2494464 [0]
      179,1    0    33671   109.131616427   971  C   D 14909440 + 344064 [0]
      179,1    0    33677   109.137100677   971  C   D 15261696 + 4096 [0]
      Signed-off-by: NChangman Lee <cm224.lee@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      29e59c14
  2. 08 11月, 2013 2 次提交
  3. 07 11月, 2013 1 次提交
    • L
      Revert "sysfs: drop kobj_ns_type handling" · a1212d27
      Linus Torvalds 提交于
      This reverts commit cb26a311.
      
      It mysteriously causes NetworkManager to not find the wireless device
      for me.  As far as I can tell, Tejun *meant* for this commit to not make
      any semantic changes, but there clearly are some.  So revert it, taking
      into account some of the calling convention changes that happened in
      this area in subsequent commits.
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a1212d27
  4. 06 11月, 2013 1 次提交
  5. 05 11月, 2013 9 次提交
  6. 04 11月, 2013 5 次提交
  7. 03 11月, 2013 7 次提交
    • S
      Query network adapter info at mount time for debugging · c481e9fe
      Steve French 提交于
      When CONFIG_CIFS_STATS2 enabled query adapter info for debugging
      
      It is easy now in SMB3 to query the information about the server's
      network interfaces (and at least Windows 8 and above do this, if not
      other clients) there are some useful pieces of information you can get
      including:
      
      - all of the network interfaces that the server advertises (not just
      the one you are mounting over), and with SMB3 supporting multichannel
      this helps with more than just failover (also aggregating multiple
      sockets under one mount)
      
      - whether the adapter supports RSS (useful to know if you want to
      estimate whether setting up two or more socket connections to the same
      address is going to be faster due to RSS offload in the adapter)
      
      - whether the server supports RDMA
      
      - whether the server has IPv6 interfaces (if you connected over IPv4
      but prefer IPv6 e.g.)
      
      - what the link speed is (you might want to reconnect over a higher
      speed interface if available)
      
      (Of course we could also rerequest this on every mount cheaplly to the
      same server, as Windows apparently does, so we can update the adapter
      info on new mounts, and also on every reconnect if the network
      interface drops temporarily - so we don't have to rely on info from
      the first mount to this server)
      
      It is trivial to request this information - and certainly will be useful
      when we get to the point of doing multichannel (and eventually RDMA),
      but some of this (linkspeed etc.) info may help for debugging in
      the meantime.  Enable this request when CONFIG_CIFS_STATS2 is on
      (only for smb3 mounts since it is an SMB3 or later ioctl).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c481e9fe
    • S
      Fix unused variable warning when CIFS POSIX disabled · f10d9ba4
      Steve French 提交于
      Fix unused variable warning when CONFIG_CIFS_POSIX disabled.
      
         fs/cifs/ioctl.c: In function 'cifs_ioctl':
      >> fs/cifs/ioctl.c:40:8: warning: unused variable 'ExtAttrMask' [-Wunused-variable]
           __u64 ExtAttrMask = 0;
                 ^
      Pointed out by 0-DAY kernel build testing backend
      Signed-off-by: NSteve French <smfrench@gmail.com>
      f10d9ba4
    • S
      Allow setting per-file compression via CIFS protocol · c7f508a9
      Steve French 提交于
      An earlier patch allowed setting the per-file compression flag
      
      "chattr +c filename"
      
      on an smb2 or smb3 mount, and also allowed lsattr to return
      whether a file on a cifs, or smb2/smb3 mount was compressed.
      
      This patch extends the ability to set the per-file
      compression flag to the cifs protocol, which uses a somewhat
      different IOCTL mechanism than SMB2, although the payload
      (the flags stored in the compression_state) are the same.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c7f508a9
    • S
      Query File System Alignment · af6a12ea
      Steven French 提交于
      In SMB3 it is now possible to query the file system
      alignment info, and the preferred (for performance)
      sector size and whether the underlying disk
      has no seek penalty (like SSD).
      
      Query this information at mount time for SMB3,
      and make it visible in /proc/fs/cifs/DebugData
      for debugging purposes.
      
      This alignment information and preferred sector
      size info will be helpful for the copy offload
      patches to setup the right chunks in the CopyChunk
      requests.   Presumably the knowledge that the
      underlying disk is SSD could also help us
      make better readahead and writebehind
      decisions (something to look at in the future).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      af6a12ea
    • S
      Query device characteristics at mount time from server on SMB2/3 not just on cifs mounts · 2167114c
      Steven French 提交于
      Currently SMB2 and SMB3 mounts do not query the device information at mount time
      from the server as is done for cifs.  These can be useful for debugging.
      This is a minor patch, that extends the previous one (which added ability to
      query file system attributes at mount time - this returns the device
      characteristics - also via in /proc/fs/cifs/DebugData)
      Signed-off-by: NSteve French <smfrench@gmail.com>
      2167114c
    • S
      cifs: Send a logoff request before removing a smb session · 7f48558e
      Shirish Pargaonkar 提交于
      Send a smb session logoff request before removing smb session off of the list.
      On a signed smb session, remvoing a session off of the list before sending
      a logoff request results in server returning an error for lack of
      smb signature.
      
      Never seen an error during smb logoff, so as per MS-SMB2 3.2.5.1,
      not sure how an error during logoff should be retried. So for now,
      if a server returns an error to a logoff request, log the error and
      remove the session off of the list.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      7f48558e
    • T
      cifs: Make big endian multiplex ID sequences monotonic on the wire · 3d378d3f
      Tim Gardner 提交于
      The multiplex identifier (MID) in the SMB header is only
      ever used by the client, in conjunction with PID, to match responses
      from the server. As such, the endianess of the MID is not important.
      However, When tracing packet sequences on the wire, protocol analyzers
      such as wireshark display MID as little endian. It is much more informative
      for the on-the-wire MID sequences to match debug information emitted by the
      CIFS driver.  Therefore, one should write and read MID in the SMB header
      assuming it is always little endian.
      
      Observed from wireshark during the protocol negotiation
      and session setup:
      
              Multiplex ID: 256
              Multiplex ID: 256
              Multiplex ID: 512
              Multiplex ID: 512
              Multiplex ID: 768
              Multiplex ID: 768
      
      After this patch on-the-wire MID values begin at 1 and increase monotonically.
      
      Introduce get_next_mid64() for the internal consumers that use the full 64 bit
      multiplex identifier.
      
      Introduce the helpers get_mid() and compare_mid() to make the endian
      translation clear.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTim Gardner <timg@tpi.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      3d378d3f
  8. 02 11月, 2013 4 次提交
    • T
      sysfs: rename sysfs_assoc_lock and explain what it's about · 0cae60f9
      Tejun Heo 提交于
      sysfs_assoc_lock is an odd piece of locking.  In general, whoever owns
      a kobject is responsible for synchronizing sysfs operations and sysfs
      proper assumes that, for example, removal won't race with any other
      operation; however, this doesn't work for symlinking because an entity
      performing symlink doesn't usually own the target kobject and thus has
      no control over its removal.
      
      sysfs_assoc_lock synchronizes symlink operations against kobj->sd
      disassociation so that symlink code doesn't end up dereferencing
      already freed sysfs_dirent by racing with removal of the target
      kobject.
      
      This is quite obscure and the generic name of the lock and lack of
      comments make it difficult to understand its role.  Let's rename it to
      sysfs_symlink_target_lock and add comments explaining what's going on.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0cae60f9
    • T
      sysfs: use generic_file_llseek() for sysfs_file_operations · 044e3bc3
      Tejun Heo 提交于
      13c589d5 ("sysfs: use seq_file when reading regular files")
      converted regular sysfs files to use seq_file.  The commit substituted
      generic_file_llseek() with seq_lseek() for llseek implementation.
      
      Before the change, all regular sysfs files were allowed to seek to any
      position in [0, PAGE_SIZE] as the file size is always PAGE_SIZE and
      generic_file_llseek() allows any seeking inside the range under file
      size; however, seq_lseek()'s behavior is different.  It traverses the
      output by repeatedly invoking ->show() until it reaches the target
      offset or traversal indicates EOF.  As seq_files are fully dynamic and
      may not end at all, it doesn't support seeking from the end
      (SEEK_END).
      
      Apparently, there are userland tools which uses SEEK_END to discover
      the buffer size to use and the switch to seq_lseek() disturbs them as
      SEEK_END fails with -EINVAL.
      
      The only benefits of using seq_lseek() instead of
      generic_file_llseek() are
      
      * Early failure.  If traversing to certain file position should fail,
        seq_lseek() will report such failures on lseek(2) instead of the
        following read/write operations.
      
      * EOF detection.  While SEEK_END is not supported, SEEK_SET/CUR +
        large offset can be used to detect eof - eof at the time of the seek
        anyway as the file size may change dynamically.
      
      Both aren't necessary for sysfs or prospect kernfs users.  Revert to
      genefic_file_llseek() and preserve the original behavior.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Link: https://lkml.kernel.org/r/20131031114358.GA5551@osirisTested-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      044e3bc3
    • T
      NFS: Fix a missing initialisation when reading the SELinux label · fcb63a9b
      Trond Myklebust 提交于
      Ensure that _nfs4_do_get_security_label() also initialises the
      SEQUENCE call correctly, by having it call into nfs4_call_sync().
      Reported-by: NJeff Layton <jlayton@redhat.com>
      Cc: stable@vger.kernel.org # 3.11+
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fcb63a9b
    • J
      nfs: fix oops when trying to set SELinux label · 12207f69
      Jeff Layton 提交于
      Chao reported the following oops when testing labeled NFS:
      
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffffa0568703>] nfs4_xdr_enc_setattr+0x43/0x110 [nfsv4]
      PGD 277bbd067 PUD 2777ea067 PMD 0
      Oops: 0000 [#1] SMP
      Modules linked in: rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache sg coretemp kvm_intel kvm crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel lrw gf128mul iTCO_wdt glue_helper ablk_helper cryptd iTCO_vendor_support bnx2 pcspkr serio_raw i7core_edac cdc_ether microcode usbnet edac_core mii lpc_ich i2c_i801 mfd_core shpchp ioatdma dca acpi_cpufreq mperf nfsd auth_rpcgss nfs_acl lockd sunrpc xfs libcrc32c sr_mod sd_mod cdrom crc_t10dif mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper ata_generic ttm pata_acpi drm ata_piix libata megaraid_sas i2c_core dm_mirror dm_region_hash dm_log dm_mod
      CPU: 4 PID: 25657 Comm: chcon Not tainted 3.10.0-33.el7.x86_64 #1
      Hardware name: IBM System x3550 M3 -[7944OEJ]-/90Y4784     , BIOS -[D6E150CUS-1.11]- 02/08/2011
      task: ffff880178397220 ti: ffff8801595d2000 task.ti: ffff8801595d2000
      RIP: 0010:[<ffffffffa0568703>]  [<ffffffffa0568703>] nfs4_xdr_enc_setattr+0x43/0x110 [nfsv4]
      RSP: 0018:ffff8801595d3888  EFLAGS: 00010296
      RAX: 0000000000000000 RBX: ffff8801595d3b30 RCX: 0000000000000b4c
      RDX: ffff8801595d3b30 RSI: ffff8801595d38e0 RDI: ffff880278b6ec00
      RBP: ffff8801595d38c8 R08: ffff8801595d3b30 R09: 0000000000000001
      R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801595d38e0
      R13: ffff880277a4a780 R14: ffffffffa05686c0 R15: ffff8802765f206c
      FS:  00007f2c68486800(0000) GS:ffff88027fc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 000000027651a000 CR4: 00000000000007e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Stack:
       0000000000000000 0000000000000000 0000000000000000 0000000000000000
       0000000000000000 ffff880277865800 ffff880278b6ec00 ffff880277a4a780
       ffff8801595d3948 ffffffffa02ad926 ffff8801595d3b30 ffff8802765f206c
      Call Trace:
       [<ffffffffa02ad926>] rpcauth_wrap_req+0x86/0xd0 [sunrpc]
       [<ffffffffa02a1d40>] ? call_connect+0xb0/0xb0 [sunrpc]
       [<ffffffffa02a1d40>] ? call_connect+0xb0/0xb0 [sunrpc]
       [<ffffffffa02a1ecb>] call_transmit+0x18b/0x290 [sunrpc]
       [<ffffffffa02a1d40>] ? call_connect+0xb0/0xb0 [sunrpc]
       [<ffffffffa02aae14>] __rpc_execute+0x84/0x400 [sunrpc]
       [<ffffffffa02ac40e>] rpc_execute+0x5e/0xa0 [sunrpc]
       [<ffffffffa02a2ea0>] rpc_run_task+0x70/0x90 [sunrpc]
       [<ffffffffa02a2f03>] rpc_call_sync+0x43/0xa0 [sunrpc]
       [<ffffffffa055284d>] _nfs4_do_set_security_label+0x11d/0x170 [nfsv4]
       [<ffffffffa0558861>] nfs4_set_security_label.isra.69+0xf1/0x1d0 [nfsv4]
       [<ffffffff815fca8b>] ? avc_alloc_node+0x24/0x125
       [<ffffffff815fcd2f>] ? avc_compute_av+0x1a3/0x1b5
       [<ffffffffa055897b>] nfs4_xattr_set_nfs4_label+0x3b/0x50 [nfsv4]
       [<ffffffff811bc772>] generic_setxattr+0x62/0x80
       [<ffffffff811bcfc3>] __vfs_setxattr_noperm+0x63/0x1b0
       [<ffffffff811bd1c5>] vfs_setxattr+0xb5/0xc0
       [<ffffffff811bd2fe>] setxattr+0x12e/0x1c0
       [<ffffffff811a4d22>] ? final_putname+0x22/0x50
       [<ffffffff811a4f2b>] ? putname+0x2b/0x40
       [<ffffffff811aa1cf>] ? user_path_at_empty+0x5f/0x90
       [<ffffffff8119bc29>] ? __sb_start_write+0x49/0x100
       [<ffffffff811bd66f>] SyS_lsetxattr+0x8f/0xd0
       [<ffffffff8160cf99>] system_call_fastpath+0x16/0x1b
      Code: 48 8b 02 48 c7 45 c0 00 00 00 00 48 c7 45 c8 00 00 00 00 48 c7 45 d0 00 00 00 00 48 c7 45 d8 00 00 00 00 48 c7 45 e0 00 00 00 00 <48> 8b 00 48 8b 00 48 85 c0 0f 84 ae 00 00 00 48 8b 80 b8 03 00
      RIP  [<ffffffffa0568703>] nfs4_xdr_enc_setattr+0x43/0x110 [nfsv4]
       RSP <ffff8801595d3888>
      CR2: 0000000000000000
      
      The problem is that _nfs4_do_set_security_label calls rpc_call_sync()
      directly which fails to do any setup of the SEQUENCE call. Have it use
      nfs4_call_sync() instead which does the right thing. While we're at it
      change the name of "args" to "arg" to better match the pattern in
      _nfs4_do_setattr.
      Reported-by: NChao Ye <cye@redhat.com>
      Cc: David Quigley <dpquigl@davequigley.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Cc: stable@vger.kernel.org # 3.11+
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      12207f69
  9. 01 11月, 2013 3 次提交
  10. 31 10月, 2013 2 次提交
  11. 30 10月, 2013 5 次提交