1. 05 Oct, 2013 25 commits
  2. 01 Oct, 2013 15 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.10.14 · 8c15abc9
      Greg Kroah-Hartman authored
      8c15abc9
    • Oliver Smith's avatar
      netfilter: ipset: Fix serious failure in CIDR tracking · 97d2a12a
      Oliver Smith authored
      commit 2cf55125 upstream.
      
      This fixes a serious bug affecting all hash types with a net element -
      specifically, if a CIDR value is deleted such that none of the same size
      exist any more, all larger (less-specific) values will then fail to
      match. Adding back any prefix with a CIDR equal to or more specific than
      the one deleted will fix it.
      
      Steps to reproduce:
      ipset -N test hash:net
      ipset -A test 1.1.0.0/16
      ipset -A test 2.2.2.0/24
      ipset -T test 1.1.1.1           #1.1.1.1 IS in set
      ipset -D test 2.2.2.0/24
      ipset -T test 1.1.1.1           #1.1.1.1 IS NOT in set
      
      This is due to the fact that the nets counter was unconditionally
      decremented prior to the iteration that shifts up the entries. Now, we
      first check if there is a proceeding entry and if not, decrement it and
      return. Otherwise, we proceed to iterate and then zero the last element,
      which, in most cases, will already be zero.
      Signed-off-by: default avatarOliver Smith <oliver@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa>
      Signed-off-by: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      97d2a12a
    • J. Bruce Fields's avatar
      rpc: let xdr layer allocate gssproxy receieve pages · ab2b9429
      J. Bruce Fields authored
      commit d4a51656 upstream.
      
      In theory the linux cred in a gssproxy reply can include up to
      NGROUPS_MAX data, 256K of data.  In the common case we expect it to be
      shorter.  So do as the nfsv3 ACL code does and let the xdr code allocate
      the pages as they come in, instead of allocating a lot of pages that
      won't typically be used.
      Tested-by: default avatarSimo Sorce <simo@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ab2b9429
    • J. Bruce Fields's avatar
      rpc: fix huge kmalloc's in gss-proxy · fea65519
      J. Bruce Fields authored
      commit 9dfd87da upstream.
      
      The reply to a gssproxy can include up to NGROUPS_MAX gid's, which will
      take up more than a page.  We therefore need to allocate an array of
      pages to hold the reply instead of trying to allocate a single huge
      buffer.
      Tested-by: default avatarSimo Sorce <simo@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fea65519
    • J. Bruce Fields's avatar
      rpc: comment on linux_cred encoding, treat all as unsigned · 577e9397
      J. Bruce Fields authored
      commit 6a36978e upstream.
      
      The encoding of linux creds is a bit confusing.
      
      Also: I think in practice it doesn't really matter whether we treat any
      of these things as signed or unsigned, but unsigned seems more
      straightforward: uid_t/gid_t are unsigned and it simplifies the ngroups
      overflow check.
      Tested-by: default avatarSimo Sorce <simo@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      577e9397
    • J. Bruce Fields's avatar
      rpc: clean up decoding of gssproxy linux creds · d68b9c45
      J. Bruce Fields authored
      commit 778e512b upstream.
      
      We can use the normal coding infrastructure here.
      
      Two minor behavior changes:
      
      	- we're assuming no wasted space at the end of the linux cred.
      	  That seems to match gss-proxy's behavior, and I can't see why
      	  it would need to do differently in the future.
      
      	- NGROUPS_MAX check added: note groups_alloc doesn't do this,
      	  this is the caller's responsibility.
      Tested-by: default avatarSimo Sorce <simo@redhat.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d68b9c45
    • Anatol Pomozov's avatar
      cfq: explicitly use 64bit divide operation for 64bit arguments · 85f58908
      Anatol Pomozov authored
      commit f3cff25f upstream.
      
      'samples' is 64bit operant, but do_div() second parameter is 32.
      do_div silently truncates high 32 bits and calculated result
      is invalid.
      
      In case if low 32bit of 'samples' are zeros then do_div() produces
      kernel crash.
      Signed-off-by: default avatarAnatol Pomozov <anatol.pomozov@gmail.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Cc: Jonghwan Choi <jhbird.choi@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      85f58908
    • Bjorn Helgaas's avatar
      bio-integrity: Fix use of bs->bio_integrity_pool after free · edc96e2c
      Bjorn Helgaas authored
      commit adbe6991 upstream.
      
      This fixes a copy and paste error introduced by 9f060e22
      ("block: Convert integrity to bvec_alloc_bs()").
      
      Found by Coverity (CID 1020654).
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarKent Overstreet <koverstreet@google.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      Cc: Jonghwan Choi <jhbird.choi@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      edc96e2c
    • Andi Kleen's avatar
      perf tools: Handle JITed code in shared memory · 71828ed9
      Andi Kleen authored
      commit 89365e6c upstream.
      
      Need to check for /dev/zero.
      
      Most likely more strings are missing too.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Link: http://lkml.kernel.org/r/1366848182-30449-1-git-send-email-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Vinson Lee <vlee@freedesktop.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71828ed9
    • Khalid Aziz's avatar
      mm: fix aio performance regression for database caused by THP · 09642082
      Khalid Aziz authored
      commit 7cb2ef56 upstream.
      
      I am working with a tool that simulates oracle database I/O workload.
      This tool (orion to be specific -
      <http://docs.oracle.com/cd/E11882_01/server.112/e16638/iodesign.htm#autoId24>)
      allocates hugetlbfs pages using shmget() with SHM_HUGETLB flag.  It then
      does aio into these pages from flash disks using various common block
      sizes used by database.  I am looking at performance with two of the most
      common block sizes - 1M and 64K.  aio performance with these two block
      sizes plunged after Transparent HugePages was introduced in the kernel.
      Here are performance numbers:
      
      		pre-THP		2.6.39		3.11-rc5
      1M read		8384 MB/s	5629 MB/s	6501 MB/s
      64K read	7867 MB/s	4576 MB/s	4251 MB/s
      
      I have narrowed the performance impact down to the overheads introduced by
      THP in __get_page_tail() and put_compound_page() routines.  perf top shows
      >40% of cycles being spent in these two routines.  Every time direct I/O
      to hugetlbfs pages starts, kernel calls get_page() to grab a reference to
      the pages and calls put_page() when I/O completes to put the reference
      away.  THP introduced significant amount of locking overhead to get_page()
      and put_page() when dealing with compound pages because hugepages can be
      split underneath get_page() and put_page().  It added this overhead
      irrespective of whether it is dealing with hugetlbfs pages or transparent
      hugepages.  This resulted in 20%-45% drop in aio performance when using
      hugetlbfs pages.
      
      Since hugetlbfs pages can not be split, there is no reason to go through
      all the locking overhead for these pages from what I can see.  I added
      code to __get_page_tail() and put_compound_page() to bypass all the
      locking code when working with hugetlbfs pages.  This improved performance
      significantly.  Performance numbers with this patch:
      
      		pre-THP		3.11-rc5	3.11-rc5 + Patch
      1M read		8384 MB/s	6501 MB/s	8371 MB/s
      64K read	7867 MB/s	4251 MB/s	6510 MB/s
      
      Performance with 64K read is still lower than what it was before THP, but
      still a 53% improvement.  It does mean there is more work to be done but I
      will take a 53% improvement for now.
      
      Please take a look at the following patch and let me know if it looks
      reasonable.
      
      [akpm@linux-foundation.org: tweak comments]
      Signed-off-by: default avatarKhalid Aziz <khalid.aziz@oracle.com>
      Cc: Pravin B Shelar <pshelar@nicira.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      09642082
    • Konstantin Khlebnikov's avatar
      audit: fix endless wait in audit_log_start() · 3ed3690e
      Konstantin Khlebnikov authored
      commit 8ac1c8d5 upstream.
      
      After commit 82919919 ("kernel/audit.c: avoid negative sleep
      durations") audit emitters will block forever if userspace daemon cannot
      handle backlog.
      
      After the timeout the waiting loop turns into busy loop and runs until
      daemon dies or returns back to work.  This is a minimal patch for that
      bug.
      Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Luiz Capitulino <lcapitulino@redhat.com>
      Cc: Richard Guy Briggs <rgb@redhat.com>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Chuck Anderson <chuck.anderson@oracle.com>
      Cc: Dan Duval <dan.duval@oracle.com>
      Cc: Dave Kleikamp <dave.kleikamp@oracle.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Jonghwan Choi <jhbird.choi@samsung.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ed3690e
    • Jan Kara's avatar
      udf: Refuse RW mount of the filesystem instead of making it RO · 39b79aa3
      Jan Kara authored
      commit e729eac6 upstream.
      
      Refuse RW mount of udf filesystem. So far we just silently changed it
      to RO mount but when the media is writeable, block layer won't notice
      this change and thus will think device is used RW and will block eject
      button of the drive. That is unexpected by users because for
      non-writeable media eject button works just fine.
      
      Userspace mount(8) command handles this just fine and retries mounting
      with MS_RDONLY set so userspace shouldn't see any regression.  Plus any
      tool mounting udf is likely confronted with the case of read-only
      media where block layer already refuses to mount the filesystem without
      MS_RDONLY set so our behavior shouldn't be anything new for it.
      Reported-by: default avatarHui Wang <hui.wang@canonical.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39b79aa3
    • Jan Kara's avatar
      udf: Standardize return values in mount sequence · 66ccf961
      Jan Kara authored
      commit d759bfa4 upstream.
      
      Change all function used in filesystem discovery during mount to user
      standard kernel return values - -errno on error, 0 on success instead
      of 1 on failure and 0 on success. This allows us to pass error number
      (not just failure / success) so we can abort device scanning earlier
      in case of errors like EIO or ENOMEM . Also we will be able to return
      EROFS in case writeable mount is requested but writing isn't supported.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Cc: Hui Wang <hui.wang@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      66ccf961
    • Mauro Carvalho Chehab's avatar
      Properly handle tristate dependencies on USB/PCI menus · 7b7b9915
      Mauro Carvalho Chehab authored
      commit 5077ac3b upstream.
      
      As USB/PCI/MEDIA_SUPPORT dependencies can be tristate, we can't
      simply make the bool menu to be dependent on it. Everything below
      the menu should also depend on it, otherwise, we risk to allow
      building them with 'y', while only 'm' would be supported.
      
      So, add an IF just before everything below, in order to avoid
      such risks.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7b7b9915
    • Randy Dunlap's avatar
      media: media/usb: fix kconfig dependencies · 3db27a31
      Randy Dunlap authored
      commit a0f9354b upstream.
      
      (a.k.a. Kconfig bool depending on a tristate considered harmful)
      Fix various build errors when CONFIG_USB=m and media USB drivers
      are builtin.  In this case, CONFIG_USB_ZR364XX=y,
      CONFIG_VIDEO_PVRUSB2=y, and CONFIG_VIDEO_STK1160=y.
      This is caused by (from drivers/media/usb/Kconfig):
      menuconfig MEDIA_USB_SUPPORT
      	bool "Media USB Adapters"
      	depends on USB && MEDIA_SUPPORT
      	           =m     =y
      so MEDIA_USB_SUPPORT=y and all following Kconfig 'source' lines
      are included.  By adding an "if USB" guard around most of this file,
      the needed dependencies are enforced.
      drivers/built-in.o: In function `zr364xx_start_readpipe':
      zr364xx.c:(.text+0xc726a): undefined reference to `usb_alloc_urb'
      zr364xx.c:(.text+0xc72bb): undefined reference to `usb_submit_urb'
      drivers/built-in.o: In function `zr364xx_stop_readpipe':
      zr364xx.c:(.text+0xc72fd): undefined reference to `usb_kill_urb'
      zr364xx.c:(.text+0xc7309): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `read_pipe_completion':
      zr364xx.c:(.text+0xc7acc): undefined reference to `usb_submit_urb'
      drivers/built-in.o: In function `send_control_msg.constprop.12':
      zr364xx.c:(.text+0xc7d2f): undefined reference to `usb_control_msg'
      drivers/built-in.o: In function `pvr2_ctl_timeout':
      pvrusb2-hdw.c:(.text+0xcadb6): undefined reference to `usb_unlink_urb'
      pvrusb2-hdw.c:(.text+0xcadcb): undefined reference to `usb_unlink_urb'
      drivers/built-in.o: In function `pvr2_hdw_create':
      (.text+0xcc42c): undefined reference to `usb_alloc_urb'
      drivers/built-in.o: In function `pvr2_hdw_create':
      (.text+0xcc448): undefined reference to `usb_alloc_urb'
      drivers/built-in.o: In function `pvr2_hdw_create':
      (.text+0xcc5f9): undefined reference to `usb_set_interface'
      drivers/built-in.o: In function `pvr2_hdw_create':
      (.text+0xcc65a): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `pvr2_hdw_create':
      (.text+0xcc666): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `pvr2_send_request_ex.part.22':
      pvrusb2-hdw.c:(.text+0xccbe3): undefined reference to `usb_submit_urb'
      pvrusb2-hdw.c:(.text+0xccc83): undefined reference to `usb_submit_urb'
      drivers/built-in.o: In function `pvr2_hdw_remove_usb_stuff.part.25':
      pvrusb2-hdw.c:(.text+0xcd3f9): undefined reference to `usb_kill_urb'
      pvrusb2-hdw.c:(.text+0xcd405): undefined reference to `usb_free_urb'
      pvrusb2-hdw.c:(.text+0xcd421): undefined reference to `usb_kill_urb'
      pvrusb2-hdw.c:(.text+0xcd42d): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `pvr2_hdw_device_reset':
      (.text+0xcd658): undefined reference to `usb_lock_device_for_reset'
      drivers/built-in.o: In function `pvr2_hdw_device_reset':
      (.text+0xcd664): undefined reference to `usb_reset_device'
      drivers/built-in.o: In function `pvr2_hdw_cpureset_assert':
      (.text+0xcd6f9): undefined reference to `usb_control_msg'
      drivers/built-in.o: In function `pvr2_hdw_cpufw_set_enabled':
      (.text+0xcd84e): undefined reference to `usb_control_msg'
      drivers/built-in.o: In function `pvr2_upload_firmware1':
      pvrusb2-hdw.c:(.text+0xcda47): undefined reference to `usb_clear_halt'
      pvrusb2-hdw.c:(.text+0xcdb04): undefined reference to `usb_control_msg'
      drivers/built-in.o: In function `pvr2_upload_firmware2':
      (.text+0xce7dc): undefined reference to `usb_bulk_msg'
      drivers/built-in.o: In function `pvr2_stream_buffer_count':
      pvrusb2-io.c:(.text+0xd2e05): undefined reference to `usb_alloc_urb'
      pvrusb2-io.c:(.text+0xd2e5b): undefined reference to `usb_kill_urb'
      pvrusb2-io.c:(.text+0xd2e9f): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `pvr2_stream_internal_flush':
      pvrusb2-io.c:(.text+0xd2f9b): undefined reference to `usb_kill_urb'
      drivers/built-in.o: In function `pvr2_buffer_queue':
      (.text+0xd3328): undefined reference to `usb_kill_urb'
      drivers/built-in.o: In function `pvr2_buffer_queue':
      (.text+0xd33ea): undefined reference to `usb_submit_urb'
      drivers/built-in.o: In function `stk1160_read_reg':
      (.text+0xd3efa): undefined reference to `usb_control_msg'
      drivers/built-in.o: In function `stk1160_write_reg':
      (.text+0xd3f4f): undefined reference to `usb_control_msg'
      drivers/built-in.o: In function `stop_streaming':
      stk1160-v4l.c:(.text+0xd4997): undefined reference to `usb_set_interface'
      drivers/built-in.o: In function `start_streaming':
      stk1160-v4l.c:(.text+0xd4a9f): undefined reference to `usb_set_interface'
      stk1160-v4l.c:(.text+0xd4afa): undefined reference to `usb_submit_urb'
      stk1160-v4l.c:(.text+0xd4ba3): undefined reference to `usb_set_interface'
      drivers/built-in.o: In function `stk1160_isoc_irq':
      stk1160-video.c:(.text+0xd509b): undefined reference to `usb_submit_urb'
      drivers/built-in.o: In function `stk1160_cancel_isoc':
      (.text+0xd50ef): undefined reference to `usb_kill_urb'
      drivers/built-in.o: In function `stk1160_free_isoc':
      (.text+0xd5155): undefined reference to `usb_free_coherent'
      drivers/built-in.o: In function `stk1160_free_isoc':
      (.text+0xd515d): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `stk1160_alloc_isoc':
      (.text+0xd5278): undefined reference to `usb_alloc_urb'
      drivers/built-in.o: In function `stk1160_alloc_isoc':
      (.text+0xd52c2): undefined reference to `usb_alloc_coherent'
      drivers/built-in.o: In function `stk1160_alloc_isoc':
      (.text+0xd53c4): undefined reference to `usb_free_urb'
      drivers/built-in.o: In function `zr364xx_driver_init':
      zr364xx.c:(.init.text+0x463e): undefined reference to `usb_register_driver'
      drivers/built-in.o: In function `pvr_init':
      pvrusb2-main.c:(.init.text+0x4662): undefined reference to `usb_register_driver'
      drivers/built-in.o: In function `stk1160_usb_driver_init':
      stk1160-core.c:(.init.text+0x467d): undefined reference to `usb_register_driver'
      drivers/built-in.o: In function `zr364xx_driver_exit':
      zr364xx.c:(.exit.text+0x1377): undefined reference to `usb_deregister'
      drivers/built-in.o: In function `pvr_exit':
      pvrusb2-main.c:(.exit.text+0x1389): undefined reference to `usb_deregister'
      drivers/built-in.o: In function `stk1160_usb_driver_exit':
      stk1160-core.c:(.exit.text+0x13a0): undefined reference to `usb_deregister'
      Suggested-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3db27a31