1. 21 4月, 2009 16 次提交
  2. 20 4月, 2009 1 次提交
  3. 18 4月, 2009 3 次提交
  4. 17 4月, 2009 20 次提交
    • R
      splice: fix new kernel-doc warnings · b80901bb
      Randy Dunlap 提交于
      splice: fix kernel-doc warnings
      
        Warning(fs/splice.c:617): bad line:
        Warning(fs/splice.c:722): No description found for parameter 'sd'
        Warning(fs/splice.c:722): Excess function parameter 'pipe' description in 'splice_from_pipe_begin'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b80901bb
    • J
      cifs: remove unneeded bcc_ptr update in CIFSTCon · 22c9d52b
      Jeff Layton 提交于
      This pointer isn't used again after this point. It's also not updated in
      the ascii case, so there's no need to update it here.
      Pointed-out-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      22c9d52b
    • J
      cifs: add cFYI messages with some of the saved strings from ssetup/tcon · 313fecfa
      Jeff Layton 提交于
      ...to make it easier to find problems in this area in the future.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      313fecfa
    • J
      cifs: fix buffer size for tcon->nativeFileSystem field · f083def6
      Jeff Layton 提交于
      The buffer for this was resized recently to fix a bug. It's still
      possible however that a malicious server could overflow this field
      by sending characters in it that are >2 bytes in the local charset.
      Double the size of the buffer to account for this possibility.
      
      Also get rid of some really strange and seemingly pointless NULL
      termination. It's NULL terminating the string in the source buffer,
      but by the time that happens, we've already copied the string.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      f083def6
    • J
      cifs: fix unicode string area word alignment in session setup · 27b87fe5
      Jeff Layton 提交于
      The handling of unicode string area alignment is wrong.
      decode_unicode_ssetup improperly assumes that it will always be preceded
      by a pad byte. This isn't the case if the string area is already
      word-aligned.
      
      This problem, combined with the bad buffer sizing for the serverDomain
      string can cause memory corruption. The bad alignment can make it so
      that the alignment of the characters is off. This can make them
      translate to characters that are greater than 2 bytes each. If this
      happens we can overflow the allocation.
      
      Fix this by fixing the alignment in CIFS_SessSetup instead so we can
      verify it against the head of the response. Also, clean up the
      workaround for improperly terminated strings by checking for a
      odd-length unicode buffers and then forcibly terminating them.
      
      Finally, resize the buffer for serverDomain. Now that we've fixed
      the alignment, it's probably fine, but a malicious server could
      overflow it.
      
      A better solution for handling these strings is still needed, but
      this should be a suitable bandaid.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      27b87fe5
    • S
    • S
      [CIFS] Fix sparse warnings · bc8cd439
      Steve French 提交于
      Signed-off-by: NShirish Pargaonkar <shirishp@us.ibm.com>
      CC: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      bc8cd439
    • S
      [CIFS] Add support for posix open during lookup · a6ce4932
      Steve French 提交于
      This patch by utilizing lookup intents, and thus removing a network
      roundtrip in the open path, improves performance dramatically on
      open (30% or more) to Samba and other servers which support the
      cifs posix extensions
      Signed-off-by: NShirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      a6ce4932
    • J
      cifs: no need to use rcu_assign_pointer on immutable keys · d9fb5c09
      Jeff Layton 提交于
      cifs: no need to use rcu_assign_pointer on immutable keys
      
      Neither keytype in use by CIFS has an "update" method. This means that
      the keys are immutable once instantiated. We don't need to use RCU
      to set the payload data pointers.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d9fb5c09
    • J
      cifs: remove dnotify thread code · 5144ebf4
      Jeff Layton 提交于
      cifs: remove dnotify thread code
      
      Al Viro recently removed the dir_notify code from the kernel along with
      the CIFS code that used it. We can also get rid of the dnotify thread
      as well.
      
      In actuality, it never had anything to do with dir_notify anyway. All
      it did was unnecessarily wake up all the tasks waiting on the response
      queues every 15s. Previously that happened to prevent tasks from hanging
      indefinitely when the server went unresponsive, but we put those to
      sleep with proper timeouts now so there's no reason to keep this around.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5144ebf4
    • S
      [CIFS] remove some build warnings · 2d6d589d
      Steve French 提交于
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2d6d589d
    • J
      cifs: vary timeout on writes past EOF based on offset (try #5) · fbec9ab9
      Jeff Layton 提交于
      This is the fourth version of this patch:
      
      The first three generated a compiler warning asking for explicit curly
      braces.
      
      The first two didn't handle update the size correctly when writes that
      didn't start at the eof were done.
      
      The first patch also didn't update the size correctly when it explicitly
      set via truncate().
      
      This patch adds code to track the client's current understanding of the
      size of the file on the server separate from the i_size, and then to use
      this info to semi-intelligently set the timeout for writes past the EOF.
      
      This helps prevent timeouts when trying to write large, sparse files on
      windows servers.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fbec9ab9
    • S
    • I
      Remote DFS root support. · 1bfe73c2
      Igor Mammedov 提交于
      Allows to mount share on a server that returns -EREMOTE
       at the tree connect stage or at the check on a full path
       accessibility.
      Signed-off-by: NIgor Mammedov <niallain@gmail.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1bfe73c2
    • S
      [CIFS] Endian convert UniqueId when reporting inode numbers from server files · 85a6dac5
      Steve French 提交于
      Jeff made a good point that we should endian convert the UniqueId when we use
      it to set i_ino Even though this value is opaque to the client, when comparing
      the inode numbers of the same server file from two different clients (one
      big endian, one little endian) or when we compare a big endian client's view
      of i_ino with what the server thinks - we should get the same value
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      85a6dac5
    • W
      cifs: remove some pointless conditionals before kfree() · 74496d36
      Wei Yongjun 提交于
      Remove some pointless conditionals before kfree().
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      74496d36
    • J
      cifs: flush data on any setattr · 0f4d634c
      Jeff Layton 提交于
      We already flush all the dirty pages for an inode before doing
      ATTR_SIZE and ATTR_MTIME changes. There's another problem though -- if
      we change the mode so that the file becomes read-only then we may not
      be able to write data to it after a reconnect.
      
      Fix this by just going back to flushing all the dirty data on any
      setattr call. There are probably some cases that can be optimized out,
      but I'm not sure they're worthwhile and we need to consider them more
      carefully to make sure that we don't cause regressions if we have
      to reconnect before writeback occurs.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0f4d634c
    • K
      proc: mounts_poll() make consistent to mdstat_poll · 31b07093
      KOSAKI Motohiro 提交于
      In recently sysfs_poll discussion, Neil Brown pointed out /proc/mounts
      also should be fixed.
      
      SUSv3 says "Regular files shall always poll TRUE for reading and
      writing".  see
      http://www.opengroup.org/onlinepubs/009695399/functions/poll.html
      
      Then, mounts_poll()'s default should be "POLLIN | POLLRDNORM".  it mean
      always readable.
      
      In addition, event trigger should use "POLLERR | POLLPRI" instead
      POLLERR.  it makes consistent to mdstat_poll() and sysfs_poll(). and,
      select(2) can handle POLLPRI easily.
      Reported-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Ram Pai <linuxram@us.ibm.com>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      31b07093
    • K
      sysfs: sysfs poll keep the poll rule of regular file. · 1af3557a
      KOSAKI Motohiro 提交于
      Currently, following test programs don't finished.
      
      % ruby -e '
      Thread.new { sleep }
      File.read("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies")
      '
      
      strace expose the reason.
      
      ...
      open("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies", O_RDONLY|O_LARGEFILE) = 3
      ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbf9fa6b8) = -1 ENOTTY (Inappropriate ioctl for device)
      fstat64(3, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
      _llseek(3, 0, [0], SEEK_CUR)            = 0
      select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
      read(3, "1400000 1300000 1200000 1100000 1"..., 4096) = 62
      select(4, [3], NULL, NULL, NULL
      
      
      Because Ruby (the scripting language) VM assume select system-call
      against regular file don't block.  it because SUSv3 says "Regular files
      shall always poll TRUE for reading and writing".  see
      http://www.opengroup.org/onlinepubs/009695399/functions/poll.html it
      seems valid assumption.
      
      But sysfs_poll() don't keep this rule although sysfs file can read and
      write always.
      
      This patch restore proper poll behavior to sysfs.
      /sys/block/md*/md/sync_action polling application and another sysfs
      updating sensitive application still can use POLLERR and POLLPRI.
      
      Cc: Neil Brown <neilb@suse.de>
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1af3557a
    • A
      sysfs: don't use global workqueue in sysfs_schedule_callback() · d110271e
      Alex Chiang 提交于
      A sysfs attribute using sysfs_schedule_callback() to commit suicide
      may end up calling device_unregister(), which will eventually call
      a driver's ->remove function.
      
      Drivers may call flush_scheduled_work() in their shutdown routines,
      in which case lockdep will complain with something like the following:
      
        =============================================
        [ INFO: possible recursive locking detected ]
        2.6.29-rc8-kk #1
        ---------------------------------------------
        events/4/56 is trying to acquire lock:
        (events){--..}, at: [<ffffffff80257fc0>] flush_workqueue+0x0/0xa0
      
        but task is already holding lock:
        (events){--..}, at: [<ffffffff80257648>] run_workqueue+0x108/0x230
      
        other info that might help us debug this:
        3 locks held by events/4/56:
        #0:  (events){--..}, at: [<ffffffff80257648>] run_workqueue+0x108/0x230
        #1:  (&ss->work){--..}, at: [<ffffffff80257648>] run_workqueue+0x108/0x230
        #2:  (pci_remove_rescan_mutex){--..}, at: [<ffffffff803c10d1>] remove_callback+0x21/0x40
      
        stack backtrace:
        Pid: 56, comm: events/4 Not tainted 2.6.29-rc8-kk #1
        Call Trace:
        [<ffffffff8026dfcd>] validate_chain+0xb7d/0x1260
        [<ffffffff8026eade>] __lock_acquire+0x42e/0xa40
        [<ffffffff8026f148>] lock_acquire+0x58/0x80
        [<ffffffff80257fc0>] ? flush_workqueue+0x0/0xa0
        [<ffffffff8025800d>] flush_workqueue+0x4d/0xa0
        [<ffffffff80257fc0>] ? flush_workqueue+0x0/0xa0
        [<ffffffff80258070>] flush_scheduled_work+0x10/0x20
        [<ffffffffa0144065>] e1000_remove+0x55/0xfe [e1000e]
        [<ffffffff8033ee30>] ? sysfs_schedule_callback_work+0x0/0x50
        [<ffffffff803bfeb2>] pci_device_remove+0x32/0x70
        [<ffffffff80441da9>] __device_release_driver+0x59/0x90
        [<ffffffff80441edb>] device_release_driver+0x2b/0x40
        [<ffffffff804419d6>] bus_remove_device+0xa6/0x120
        [<ffffffff8043e46b>] device_del+0x12b/0x190
        [<ffffffff8043e4f6>] device_unregister+0x26/0x70
        [<ffffffff803ba969>] pci_stop_dev+0x49/0x60
        [<ffffffff803baab0>] pci_remove_bus_device+0x40/0xc0
        [<ffffffff803c10d9>] remove_callback+0x29/0x40
        [<ffffffff8033ee4f>] sysfs_schedule_callback_work+0x1f/0x50
        [<ffffffff8025769a>] run_workqueue+0x15a/0x230
        [<ffffffff80257648>] ? run_workqueue+0x108/0x230
        [<ffffffff8025846f>] worker_thread+0x9f/0x100
        [<ffffffff8025bce0>] ? autoremove_wake_function+0x0/0x40
        [<ffffffff802583d0>] ? worker_thread+0x0/0x100
        [<ffffffff8025b89d>] kthread+0x4d/0x80
        [<ffffffff8020d4ba>] child_rip+0xa/0x20
        [<ffffffff8020cebc>] ? restore_args+0x0/0x30
        [<ffffffff8025b850>] ? kthread+0x0/0x80
        [<ffffffff8020d4b0>] ? child_rip+0x0/0x20
      
      Although we know that the device_unregister path will never acquire
      a lock that a driver might try to acquire in its ->remove, in general
      we should never attempt to flush a workqueue from within the same
      workqueue, and lockdep rightly complains.
      
      So as long as sysfs attributes cannot commit suicide directly and we
      are stuck with this callback mechanism, put the sysfs callbacks on
      their own workqueue instead of the global one.
      
      This has the side benefit that if a suicidal sysfs attribute kicks
      off a long chain of ->remove callbacks, we no longer induce a long
      delay on the global queue.
      
      This also fixes a missing module_put in the error path introduced
      by sysfs-only-allow-one-scheduled-removal-callback-per-kobj.patch.
      
      We never destroy the workqueue, but I'm not sure that's a
      problem.
      Reported-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Tested-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d110271e