1. 16 9月, 2016 10 次提交
    • M
      posix_acl: don't ignore return value of posix_acl_create_masq() · beaf226b
      Miklos Szeredi 提交于
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      beaf226b
    • M
      f2fs: use filemap_check_errors() · 280db3c8
      Miklos Szeredi 提交于
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Cc: Jaegeuk Kim <jaegeuk@kernel.org>
      280db3c8
    • M
      btrfs: use filemap_check_errors() · f0312210
      Miklos Szeredi 提交于
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Reviewed-by: NOmar Sandoval <osandov@fb.com>
      Cc: Chris Mason <clm@fb.com>
      f0312210
    • M
      vfs: do get_write_access() on upper layer of overlayfs · 4d0c5ba2
      Miklos Szeredi 提交于
      The problem with writecount is: we want consistent handling of it for
      underlying filesystems as well as overlayfs.  Making sure i_writecount is
      correct on all layers is difficult.  Instead this patch makes sure that
      when write access is acquired, it's always done on the underlying writable
      layer (called the upper layer).  We must also make sure to look at the
      writecount on this layer when checking for conflicting leases.
      
      Open for write already updates the upper layer's writecount.  Leaving only
      truncate.
      
      For truncate copy up must happen before get_write_access() so that the
      writecount is updated on the upper layer.  Problem with this is if
      something fails after that, then copy-up was done needlessly.  E.g. if
      break_lease() was interrupted.  Probably not a big deal in practice.
      
      Another interesting case is if there's a denywrite on a lower file that is
      then opened for write or truncated.  With this patch these will succeed,
      which is somewhat counterintuitive.  But I think it's still acceptable,
      considering that the copy-up does actually create a different file, so the
      old, denywrite mapping won't be touched.
      
      On non-overlayfs d_real() is an identity function and d_real_inode() is
      equivalent to d_inode() so this patch doesn't change behavior in that case.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Acked-by: NJeff Layton <jlayton@poochiereds.net>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      4d0c5ba2
    • M
      vfs: make argument of d_real_inode() const · 7b1742eb
      Miklos Szeredi 提交于
      d_op->d_real() leaves the dentry alone except if the third argument is
      non-zero.  Unfortunately very difficult to explain to the compiler without
      a cast.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Acked-by: NJeff Layton <jlayton@poochiereds.net>
      7b1742eb
    • M
      locks: fix file locking on overlayfs · c568d683
      Miklos Szeredi 提交于
      This patch allows flock, posix locks, ofd locks and leases to work
      correctly on overlayfs.
      
      Instead of using the underlying inode for storing lock context use the
      overlay inode.  This allows locks to be persistent across copy-up.
      
      This is done by introducing locks_inode() helper and using it instead of
      file_inode() to get the inode in locking code.  For non-overlayfs the two
      are equivalent, except for an extra pointer dereference in locks_inode().
      
      Since lock operations are in "struct file_operations" we must also make
      sure not to call underlying filesystem's lock operations.  Introcude a
      super block flag MS_NOREMOTELOCK to this effect.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Acked-by: NJeff Layton <jlayton@poochiereds.net>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      c568d683
    • A
      fsnotify: support overlayfs · f3fbbb07
      Aihua Zhang 提交于
      When an event occurs direct it to the overlay inode instead of the real
      underlying inode.
      
      This will work even if the file was first on the lower layer and then
      copied up, while the watch is there.  This is because the watch is on the
      overlay inode, which stays the same through the copy-up.
      
      For filesystems other than overlayfs this is a no-op, except for the
      performance impact of an extra pointer dereferece.
      
      Verified to work correctly with the inotify/fanotify tests in LTP.
      Signed-off-by: NAihua Zhang <zhangaihua1@huawei.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Eric Paris <eparis@redhat.com>
      f3fbbb07
    • M
      vfs: update ovl inode before relatime check · 598e3c8f
      Miklos Szeredi 提交于
      On overlayfs relatime_need_update() needs inode times to be correct on
      overlay inode.  But i_mtime and i_ctime are updated by filesystem code on
      underlying inode only, so they will be out-of-date on the overlay inode.
      
      This patch copies the times from the underlying inode if needed.  This
      can't be done if called from RCU lookup (link following) but link m/ctime
      are not updated by fs, so this is all right.
      
      This patch doesn't change functionality for anything but overlayfs.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      598e3c8f
    • M
      vfs: move permission checking into notify_change() for utimes(NULL) · f2b20f6e
      Miklos Szeredi 提交于
      This fixes a bug where the permission was not properly checked in
      overlayfs.  The testcase is ltp/utimensat01.
      
      It is also cleaner and safer to do the permission checking in the vfs
      helper instead of the caller.
      
      This patch introduces an additional ia_valid flag ATTR_TOUCH (since
      touch(1) is the most obvious user of utimes(NULL)) that is passed into
      notify_change whenever the conditions for this special permission checking
      mode are met.
      Reported-by: NAihua Zhang <zhangaihua1@huawei.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Tested-by: NAihua Zhang <zhangaihua1@huawei.com>
      Cc: <stable@vger.kernel.org> # v3.18+
      f2b20f6e
    • M
      ima: use file_dentry() · e71b9dff
      Miklos Szeredi 提交于
      Ima tries to call ->setxattr() on overlayfs dentry after having locked
      underlying inode, which results in a deadlock.
      Reported-by: NKrisztian Litkey <kli@iki.fi>
      Fixes: 4bacc9c9 ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay")
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Cc: <stable@vger.kernel.org> # v4.2
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      e71b9dff
  2. 12 9月, 2016 4 次提交
    • L
      Linux 4.8-rc6 · 9395452b
      Linus Torvalds 提交于
      9395452b
    • L
      nvme: make NVME_RDMA depend on BLOCK · bd0b841f
      Linus Torvalds 提交于
      Commit aa719874 ("nvme: fabrics drivers don't need the nvme-pci
      driver") removed the dependency on BLK_DEV_NVME, but the cdoe does
      depend on the block layer (which used to be an implicit dependency
      through BLK_DEV_NVME).
      
      Otherwise you get various errors from the kbuild test robot random
      config testing when that happens to hit a configuration with BLOCK
      device support disabled.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Jay Freyensee <james_p_freyensee@linux.intel.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bd0b841f
    • L
      Merge tag 'staging-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 2afe669a
      Linus Torvalds 提交于
      Pull IIO fixes from Greg KH:
       "Here are a few small IIO fixes for 4.8-rc6.
      
        Nothing major, full details are in the shortlog, all of these have
        been in linux-next with no reported issues"
      
      * tag 'staging-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio:core: fix IIO_VAL_FRACTIONAL sign handling
        iio: ensure ret is initialized to zero before entering do loop
        iio: accel: kxsd9: Fix scaling bug
        iio: accel: bmc150: reset chip at init time
        iio: fix pressure data output unit in hid-sensor-attributes
        tools:iio:iio_generic_buffer: fix trigger-less mode
      2afe669a
    • L
      Merge tag 'usb-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 61c3dae6
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are some small USB gadget, phy, and xhci fixes for 4.8-rc6.
      
        All of these resolve minor issues that have been reported, and all
        have been in linux-next with no reported issues"
      
      * tag 'usb-4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phase
        xhci: fix null pointer dereference in stop command timeout function
        usb: dwc3: pci: fix build warning on !PM_SLEEP
        usb: gadget: prevent potenial null pointer dereference on skb->len
        usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS condition
        usb: phy: phy-generic: Check clk_prepare_enable() error
        usb: gadget: udc: renesas-usb3: clear VBOUT bit in DRD_CON
        Revert "usb: dwc3: gadget: always decrement by 1"
      61c3dae6
  3. 11 9月, 2016 3 次提交
    • L
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 98ac9a60
      Linus Torvalds 提交于
      Pull libnvdimm fixes from Dan Williams:
       "nvdimm fixes for v4.8, two of them are tagged for -stable:
      
         - Fix devm_memremap_pages() to use track_pfn_insert().  Otherwise,
           DAX pmd mappings end up with an uncached pgprot, and unusable
           performance for the device-dax interface.  The device-dax interface
           appeared in 4.7 so this is tagged for -stable.
      
         - Fix a couple VM_BUG_ON() checks in the show_smaps() path to
           understand DAX pmd entries.  This fix is tagged for -stable.
      
         - Fix a mis-merge of the nfit machine-check handler to flip the
           polarity of an if() to match the final version of the patch that
           Vishal sent for 4.8-rc1.  Without this the nfit machine check
           handler never detects / inserts new 'badblocks' entries which
           applications use to identify lost portions of files.
      
         - For test purposes, fix the nvdimm_clear_poison() path to operate on
           legacy / simulated nvdimm memory ranges.  Without this fix a test
           can set badblocks, but never clear them on these ranges.
      
         - Fix the range checking done by dax_dev_pmd_fault().  This is not
           tagged for -stable since this problem is mitigated by specifying
           aligned resources at device-dax setup time.
      
        These patches have appeared in a next release over the past week.  The
        recent rebase you can see in the timestamps was to drop an invalid fix
        as identified by the updated device-dax unit tests [1].  The -mm
        touches have an ack from Andrew"
      
      [1]: "[ndctl PATCH 0/3] device-dax test for recent kernel bugs"
         https://lists.01.org/pipermail/linux-nvdimm/2016-September/006855.html
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        libnvdimm: allow legacy (e820) pmem region to clear bad blocks
        nfit, mce: Fix SPA matching logic in MCE handler
        mm: fix cache mode of dax pmd mappings
        mm: fix show_smap() for zone_device-pmd ranges
        dax: fix mapping size check
      98ac9a60
    • L
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · b8db3714
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
       "Mostly driver bugfixes, but also a few cleanups which are nice to have
        out of the way"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: rk3x: Restore clock settings at resume time
        i2c: Spelling s/acknowedge/acknowledge/
        i2c: designware: save the preset value of DW_IC_SDA_HOLD
        Documentation: i2c: slave-interface: add note for driver development
        i2c: mux: demux-pinctrl: run properly with multiple instances
        i2c: bcm-kona: fix inconsistent indenting
        i2c: rcar: use proper device with dma_mapping_error
        i2c: sh_mobile: use proper device with dma_mapping_error
        i2c: mux: demux-pinctrl: invalidate properly when switching fails
      b8db3714
    • L
      Merge tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 6905732c
      Linus Torvalds 提交于
      Pull fscrypto fixes fromTed Ts'o:
       "Fix some brown-paper-bag bugs for fscrypto, including one one which
        allows a malicious user to set an encryption policy on an empty
        directory which they do not own"
      
      * tag 'for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        fscrypto: require write access to mount to set encryption policy
        fscrypto: only allow setting encryption policy on directories
        fscrypto: add authorization check for setting encryption policy
      6905732c
  4. 10 9月, 2016 18 次提交
  5. 09 9月, 2016 5 次提交
    • L
      Merge tag 'powerpc-4.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 2771fc8e
      Linus Torvalds 提交于
      Pull powerpc fixes from Michael Ellerman:
       "Fixes marked for stable:
         - Don't alias user region to other regions below PAGE_OFFSET from
           Paul Mackerras
         - Fix again csum_partial_copy_generic() on 32-bit from Christophe
           Leroy
         - Fix corrupted PE allocation bitmap on releasing PE from Gavin Shan
      
        Fixes for code merged this cycle:
         - Fix crash on releasing compound PE from Gavin Shan
         - Fix processor numbers in OPAL ICP from Benjamin Herrenschmidt
         - Fix little endian build with CONFIG_KEXEC=n from Thiago Jung
           Bauermann"
      
      * tag 'powerpc-4.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/mm: Don't alias user region to other regions below PAGE_OFFSET
        powerpc/32: Fix again csum_partial_copy_generic()
        powerpc/powernv: Fix corrupted PE allocation bitmap on releasing PE
        powerpc/powernv: Fix crash on releasing compound PE
        powerpc/xics/opal: Fix processor numbers in OPAL ICP
        powerpc/pseries: Fix little endian build with CONFIG_KEXEC=n
      2771fc8e
    • L
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · 53d5f1dc
      Linus Torvalds 提交于
      Pull ARM fixes from Russell King:
       "A few ARM fixes:
      
         - Robin Murphy noticed that the non-secure privileged entry was
           relying on undefined behaviour, which needed to be fixed.
      
         - Vladimir Murzin noticed that prov-v7 fails to build for MMUless
           configurations because a required header file wasn't included.
      
         - A bunch of fixes for StrongARM regressions found while testing
           4.8-rc on such platforms"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: sa1100: clear reset status prior to reboot
        ARM: 8600/1: Enforce some NS-SVC initialisation
        ARM: 8599/1: mm: pull asm/memory.h explicitly
        ARM: sa1100: register clocks early
        ARM: sa1100: fix 3.6864MHz clock
      53d5f1dc
    • G
      Merge tag 'fixes-for-v4.8-rc6' of... · 6b98174b
      Greg Kroah-Hartman 提交于
      Merge tag 'fixes-for-v4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
      
      Felipe writes:
      
      usb: fixes for v4.8-rc6
      
      Unfortunately we have a bogus dwc3 patch leaked through the cracks and
      got merged into Linus' HEAD. That patch ended up causing off-by-1 error
      in our TRB accounting logic. Thankfully John Youn found out the problem
      and we provided a revert to the bogus dwc3 patch in no time.
      
      Apart from this off-by-1 error, we have two fixes to the Renesas drivers,
      a small fix to our generic phy driver, a NULL pointer dereference fix for
      f_eem and a build warning fix in dwc3.
      6b98174b
    • G
      Merge tag 'usb-ci-v4.8-rc6' of... · 1b49dae1
      Greg Kroah-Hartman 提交于
      Merge tag 'usb-ci-v4.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-linus
      
      Peter writes:
      
      Fix the possible kernel panic when the hardware signal is bad for chipidea udc.
      1b49dae1
    • G
      Merge tag 'iio-fixes-for-4.8b' of... · 72d508ad
      Greg Kroah-Hartman 提交于
      Merge tag 'iio-fixes-for-4.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
      
      Jonathan writes:
      
      Second set of IIO fixes for the 4.8 cycle.
      
      We have a big rework of the kxsd9 driver queued up behind the fix below and
      a fix for a recent fix that was marked for stable.
      Hence this fix series is perhaps a little more urgent than average for IIO.
      * core
        - a fix for a fix in the last set.  The recent fix for blocking ops when
         ! task running left a path (unlikely one) in which the function return
         value was not set - so initialise it to 0.
        - The IIO_TYPE_FRACTIONAL code previously didn't cope with negative
        fractions.  Turned out a fix for this was in Analog's tree but hadn't made
        it upstream.
      * bmc150
        - reset chip at init time. At least one board out there ends up coming up
        in an unstable state due to noise during power up.  The reset does no
        harm on other boards.
      * kxsd9
        - Fix a bug in the reported scaling due to failing to set the integer
        part to 0.
      * hid-sensors-pressure
        - Output was in the wrong units to comply with the IIO ABI.
      * tools
        - iio_generic_buffer: Fix the trigger-less mode by ensuring we don't fault
          out for having no trigger when we explicitly said we didn't want to have
          one.
      72d508ad