diff --git a/kernel/drivers/module-bbswitch/pspec.xml b/kernel/drivers/module-bbswitch/pspec.xml index 8525abc7..d58c3eea 100644 --- a/kernel/drivers/module-bbswitch/pspec.xml +++ b/kernel/drivers/module-bbswitch/pspec.xml @@ -11,7 +11,7 @@ Kernel module allowing to switch dedicated graphics card on Optimus laptops kernel module allowing to switch dedicated graphics card on Optimus laptops - kernel-module-headers + kernel-module-headers https://github.com/Bumblebee-Project/bbswitch/archive/v0.8.tar.gz @@ -20,7 +20,7 @@ module-bbswitch - kernel + kernel /lib/modules @@ -34,6 +34,13 @@ + + 2015-06-24 + 0.8 + Rebuild for kernel-4.0.6. + Ertuğrul Erata + ertugrulerata@gmail.com + 2015-06-16 0.8 diff --git a/kernel/drivers/module-broadcom-wl/pspec.xml b/kernel/drivers/module-broadcom-wl/pspec.xml index 081e0d54..c350f25c 100644 --- a/kernel/drivers/module-broadcom-wl/pspec.xml +++ b/kernel/drivers/module-broadcom-wl/pspec.xml @@ -15,7 +15,7 @@ http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_248.tar.gz http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz - kernel-module-headers + kernel-module-headers patch/linux-40.patch @@ -30,7 +30,7 @@ module-broadcom-wl - kernel + kernel module-broadcom-wl-userspace @@ -62,6 +62,13 @@ + + 2015-06-16 + 6.30.223.248 + Rebuild for kernel 4.0.6 + Ertuğrul Erata + ertugrulerata@gmail.com + 2015-06-16 6.30.223.248 diff --git a/kernel/drivers/module-virtualbox-guest/pspec.xml b/kernel/drivers/module-virtualbox-guest/pspec.xml index 86bb5954..b49d1cf6 100644 --- a/kernel/drivers/module-virtualbox-guest/pspec.xml +++ b/kernel/drivers/module-virtualbox-guest/pspec.xml @@ -14,14 +14,14 @@ This package provides the kernel modules needed for mouse integration and shared folder support between VirtualBox host and guest systems. http://source.pisilinux.org/1.0/module-virtualbox-guest-4.3.28.tar.xz - kernel-module-headers + kernel-module-headers module-virtualbox-guest - kernel + kernel baselayout module-virtualbox-guest-userspace @@ -52,6 +52,13 @@ + + 2015-06-24 + 4.3.28 + Rebuild for kernel-4.0.6. + Ertuğrul Erata + ertugrulerata@gmail.com + 2015-06-09 4.3.28 diff --git a/kernel/drivers/module-virtualbox/pspec.xml b/kernel/drivers/module-virtualbox/pspec.xml index 4acb7a10..23befeee 100644 --- a/kernel/drivers/module-virtualbox/pspec.xml +++ b/kernel/drivers/module-virtualbox/pspec.xml @@ -14,14 +14,14 @@ This package provides the kernel support for VirtualBox. http://source.pisilinux.org/1.0/module-virtualbox-4.3.28.tar.xz - kernel-module-headers + kernel-module-headers module-virtualbox - kernel + kernel module-virtualbox-userspace @@ -47,6 +47,13 @@ + + 2015-06-24 + 4.3.28 + Rebuild for kernel-4.0.6. + Ertuğrul Erata + ertugrulerata@gmail.com + 2015-06-09 4.3.28 diff --git a/kernel/kernel/files/configs/kernel-x86_64-config b/kernel/kernel/files/configs/kernel-x86_64-config index 5e9088a3..cf9494d6 100644 --- a/kernel/kernel/files/configs/kernel-x86_64-config +++ b/kernel/kernel/files/configs/kernel-x86_64-config @@ -1095,6 +1095,7 @@ CONFIG_NF_NAT_H323=m CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_AH=m CONFIG_IP_NF_MATCH_ECN=m +CONFIG_IP_NF_MATCH_PSD=m CONFIG_IP_NF_MATCH_RPFILTER=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_FILTER=y @@ -1108,6 +1109,7 @@ CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_TTL=m +CONFIG_IP_NF_TARGET_IFWLOG=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_SECURITY=m CONFIG_IP_NF_ARPTABLES=m @@ -1890,6 +1892,14 @@ CONFIG_SCSI_INITIO=m CONFIG_SCSI_INIA100=m # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set +CONFIG_PPSCSI=m +CONFIG_PPSCSI_T348=m +CONFIG_PPSCSI_T358=m +CONFIG_PPSCSI_VPI0=m +CONFIG_PPSCSI_ONSCSI=m +CONFIG_PPSCSI_SPARCSI=m +CONFIG_PPSCSI_EPSA2=m +CONFIG_PPSCSI_EPST=m CONFIG_SCSI_STEX=m CONFIG_SCSI_SYM53C8XX_2=m CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 @@ -4335,6 +4345,7 @@ CONFIG_DRM_I915=m CONFIG_DRM_I915_KMS=y CONFIG_DRM_I915_FBDEV=y CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT=y +CONFIG_DRM_MACH64=m CONFIG_DRM_MGA=m CONFIG_DRM_SIS=m CONFIG_DRM_VIA=m @@ -5446,6 +5457,7 @@ CONFIG_SAMSUNG_Q10=m CONFIG_APPLE_GMUX=m CONFIG_INTEL_RST=m # CONFIG_INTEL_SMARTCONNECT is not set +CONFIG_SHUTTLE_WMI=m CONFIG_PVPANIC=m CONFIG_CHROME_PLATFORMS=y CONFIG_CHROMEOS_LAPTOP=m @@ -5781,6 +5793,27 @@ CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # CONFIG_UFS_DEBUG is not set # CONFIG_EXOFS_FS is not set +CONFIG_AUFS_FS=y +# CONFIG_AUFS_BRANCH_MAX_127 is not set +# CONFIG_AUFS_BRANCH_MAX_511 is not set +# CONFIG_AUFS_BRANCH_MAX_1023 is not set +CONFIG_AUFS_BRANCH_MAX_32767=y +CONFIG_AUFS_SBILIST=y +CONFIG_AUFS_HNOTIFY=y +CONFIG_AUFS_HFSNOTIFY=y +CONFIG_AUFS_EXPORT=y +CONFIG_AUFS_INO_T_64=y +CONFIG_AUFS_XATTR=y +CONFIG_AUFS_FHSM=y +CONFIG_AUFS_RDU=y +CONFIG_AUFS_SHWH=y +CONFIG_AUFS_BR_RAMFS=y +CONFIG_AUFS_BR_FUSE=y +CONFIG_AUFS_POLL=y +CONFIG_AUFS_BR_HFSPLUS=y +CONFIG_AUFS_BDEV_LOOP=y +CONFIG_AUFS_DEBUG=y +CONFIG_AUFS_MAGIC_SYSRQ=y CONFIG_ORE=m CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=m @@ -6367,3 +6400,12 @@ CONFIG_FONT_SUPPORT=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_ARCH_HAS_SG_CHAIN=y + +# +# Unofficial 3rd party kernel additions +# +CONFIG_NDISWRAPPER=m +CONFIG_RTL8723AS=m +CONFIG_RTL8723BS=m +CONFIG_WLAN_SDIO=y +CONFIG_VIAHSS=m diff --git a/kernel/kernel/files/patches/linux/patch-4.0.6.xz b/kernel/kernel/files/patches/linux/patch-4.0.6.xz new file mode 100644 index 00000000..97f74bc2 Binary files /dev/null and b/kernel/kernel/files/patches/linux/patch-4.0.6.xz differ diff --git a/kernel/kernel/files/patches/mageia/3rd-3rdparty-merge.patch b/kernel/kernel/files/patches/mageia/3rd-3rdparty-merge.patch index 4d9cc095..8c1f8421 100644 --- a/kernel/kernel/files/patches/mageia/3rd-3rdparty-merge.patch +++ b/kernel/kernel/files/patches/mageia/3rd-3rdparty-merge.patch @@ -18,62 +18,62 @@ Signed-off-by: Thomas Backlund scripts/kconfig/Makefile | 31 +++++++++++++++++-------------- 8 files changed, 29 insertions(+), 15 deletions(-) -diff -Nurp linux-3.18-rc6/arch/alpha/Kconfig linux-3.18-rc6-3rdparty/arch/alpha/Kconfig ---- linux-3.18-rc6/arch/alpha/Kconfig 2014-10-05 22:23:04.000000000 +0300 -+++ linux-3.18-rc6-3rdparty/arch/alpha/Kconfig 2014-11-29 21:42:38.015594440 +0200 -@@ -746,3 +746,4 @@ source "crypto/Kconfig" +diff -Nurp linux-4.1/arch/alpha/Kconfig linux-4.1-3rd/arch/alpha/Kconfig +--- linux-4.1/arch/alpha/Kconfig 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/arch/alpha/Kconfig 2015-06-25 20:44:03.221647317 +0200 +@@ -750,3 +750,4 @@ source "crypto/Kconfig" source "lib/Kconfig" +source "3rdparty/Kconfig" -diff -Nurp linux-3.18-rc6/arch/ia64/Kconfig linux-3.18-rc6-3rdparty/arch/ia64/Kconfig ---- linux-3.18-rc6/arch/ia64/Kconfig 2014-10-05 22:23:04.000000000 +0300 -+++ linux-3.18-rc6-3rdparty/arch/ia64/Kconfig 2014-11-29 21:42:38.015594440 +0200 -@@ -646,3 +646,5 @@ source "lib/Kconfig" +diff -Nurp linux-4.1/arch/ia64/Kconfig linux-4.1-3rd/arch/ia64/Kconfig +--- linux-4.1/arch/ia64/Kconfig 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/arch/ia64/Kconfig 2015-06-25 20:44:03.231647227 +0200 +@@ -636,3 +636,5 @@ source "lib/Kconfig" config IOMMU_HELPER def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB) + +source "3rdparty/Kconfig" -diff -Nurp linux-3.18-rc6/arch/mips/Kconfig linux-3.18-rc6-3rdparty/arch/mips/Kconfig ---- linux-3.18-rc6/arch/mips/Kconfig 2014-11-29 21:37:34.434802374 +0200 -+++ linux-3.18-rc6-3rdparty/arch/mips/Kconfig 2014-11-29 21:42:38.015594440 +0200 -@@ -2709,3 +2709,5 @@ source "crypto/Kconfig" +diff -Nurp linux-4.1/arch/mips/Kconfig linux-4.1-3rd/arch/mips/Kconfig +--- linux-4.1/arch/mips/Kconfig 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/arch/mips/Kconfig 2015-06-25 20:44:03.231647227 +0200 +@@ -2893,3 +2893,5 @@ source "crypto/Kconfig" source "lib/Kconfig" source "arch/mips/kvm/Kconfig" + +source "3rdparty/Kconfig" -diff -Nurp linux-3.18-rc6/arch/powerpc/Kconfig linux-3.18-rc6-3rdparty/arch/powerpc/Kconfig ---- linux-3.18-rc6/arch/powerpc/Kconfig 2014-11-29 21:37:34.446802445 +0200 -+++ linux-3.18-rc6-3rdparty/arch/powerpc/Kconfig 2014-11-29 21:42:38.016594446 +0200 -@@ -1081,3 +1081,5 @@ config PPC_LIB_RHEAP +diff -Nurp linux-4.1/arch/powerpc/Kconfig linux-4.1-3rd/arch/powerpc/Kconfig +--- linux-4.1/arch/powerpc/Kconfig 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/arch/powerpc/Kconfig 2015-06-25 20:44:03.231647227 +0200 +@@ -1090,3 +1090,5 @@ config PPC_LIB_RHEAP bool source "arch/powerpc/kvm/Kconfig" + +source "3rdparty/Kconfig" -diff -Nurp linux-3.18-rc6/arch/sparc/Kconfig linux-3.18-rc6-3rdparty/arch/sparc/Kconfig ---- linux-3.18-rc6/arch/sparc/Kconfig 2014-11-29 21:37:34.478802634 +0200 -+++ linux-3.18-rc6-3rdparty/arch/sparc/Kconfig 2014-11-29 21:42:38.016594446 +0200 -@@ -562,3 +562,5 @@ source "security/Kconfig" +diff -Nurp linux-4.1/arch/sparc/Kconfig linux-4.1-3rd/arch/sparc/Kconfig +--- linux-4.1/arch/sparc/Kconfig 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/arch/sparc/Kconfig 2015-06-25 20:44:03.231647227 +0200 +@@ -569,3 +569,5 @@ source "security/Kconfig" source "crypto/Kconfig" source "lib/Kconfig" + +source "3rdparty/Kconfig" -diff -Nurp linux-3.18-rc6/arch/x86/Kconfig linux-3.18-rc6-3rdparty/arch/x86/Kconfig ---- linux-3.18-rc6/arch/x86/Kconfig 2014-11-29 21:37:34.488802693 +0200 -+++ linux-3.18-rc6-3rdparty/arch/x86/Kconfig 2014-11-29 21:42:38.016594446 +0200 -@@ -2509,3 +2509,5 @@ source "crypto/Kconfig" +diff -Nurp linux-4.1/arch/x86/Kconfig linux-4.1-3rd/arch/x86/Kconfig +--- linux-4.1/arch/x86/Kconfig 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/arch/x86/Kconfig 2015-06-25 20:44:03.231647227 +0200 +@@ -2594,3 +2594,5 @@ source "crypto/Kconfig" source "arch/x86/kvm/Kconfig" source "lib/Kconfig" + +source "3rdparty/Kconfig" -diff -Nurp linux-3.18-rc6/Makefile linux-3.18-rc6-3rdparty/Makefile ---- linux-3.18-rc6/Makefile 2014-11-29 21:37:34.352801890 +0200 -+++ linux-3.18-rc6-3rdparty/Makefile 2014-11-29 21:42:38.016594446 +0200 +diff -Nurp linux-4.1/Makefile linux-4.1-3rd/Makefile +--- linux-4.1/Makefile 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/Makefile 2015-06-25 20:44:03.231647227 +0200 @@ -556,7 +556,7 @@ scripts: scripts_basic include/config/au # Objects we will link into vmlinux / subdirs we need to visit @@ -83,87 +83,93 @@ diff -Nurp linux-3.18-rc6/Makefile linux-3.18-rc6-3rdparty/Makefile net-y := net/ libs-y := lib/ core-y := usr/ -diff -Nurp linux-3.18-rc6/scripts/kconfig/Makefile linux-3.18-rc6-3rdparty/scripts/kconfig/Makefile ---- linux-3.18-rc6/scripts/kconfig/Makefile 2014-11-29 21:37:35.487808590 +0200 -+++ linux-3.18-rc6-3rdparty/scripts/kconfig/Makefile 2014-11-29 21:46:48.227071462 +0200 -@@ -14,29 +14,29 @@ endif +diff -Nurp linux-4.1/scripts/kconfig/Makefile linux-4.1-3rd/scripts/kconfig/Makefile +--- linux-4.1/scripts/kconfig/Makefile 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-3rd/scripts/kconfig/Makefile 2015-06-25 20:47:50.109596717 +0200 +@@ -18,26 +18,26 @@ endif # We need this, in case the user has it in its environment unexport CONFIG_ -xconfig: $(obj)/qconf +xconfig: $(obj)/qconf 3rdparty/Makefile - $< $(Kconfig) + $< $(silent) $(Kconfig) -gconfig: $(obj)/gconf +gconfig: $(obj)/gconf 3rdparty/Makefile - $< $(Kconfig) + $< $(silent) $(Kconfig) -menuconfig: $(obj)/mconf +menuconfig: $(obj)/mconf 3rdparty/Makefile - $< $(Kconfig) + $< $(silent) $(Kconfig) -config: $(obj)/conf +config: $(obj)/conf 3rdparty/Makefile - $< --oldaskconfig $(Kconfig) + $< $(silent) --oldaskconfig $(Kconfig) -nconfig: $(obj)/nconf +nconfig: $(obj)/nconf 3rdparty/Makefile - $< $(Kconfig) - --oldconfig: $(obj)/conf -+oldconfig: $(obj)/conf 3rdparty/Makefile - $< --$@ $(Kconfig) + $< $(silent) $(Kconfig) -silentoldconfig: $(obj)/conf +silentoldconfig: $(obj)/conf 3rdparty/Makefile $(Q)mkdir -p include/config include/generated - $< --$@ $(Kconfig) + $< $(silent) --$@ $(Kconfig) -localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf +localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 3rdparty/Makefile $(Q)mkdir -p include/config include/generated $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config $(Q)if [ -f .config ]; then \ -@@ -76,24 +76,24 @@ update-po-config: $(obj)/kxgettext $(obj +@@ -80,7 +80,7 @@ simple-targets := oldconfig allnoconfig + alldefconfig randconfig listnewconfig olddefconfig + PHONY += $(simple-targets) - PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig - --allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf -+allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf 3rdparty/Makefile - $< --$@ $(Kconfig) - - PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig - --listnewconfig olddefconfig: $(obj)/conf -+listnewconfig olddefconfig: $(obj)/conf 3rdparty/Makefile - $< --$@ $(Kconfig) +-$(simple-targets): $(obj)/conf ++$(simple-targets): $(obj)/conf 3rdparty/Makefile + $< $(silent) --$@ $(Kconfig) + PHONY += oldnoconfig savedefconfig defconfig +@@ -88,12 +88,12 @@ PHONY += oldnoconfig savedefconfig defco # oldnoconfig is an alias of olddefconfig, because people already are dependent # on its behavior(sets new symbols to their default value but not 'n') with the # counter-intuitive name. --oldnoconfig: $(obj)/conf -+oldnoconfig: $(obj)/conf 3rdparty/Makefile - $< --olddefconfig $(Kconfig) +-oldnoconfig: olddefconfig ++oldnoconfig: olddefconfig 3rdparty/Makefile -savedefconfig: $(obj)/conf +savedefconfig: $(obj)/conf 3rdparty/Makefile - $< --$@=defconfig $(Kconfig) + $< $(silent) --$@=defconfig $(Kconfig) -defconfig: $(obj)/conf +defconfig: $(obj)/conf 3rdparty/Makefile ifeq ($(KBUILD_DEFCONFIG),) - $< --defconfig $(Kconfig) + $< $(silent) --defconfig $(Kconfig) else @@ -101,7 +101,7 @@ else - $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) endif -%_defconfig: $(obj)/conf +%_defconfig: $(obj)/conf 3rdparty/Makefile - $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) + $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) - configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config) -@@ -178,6 +178,9 @@ gconf-objs := gconf.o zconf.tab.o + configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) +@@ -112,12 +112,12 @@ configfiles=$(wildcard $(srctree)/kernel + +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig + + PHONY += kvmconfig +-kvmconfig: kvm_guest.config ++kvmconfig: kvm_guest.config 3rdparty/Makefile + @: + + PHONY += tinyconfig + tinyconfig: +- $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config ++ $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config 3rdparty/Makefile + + # Help text used by make help + help: +@@ -176,6 +176,9 @@ gconf-objs := gconf.o zconf.tab.o hostprogs-y := conf nconf mconf kxgettext qconf gconf diff --git a/kernel/kernel/files/patches/mageia/3rd-ndiswrapper-4.0-buildfix.patch b/kernel/kernel/files/patches/mageia/3rd-ndiswrapper-4.0-buildfix.patch new file mode 100644 index 00000000..52f39680 --- /dev/null +++ b/kernel/kernel/files/patches/mageia/3rd-ndiswrapper-4.0-buildfix.patch @@ -0,0 +1,32 @@ + +Adapt for strnicmp has been replaced by strncasecmp, +and removed upstream in v4.0-rc1~98: + +From af3cd13501eb04ca61d017ff4406f1cbffafdc04 Mon Sep 17 00:00:00 2001 +From: Rasmus Villemoes +Date: Thu, 12 Feb 2015 15:02:15 -0800 +Subject: lib/string.c: remove strnicmp() + + +Signed-off-by: Thomas Backlund + +--- linux/3rdparty/ndiswrapper/ndis.c.orig ++++ linux/3rdparty/ndiswrapper/ndis.c +@@ -438,7 +438,7 @@ static int read_setting(struct nt_list * + struct wrap_device_setting *setting; + mutex_lock(&loader_mutex); + nt_list_for_each_entry(setting, setting_list, list) { +- if (strnicmp(keyname, setting->name, length) == 0) { ++ if (strncasecmp(keyname, setting->name, length) == 0) { + TRACE2("setting %s='%s'", keyname, setting->value); + mutex_unlock(&loader_mutex); + *param = ndis_encode_setting(setting, type); +@@ -502,7 +502,7 @@ wstdcall void WIN_FUNC(NdisWriteConfigur + + mutex_lock(&loader_mutex); + nt_list_for_each_entry(setting, &nmb->wnd->wd->settings, list) { +- if (strnicmp(keyname, setting->name, ansi.length) == 0) { ++ if (strncasecmp(keyname, setting->name, ansi.length) == 0) { + mutex_unlock(&loader_mutex); + if (ndis_decode_setting(setting, param)) + *status = NDIS_STATUS_FAILURE; diff --git a/kernel/kernel/files/patches/mageia/3rd-rtl8723bs-revert-4.0-changes.patch b/kernel/kernel/files/patches/mageia/3rd-rtl8723bs-revert-4.0-changes.patch deleted file mode 100644 index fbea7652..00000000 --- a/kernel/kernel/files/patches/mageia/3rd-rtl8723bs-revert-4.0-changes.patch +++ /dev/null @@ -1,73 +0,0 @@ - -This reverts the parts of: - -commit 86fe2db84ba7b9a83b60323cd805198ff43136ec -Author: Bastien Nocera -Date: Fri Mar 20 18:28:08 2015 +0100 - - cfg80211: Update for newest mac80211 API - - -that breaks building with 3.19 series kernels. - - - -Signed-off-by: Thomas Backlund - - -diff -Nurp linux/3rdparty/rtl8723bs.rev/include/ioctl_cfg80211.h linux/3rdparty/rtl8723bs/include/ioctl_cfg80211.h ---- linux/3rdparty/rtl8723bs.rev/include/ioctl_cfg80211.h 2015-05-07 17:46:55.000000000 +0300 -+++ linux/3rdparty/rtl8723bs/include/ioctl_cfg80211.h 2015-05-10 14:55:44.744038033 +0300 -@@ -22,10 +22,6 @@ - - #include - --#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) --#error This driver only works with kernel 4.0 --#endif -- - struct rtw_wdev_invit_info { - u8 state; /* 0: req, 1:rep */ - u8 peer_mac[ETH_ALEN]; -diff -Nurp linux/3rdparty/rtl8723bs.rev/os_dep/ioctl_cfg80211.c linux/3rdparty/rtl8723bs/os_dep/ioctl_cfg80211.c ---- linux/3rdparty/rtl8723bs.rev/os_dep/ioctl_cfg80211.c 2015-05-10 14:54:53.241616597 +0300 -+++ linux/3rdparty/rtl8723bs/os_dep/ioctl_cfg80211.c 2015-05-10 14:49:42.766354711 +0300 -@@ -1289,16 +1289,16 @@ static int cfg80211_rtw_get_station(stru - goto exit; - } - -- sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL); -+ sinfo->filled |= STATION_INFO_SIGNAL; - sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.signal_strength); - -- sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE); -+ sinfo->filled |= STATION_INFO_TX_BITRATE; - sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter); - -- sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS); -+ sinfo->filled |= STATION_INFO_RX_PACKETS; - sinfo->rx_packets = sta_rx_data_pkts(psta); - -- sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS); -+ sinfo->filled |= STATION_INFO_TX_PACKETS; - sinfo->tx_packets = psta->sta_stats.tx_pkts; - - } -@@ -2473,6 +2473,7 @@ void rtw_cfg80211_indicate_sta_assoc(_ad - ie_offset = _REASOCREQ_IE_OFFSET_; - - sinfo.filled = 0; -+ sinfo.filled = STATION_INFO_ASSOC_REQ_IES; - sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset; - sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset; - cfg80211_new_sta(ndev, GetAddr2Ptr(pmgmt_frame), &sinfo, GFP_ATOMIC); -@@ -3078,7 +3079,8 @@ static int cfg80211_rtw_dump_station(str - goto exit; - } - memcpy(mac, psta->hwaddr, ETH_ALEN); -- sinfo->filled = BIT(NL80211_STA_INFO_SIGNAL); -+ sinfo->filled = 0; -+ sinfo->filled |= STATION_INFO_SIGNAL; - sinfo->signal = psta->rssi; - - exit: diff --git a/kernel/kernel/files/patches/mageia/Input-psmouse-disable-changing-resolution-rate-scale.patch b/kernel/kernel/files/patches/mageia/Input-psmouse-disable-changing-resolution-rate-scale.patch deleted file mode 100644 index ef5539be..00000000 --- a/kernel/kernel/files/patches/mageia/Input-psmouse-disable-changing-resolution-rate-scale.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 4ec212f003d2430b0b2748b8a3008255f39cfe13 Mon Sep 17 00:00:00 2001 -From: Mathias Gottschlag -Date: Sat, 7 Mar 2015 13:31:45 -0800 -Subject: [PATCH 3/4] Input: psmouse - disable changing resolution/rate/scale - for FocalTech - -These PS/2 commands make some touchpads stop responding, so this commit -adds some dummy functions to replace the generic implementation. Because -scale changes were not encapsulated in a method of struct psmouse yet, this -commit adds a method set_scale to psmouse. - -Signed-off-by: Mathias Gottschlag -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/focaltech.c | 25 +++++++++++++++++++++++++ - drivers/input/mouse/psmouse-base.c | 14 +++++++++++++- - drivers/input/mouse/psmouse.h | 6 ++++++ - 3 files changed, 44 insertions(+), 1 deletion(-) - -diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c -index c66e0e0..891a271 100644 ---- a/drivers/input/mouse/focaltech.c -+++ b/drivers/input/mouse/focaltech.c -@@ -386,6 +386,23 @@ static int focaltech_read_size(struct psmouse *psmouse) - - return 0; - } -+ -+void focaltech_set_resolution(struct psmouse *psmouse, unsigned int resolution) -+{ -+ /* not supported yet */ -+} -+ -+static void focaltech_set_rate(struct psmouse *psmouse, unsigned int rate) -+{ -+ /* not supported yet */ -+} -+ -+static void focaltech_set_scale(struct psmouse *psmouse, -+ enum psmouse_scale scale) -+{ -+ /* not supported yet */ -+} -+ - int focaltech_init(struct psmouse *psmouse) - { - struct focaltech_data *priv; -@@ -420,6 +437,14 @@ int focaltech_init(struct psmouse *psmouse) - psmouse->cleanup = focaltech_reset; - /* resync is not supported yet */ - psmouse->resync_time = 0; -+ /* -+ * rate/resolution/scale changes are not supported yet, and -+ * the generic implementations of these functions seem to -+ * confuse some touchpads -+ */ -+ psmouse->set_resolution = focaltech_set_resolution; -+ psmouse->set_rate = focaltech_set_rate; -+ psmouse->set_scale = focaltech_set_scale; - - return 0; - -diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c -index 4ccd01d..8bc6123 100644 ---- a/drivers/input/mouse/psmouse-base.c -+++ b/drivers/input/mouse/psmouse-base.c -@@ -454,6 +454,17 @@ static void psmouse_set_rate(struct psmouse *psmouse, unsigned int rate) - } - - /* -+ * Here we set the mouse scaling. -+ */ -+ -+static void psmouse_set_scale(struct psmouse *psmouse, enum psmouse_scale scale) -+{ -+ ps2_command(&psmouse->ps2dev, NULL, -+ scale == PSMOUSE_SCALE21 ? PSMOUSE_CMD_SETSCALE21 : -+ PSMOUSE_CMD_SETSCALE11); -+} -+ -+/* - * psmouse_poll() - default poll handler. Everyone except for ALPS uses it. - */ - -@@ -689,6 +700,7 @@ static void psmouse_apply_defaults(struct psmouse *psmouse) - - psmouse->set_rate = psmouse_set_rate; - psmouse->set_resolution = psmouse_set_resolution; -+ psmouse->set_scale = psmouse_set_scale; - psmouse->poll = psmouse_poll; - psmouse->protocol_handler = psmouse_process_byte; - psmouse->pktsize = 3; -@@ -1160,7 +1172,7 @@ static void psmouse_initialize(struct psmouse *psmouse) - if (psmouse_max_proto != PSMOUSE_PS2) { - psmouse->set_rate(psmouse, psmouse->rate); - psmouse->set_resolution(psmouse, psmouse->resolution); -- ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSCALE11); -+ psmouse->set_scale(psmouse, PSMOUSE_SCALE11); - } - } - -diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h -index c2ff137..d02e1bd 100644 ---- a/drivers/input/mouse/psmouse.h -+++ b/drivers/input/mouse/psmouse.h -@@ -36,6 +36,11 @@ typedef enum { - PSMOUSE_FULL_PACKET - } psmouse_ret_t; - -+enum psmouse_scale { -+ PSMOUSE_SCALE11, -+ PSMOUSE_SCALE21 -+}; -+ - struct psmouse { - void *private; - struct input_dev *dev; -@@ -67,6 +72,7 @@ struct psmouse { - psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse); - void (*set_rate)(struct psmouse *psmouse, unsigned int rate); - void (*set_resolution)(struct psmouse *psmouse, unsigned int resolution); -+ void (*set_scale)(struct psmouse *psmouse, enum psmouse_scale scale); - - int (*reconnect)(struct psmouse *psmouse); - void (*disconnect)(struct psmouse *psmouse); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/Input-psmouse-disable-palm-detection-in-the-focaltec.patch b/kernel/kernel/files/patches/mageia/Input-psmouse-disable-palm-detection-in-the-focaltec.patch deleted file mode 100644 index a149f053..00000000 --- a/kernel/kernel/files/patches/mageia/Input-psmouse-disable-palm-detection-in-the-focaltec.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 4eb8d6e7e5aa14572bc389e554aad9869188cdcd Mon Sep 17 00:00:00 2001 -From: Mathias Gottschlag -Date: Sat, 7 Mar 2015 13:38:27 -0800 -Subject: [PATCH 4/4] Input: psmouse - disable "palm detection" in the - focaltech driver - -Apparently, the threshold for large contact area seems to be rather low on -some devices, causing the touchpad to frequently freeze during normal -usage. Because we do now know how we are supposed to use the value in -question, this commit just drops the related code completely. - -Signed-off-by: Mathias Gottschlag -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/focaltech.c | 10 ---------- - 1 file changed, 10 deletions(-) - -diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c -index 891a271..23d2594 100644 ---- a/drivers/input/mouse/focaltech.c -+++ b/drivers/input/mouse/focaltech.c -@@ -185,16 +185,6 @@ static void focaltech_process_abs_packet(struct psmouse *psmouse, - - state->pressed = (packet[0] >> 4) & 1; - -- /* -- * packet[5] contains some kind of tool size in the most -- * significant nibble. 0xff is a special value (latching) that -- * signals a large contact area. -- */ -- if (packet[5] == 0xff) { -- state->fingers[finger].valid = false; -- return; -- } -- - state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2]; - state->fingers[finger].y = (packet[3] << 8) | packet[4]; - state->fingers[finger].valid = true; --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/Input-psmouse-ensure-that-focaltech-reports-consiste.patch b/kernel/kernel/files/patches/mageia/Input-psmouse-ensure-that-focaltech-reports-consiste.patch deleted file mode 100644 index 149d2d03..00000000 --- a/kernel/kernel/files/patches/mageia/Input-psmouse-ensure-that-focaltech-reports-consiste.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 679d83ea9390636ded518f533af0cefbade317c7 Mon Sep 17 00:00:00 2001 -From: Mathias Gottschlag -Date: Sat, 7 Mar 2015 13:26:43 -0800 -Subject: [PATCH 2/4] Input: psmouse - ensure that focaltech reports consistent - coordinates - -We don't know whether x_max or y_max really hold the maximum possible -coordinates, and we don't know for sure whether we correctly interpret the -coordinates sent by the touchpad, so we clamp the reported values to -prevent confusion in userspace code. - -Signed-off-by: Mathias Gottschlag -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/focaltech.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c -index e8fafe8..c66e0e0 100644 ---- a/drivers/input/mouse/focaltech.c -+++ b/drivers/input/mouse/focaltech.c -@@ -126,9 +126,17 @@ static void focaltech_report_state(struct psmouse *psmouse) - input_mt_slot(dev, i); - input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); - if (active) { -- input_report_abs(dev, ABS_MT_POSITION_X, finger->x); -+ unsigned int clamped_x, clamped_y; -+ /* -+ * The touchpad might report invalid data, so we clamp -+ * the resulting values so that we do not confuse -+ * userspace. -+ */ -+ clamped_x = clamp(finger->x, 0U, priv->x_max); -+ clamped_y = clamp(finger->y, 0U, priv->y_max); -+ input_report_abs(dev, ABS_MT_POSITION_X, clamped_x); - input_report_abs(dev, ABS_MT_POSITION_Y, -- priv->y_max - finger->y); -+ priv->y_max - clamped_y); - } - } - input_mt_report_pointer_emulation(dev, true); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/Input-psmouse-remove-hardcoded-touchpad-size-from-th.patch b/kernel/kernel/files/patches/mageia/Input-psmouse-remove-hardcoded-touchpad-size-from-th.patch deleted file mode 100644 index 4fbb78e2..00000000 --- a/kernel/kernel/files/patches/mageia/Input-psmouse-remove-hardcoded-touchpad-size-from-th.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 3e9845251926723319fb60c9e546fe42d3d11687 Mon Sep 17 00:00:00 2001 -From: Mathias Gottschlag -Date: Sat, 7 Mar 2015 13:26:06 -0800 -Subject: [PATCH 1/4] Input: psmouse - remove hardcoded touchpad size from the - focaltech driver - -The size has in most cases already been fetched from the touchpad, the -hardcoded values should have been removed. - -Signed-off-by: Mathias Gottschlag -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/focaltech.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c -index 757f78a..e8fafe8 100644 ---- a/drivers/input/mouse/focaltech.c -+++ b/drivers/input/mouse/focaltech.c -@@ -67,9 +67,6 @@ static void focaltech_reset(struct psmouse *psmouse) - - #define FOC_MAX_FINGERS 5 - --#define FOC_MAX_X 2431 --#define FOC_MAX_Y 1663 -- - /* - * Current state of a single finger on the touchpad. - */ -@@ -131,7 +128,7 @@ static void focaltech_report_state(struct psmouse *psmouse) - if (active) { - input_report_abs(dev, ABS_MT_POSITION_X, finger->x); - input_report_abs(dev, ABS_MT_POSITION_Y, -- FOC_MAX_Y - finger->y); -+ priv->y_max - finger->y); - } - } - input_mt_report_pointer_emulation(dev, true); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/Input-psmouse-support-for-the-FocalTech-PS-2-protoco.patch b/kernel/kernel/files/patches/mageia/Input-psmouse-support-for-the-FocalTech-PS-2-protoco.patch deleted file mode 100644 index 8dde13fa..00000000 --- a/kernel/kernel/files/patches/mageia/Input-psmouse-support-for-the-FocalTech-PS-2-protoco.patch +++ /dev/null @@ -1,585 +0,0 @@ -From 05be1d079ec0b3691783e4384b1ada82149ff7d2 Mon Sep 17 00:00:00 2001 -From: Mathias Gottschlag -Date: Mon, 29 Dec 2014 09:26:10 -0800 -Subject: [PATCH] Input: psmouse - support for the FocalTech PS/2 protocol - extensions - -Most of the protocol for these touchpads has been reverse engineered. This -commit adds a basic multitouch-capable driver. - -A lot of the protocol is still unknown. Especially, we don't know how to -identify the device yet apart from the PNP ID. - -The previous workaround for these devices has been left in place in case -the driver is not compiled into the kernel or in case some other device -with the same PNP ID is not recognized by the driver yet still has the same -problems with the device probing code. - -Signed-off-by: Mathias Gottschlag -Reviewed-by: Hans de Goede -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/Kconfig | 10 + - drivers/input/mouse/focaltech.c | 408 ++++++++++++++++++++++++++++++++++++- - drivers/input/mouse/focaltech.h | 2 + - drivers/input/mouse/psmouse-base.c | 32 ++- - drivers/input/mouse/psmouse.h | 1 + - 5 files changed, 436 insertions(+), 17 deletions(-) - -diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig -index d8b46b0..2541bfa 100644 ---- a/drivers/input/mouse/Kconfig -+++ b/drivers/input/mouse/Kconfig -@@ -146,6 +146,16 @@ config MOUSE_PS2_OLPC - - If unsure, say N. - -+config MOUSE_PS2_FOCALTECH -+ bool "FocalTech PS/2 mouse protocol extension" if EXPERT -+ default y -+ depends on MOUSE_PS2 -+ help -+ Say Y here if you have a FocalTech PS/2 TouchPad connected to -+ your system. -+ -+ If unsure, say Y. -+ - config MOUSE_SERIAL - tristate "Serial mouse" - select SERIO -diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c -index f4d657e..fca38ba 100644 ---- a/drivers/input/mouse/focaltech.c -+++ b/drivers/input/mouse/focaltech.c -@@ -2,6 +2,7 @@ - * Focaltech TouchPad PS/2 mouse driver - * - * Copyright (c) 2014 Red Hat Inc. -+ * Copyright (c) 2014 Mathias Gottschlag - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -13,15 +14,14 @@ - * Hans de Goede - */ - --/* -- * The Focaltech PS/2 touchpad protocol is unknown. This drivers deals with -- * detection only, to avoid further detection attempts confusing the touchpad -- * this way it at least works in PS/2 mouse compatibility mode. -- */ - - #include - #include -+#include -+#include -+#include - #include "psmouse.h" -+#include "focaltech.h" - - static const char * const focaltech_pnp_ids[] = { - "FLT0101", -@@ -30,6 +30,12 @@ static const char * const focaltech_pnp_ids[] = { - NULL - }; - -+/* -+ * Even if the kernel is built without support for Focaltech PS/2 touchpads (or -+ * when the real driver fails to recognize the device), we still have to detect -+ * them in order to avoid further detection attempts confusing the touchpad. -+ * This way it at least works in PS/2 mouse compatibility mode. -+ */ - int focaltech_detect(struct psmouse *psmouse, bool set_properties) - { - if (!psmouse_matches_pnp_id(psmouse, focaltech_pnp_ids)) -@@ -37,16 +43,404 @@ int focaltech_detect(struct psmouse *psmouse, bool set_properties) - - if (set_properties) { - psmouse->vendor = "FocalTech"; -- psmouse->name = "FocalTech Touchpad in mouse emulation mode"; -+ psmouse->name = "FocalTech Touchpad"; - } - - return 0; - } - --int focaltech_init(struct psmouse *psmouse) -+static void focaltech_reset(struct psmouse *psmouse) - { - ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS); - psmouse_reset(psmouse); -+} -+ -+#ifdef CONFIG_MOUSE_PS2_FOCALTECH -+ -+/* -+ * Packet types - the numbers are not consecutive, so we might be missing -+ * something here. -+ */ -+#define FOC_TOUCH 0x3 /* bitmap of active fingers */ -+#define FOC_ABS 0x6 /* absolute position of one finger */ -+#define FOC_REL 0x9 /* relative position of 1-2 fingers */ -+ -+#define FOC_MAX_FINGERS 5 -+ -+#define FOC_MAX_X 2431 -+#define FOC_MAX_Y 1663 -+ -+/* -+ * Current state of a single finger on the touchpad. -+ */ -+struct focaltech_finger_state { -+ /* The touchpad has generated a touch event for the finger */ -+ bool active; -+ -+ /* -+ * The touchpad has sent position data for the finger. The -+ * flag is 0 when the finger is not active, and there is a -+ * time between the first touch event for the finger and the -+ * following absolute position packet for the finger where the -+ * touchpad has declared the finger to be valid, but we do not -+ * have any valid position yet. -+ */ -+ bool valid; -+ -+ /* -+ * Absolute position (from the bottom left corner) of the -+ * finger. -+ */ -+ unsigned int x; -+ unsigned int y; -+}; -+ -+/* -+ * Description of the current state of the touchpad hardware. -+ */ -+struct focaltech_hw_state { -+ /* -+ * The touchpad tracks the positions of the fingers for us, -+ * the array indices correspond to the finger indices returned -+ * in the report packages. -+ */ -+ struct focaltech_finger_state fingers[FOC_MAX_FINGERS]; -+ -+ /* True if the clickpad has been pressed. */ -+ bool pressed; -+}; -+ -+struct focaltech_data { -+ unsigned int x_max, y_max; -+ struct focaltech_hw_state state; -+}; -+ -+static void focaltech_report_state(struct psmouse *psmouse) -+{ -+ struct focaltech_data *priv = psmouse->private; -+ struct focaltech_hw_state *state = &priv->state; -+ struct input_dev *dev = psmouse->dev; -+ int i; -+ -+ for (i = 0; i < FOC_MAX_FINGERS; i++) { -+ struct focaltech_finger_state *finger = &state->fingers[i]; -+ bool active = finger->active && finger->valid; -+ -+ input_mt_slot(dev, i); -+ input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); -+ if (active) { -+ input_report_abs(dev, ABS_MT_POSITION_X, finger->x); -+ input_report_abs(dev, ABS_MT_POSITION_Y, -+ FOC_MAX_Y - finger->y); -+ } -+ } -+ input_mt_report_pointer_emulation(dev, true); -+ -+ input_report_key(psmouse->dev, BTN_LEFT, state->pressed); -+ input_sync(psmouse->dev); -+} -+ -+static void focaltech_process_touch_packet(struct psmouse *psmouse, -+ unsigned char *packet) -+{ -+ struct focaltech_data *priv = psmouse->private; -+ struct focaltech_hw_state *state = &priv->state; -+ unsigned char fingers = packet[1]; -+ int i; -+ -+ state->pressed = (packet[0] >> 4) & 1; -+ -+ /* the second byte contains a bitmap of all fingers touching the pad */ -+ for (i = 0; i < FOC_MAX_FINGERS; i++) { -+ state->fingers[i].active = fingers & 0x1; -+ if (!state->fingers[i].active) { -+ /* -+ * Even when the finger becomes active again, we still -+ * will have to wait for the first valid position. -+ */ -+ state->fingers[i].valid = false; -+ } -+ fingers >>= 1; -+ } -+} -+ -+static void focaltech_process_abs_packet(struct psmouse *psmouse, -+ unsigned char *packet) -+{ -+ struct focaltech_data *priv = psmouse->private; -+ struct focaltech_hw_state *state = &priv->state; -+ unsigned int finger; -+ -+ finger = (packet[1] >> 4) - 1; -+ if (finger >= FOC_MAX_FINGERS) { -+ psmouse_err(psmouse, "Invalid finger in abs packet: %d\n", -+ finger); -+ return; -+ } -+ -+ state->pressed = (packet[0] >> 4) & 1; -+ -+ /* -+ * packet[5] contains some kind of tool size in the most -+ * significant nibble. 0xff is a special value (latching) that -+ * signals a large contact area. -+ */ -+ if (packet[5] == 0xff) { -+ state->fingers[finger].valid = false; -+ return; -+ } -+ -+ state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2]; -+ state->fingers[finger].y = (packet[3] << 8) | packet[4]; -+ state->fingers[finger].valid = true; -+} -+ -+static void focaltech_process_rel_packet(struct psmouse *psmouse, -+ unsigned char *packet) -+{ -+ struct focaltech_data *priv = psmouse->private; -+ struct focaltech_hw_state *state = &priv->state; -+ int finger1, finger2; -+ -+ state->pressed = packet[0] >> 7; -+ finger1 = ((packet[0] >> 4) & 0x7) - 1; -+ if (finger1 < FOC_MAX_FINGERS) { -+ state->fingers[finger1].x += (char)packet[1]; -+ state->fingers[finger1].y += (char)packet[2]; -+ } else { -+ psmouse_err(psmouse, "First finger in rel packet invalid: %d\n", -+ finger1); -+ } -+ -+ /* -+ * If there is an odd number of fingers, the last relative -+ * packet only contains one finger. In this case, the second -+ * finger index in the packet is 0 (we subtract 1 in the lines -+ * above to create array indices, so the finger will overflow -+ * and be above FOC_MAX_FINGERS). -+ */ -+ finger2 = ((packet[3] >> 4) & 0x7) - 1; -+ if (finger2 < FOC_MAX_FINGERS) { -+ state->fingers[finger2].x += (char)packet[4]; -+ state->fingers[finger2].y += (char)packet[5]; -+ } -+} -+ -+static void focaltech_process_packet(struct psmouse *psmouse) -+{ -+ unsigned char *packet = psmouse->packet; -+ -+ switch (packet[0] & 0xf) { -+ case FOC_TOUCH: -+ focaltech_process_touch_packet(psmouse, packet); -+ break; -+ -+ case FOC_ABS: -+ focaltech_process_abs_packet(psmouse, packet); -+ break; -+ -+ case FOC_REL: -+ focaltech_process_rel_packet(psmouse, packet); -+ break; -+ -+ default: -+ psmouse_err(psmouse, "Unknown packet type: %02x\n", packet[0]); -+ break; -+ } -+ -+ focaltech_report_state(psmouse); -+} -+ -+static psmouse_ret_t focaltech_process_byte(struct psmouse *psmouse) -+{ -+ if (psmouse->pktcnt >= 6) { /* Full packet received */ -+ focaltech_process_packet(psmouse); -+ return PSMOUSE_FULL_PACKET; -+ } -+ -+ /* -+ * We might want to do some validation of the data here, but -+ * we do not know the protocol well enough -+ */ -+ return PSMOUSE_GOOD_DATA; -+} -+ -+static int focaltech_switch_protocol(struct psmouse *psmouse) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ unsigned char param[3]; -+ -+ param[0] = 0; -+ if (ps2_command(ps2dev, param, 0x10f8)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, 0x10f8)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, 0x10f8)) -+ return -EIO; -+ -+ param[0] = 1; -+ if (ps2_command(ps2dev, param, 0x10f8)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETSCALE11)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_ENABLE)) -+ return -EIO; -+ -+ return 0; -+} -+ -+static void focaltech_disconnect(struct psmouse *psmouse) -+{ -+ focaltech_reset(psmouse); -+ kfree(psmouse->private); -+ psmouse->private = NULL; -+} -+ -+static int focaltech_reconnect(struct psmouse *psmouse) -+{ -+ int error; -+ -+ focaltech_reset(psmouse); -+ -+ error = focaltech_switch_protocol(psmouse); -+ if (error) { -+ psmouse_err(psmouse, "Unable to initialize the device\n"); -+ return error; -+ } -+ -+ return 0; -+} -+ -+static void focaltech_set_input_params(struct psmouse *psmouse) -+{ -+ struct input_dev *dev = psmouse->dev; -+ struct focaltech_data *priv = psmouse->private; -+ -+ /* -+ * Undo part of setup done for us by psmouse core since touchpad -+ * is not a relative device. -+ */ -+ __clear_bit(EV_REL, dev->evbit); -+ __clear_bit(REL_X, dev->relbit); -+ __clear_bit(REL_Y, dev->relbit); -+ __clear_bit(BTN_RIGHT, dev->keybit); -+ __clear_bit(BTN_MIDDLE, dev->keybit); -+ -+ /* -+ * Now set up our capabilities. -+ */ -+ __set_bit(EV_ABS, dev->evbit); -+ input_set_abs_params(dev, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0); -+ input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, priv->y_max, 0, 0); -+ input_mt_init_slots(dev, 5, INPUT_MT_POINTER); -+ __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); -+} -+ -+static int focaltech_read_register(struct ps2dev *ps2dev, int reg, -+ unsigned char *param) -+{ -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETSCALE11)) -+ return -EIO; -+ -+ param[0] = 0; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) -+ return -EIO; -+ -+ param[0] = reg; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ return -EIO; -+ -+ return 0; -+} -+ -+static int focaltech_read_size(struct psmouse *psmouse) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ struct focaltech_data *priv = psmouse->private; -+ char param[3]; -+ -+ if (focaltech_read_register(ps2dev, 2, param)) -+ return -EIO; -+ -+ /* not sure whether this is 100% correct */ -+ priv->x_max = (unsigned char)param[1] * 128; -+ priv->y_max = (unsigned char)param[2] * 128; -+ -+ return 0; -+} -+int focaltech_init(struct psmouse *psmouse) -+{ -+ struct focaltech_data *priv; -+ int error; -+ -+ psmouse->private = priv = kzalloc(sizeof(struct focaltech_data), -+ GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ focaltech_reset(psmouse); -+ -+ error = focaltech_read_size(psmouse); -+ if (error) { -+ psmouse_err(psmouse, -+ "Unable to read the size of the touchpad\n"); -+ goto fail; -+ } -+ -+ error = focaltech_switch_protocol(psmouse); -+ if (error) { -+ psmouse_err(psmouse, "Unable to initialize the device\n"); -+ goto fail; -+ } -+ -+ focaltech_set_input_params(psmouse); -+ -+ psmouse->protocol_handler = focaltech_process_byte; -+ psmouse->pktsize = 6; -+ psmouse->disconnect = focaltech_disconnect; -+ psmouse->reconnect = focaltech_reconnect; -+ psmouse->cleanup = focaltech_reset; -+ /* resync is not supported yet */ -+ psmouse->resync_time = 0; - - return 0; -+ -+fail: -+ focaltech_reset(psmouse); -+ kfree(priv); -+ return error; - } -+ -+bool focaltech_supported(void) -+{ -+ return true; -+} -+ -+#else /* CONFIG_MOUSE_PS2_FOCALTECH */ -+ -+int focaltech_init(struct psmouse *psmouse) -+{ -+ focaltech_reset(psmouse); -+ -+ return 0; -+} -+ -+bool focaltech_supported(void) -+{ -+ return false; -+} -+ -+#endif /* CONFIG_MOUSE_PS2_FOCALTECH */ -diff --git a/drivers/input/mouse/focaltech.h b/drivers/input/mouse/focaltech.h -index 498650c..71870a9 100644 ---- a/drivers/input/mouse/focaltech.h -+++ b/drivers/input/mouse/focaltech.h -@@ -2,6 +2,7 @@ - * Focaltech TouchPad PS/2 mouse driver - * - * Copyright (c) 2014 Red Hat Inc. -+ * Copyright (c) 2014 Mathias Gottschlag - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -18,5 +19,6 @@ - - int focaltech_detect(struct psmouse *psmouse, bool set_properties); - int focaltech_init(struct psmouse *psmouse); -+bool focaltech_supported(void); - - #endif -diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c -index 26994f6..4a9de33 100644 ---- a/drivers/input/mouse/psmouse-base.c -+++ b/drivers/input/mouse/psmouse-base.c -@@ -725,16 +725,19 @@ static int psmouse_extensions(struct psmouse *psmouse, - - /* Always check for focaltech, this is safe as it uses pnp-id matching */ - if (psmouse_do_detect(focaltech_detect, psmouse, set_properties) == 0) { -- if (!set_properties || focaltech_init(psmouse) == 0) { -- /* -- * Not supported yet, use bare protocol. -- * Note that we need to also restrict -- * psmouse_max_proto so that psmouse_initialize() -- * does not try to reset rate and resolution, -- * because even that upsets the device. -- */ -- psmouse_max_proto = PSMOUSE_PS2; -- return PSMOUSE_PS2; -+ if (max_proto > PSMOUSE_IMEX) { -+ if (!set_properties || focaltech_init(psmouse) == 0) { -+ if (focaltech_supported()) -+ return PSMOUSE_FOCALTECH; -+ /* -+ * Note that we need to also restrict -+ * psmouse_max_proto so that psmouse_initialize() -+ * does not try to reset rate and resolution, -+ * because even that upsets the device. -+ */ -+ psmouse_max_proto = PSMOUSE_PS2; -+ return PSMOUSE_PS2; -+ } - } - } - -@@ -1063,6 +1066,15 @@ static const struct psmouse_protocol psmouse_protocols[] = { - .alias = "cortps", - .detect = cortron_detect, - }, -+#ifdef CONFIG_MOUSE_PS2_FOCALTECH -+ { -+ .type = PSMOUSE_FOCALTECH, -+ .name = "FocalTechPS/2", -+ .alias = "focaltech", -+ .detect = focaltech_detect, -+ .init = focaltech_init, -+ }, -+#endif - { - .type = PSMOUSE_AUTO, - .name = "auto", -diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h -index f4cf664..c2ff137 100644 ---- a/drivers/input/mouse/psmouse.h -+++ b/drivers/input/mouse/psmouse.h -@@ -96,6 +96,7 @@ enum psmouse_type { - PSMOUSE_FSP, - PSMOUSE_SYNAPTICS_RELATIVE, - PSMOUSE_CYPRESS, -+ PSMOUSE_FOCALTECH, - PSMOUSE_AUTO /* This one should always be last */ - }; - --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/KVM-ia64-drop-kvm.h-from-installed-user-headers.patch b/kernel/kernel/files/patches/mageia/KVM-ia64-drop-kvm.h-from-installed-user-headers.patch deleted file mode 100644 index e8cbed47..00000000 --- a/kernel/kernel/files/patches/mageia/KVM-ia64-drop-kvm.h-from-installed-user-headers.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 6557bada461afeaa920a189fae2cff7c8fdce39f Mon Sep 17 00:00:00 2001 -From: Mike Frysinger -Date: Mon, 9 Feb 2015 14:24:47 -0500 -Subject: [PATCH] KVM: ia64: drop kvm.h from installed user headers - -The header was deleted, so stop trying to install it. - -Signed-off-by: Mike Frysinger -Signed-off-by: Paolo Bonzini ---- - arch/ia64/include/uapi/asm/Kbuild | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild -index 1b3f5eb..891002b 100644 ---- a/arch/ia64/include/uapi/asm/Kbuild -+++ b/arch/ia64/include/uapi/asm/Kbuild -@@ -18,7 +18,6 @@ header-y += intrinsics.h - header-y += ioctl.h - header-y += ioctls.h - header-y += ipcbuf.h --header-y += kvm.h - header-y += kvm_para.h - header-y += mman.h - header-y += msgbuf.h --- -2.3.0 - diff --git a/kernel/kernel/files/patches/mageia/acpi-ACPICA-Add-Windows-2015-string-to-_OSI-support.patch b/kernel/kernel/files/patches/mageia/acpi-ACPICA-Add-Windows-2015-string-to-_OSI-support.patch deleted file mode 100644 index a665e11d..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-ACPICA-Add-Windows-2015-string-to-_OSI-support.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 796888e942b34cbbd738d9e5478b7d103ee38061 Mon Sep 17 00:00:00 2001 -From: Bob Moore -Date: Mon, 13 Apr 2015 11:50:37 +0800 -Subject: [PATCH] ACPICA: Add "Windows 2015" string to _OSI support. - -ACPICA commit b293f602a67da478ae0bec129e68bd99787d9908 - -This change adds this string for Windows 10. - -Link: https://github.com/acpica/acpica/commit/b293f602 -Signed-off-by: Bob Moore -Signed-off-by: Lv Zheng -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/acpica/utosi.c | 1 + - include/acpi/actypes.h | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c -index 574cd31..44035ab 100644 ---- a/drivers/acpi/acpica/utosi.c -+++ b/drivers/acpi/acpica/utosi.c -@@ -100,6 +100,7 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = { - {"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ - {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */ - {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */ -+ {"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */ - - /* Feature Group Strings */ - -diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h -index f18b7a8..ace520f 100644 ---- a/include/acpi/actypes.h -+++ b/include/acpi/actypes.h -@@ -1274,6 +1274,7 @@ struct acpi_memory_list { - #define ACPI_OSI_WIN_VISTA_SP2 0x0A - #define ACPI_OSI_WIN_7 0x0B - #define ACPI_OSI_WIN_8 0x0C -+#define ACPI_OSI_WIN_10 0x0D - - /* Definitions of file IO */ - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/acpi-PNP-add-two-IDs-to-list-for-PNPACPI-device-enum.patch b/kernel/kernel/files/patches/mageia/acpi-PNP-add-two-IDs-to-list-for-PNPACPI-device-enum.patch deleted file mode 100644 index 538e0036..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-PNP-add-two-IDs-to-list-for-PNPACPI-device-enum.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 622532bb2fad8fe342fb685727ae0be566f6be5d Mon Sep 17 00:00:00 2001 -From: Witold Szczeponik -Date: Fri, 1 May 2015 19:05:20 +0200 -Subject: [PATCH] ACPI / PNP: add two IDs to list for PNPACPI device - enumeration - -Commit eec15edbb0e1 (ACPI / PNP: use device ID list for PNPACPI device -enumeration) changed the way how ACPI devices are enumerated and when -they are added to the PNP bus. - -However, it broke the sound card support on (at least) a vintage -IBM ThinkPad 600E: with said commit applied, two of the necessary -"CSC01xx" devices are not added to the PNP bus and hence can not be -found during the initialization of the "snd-cs4236" module. As a -consequence, loading "snd-cs4236" causes null pointer exceptions. -The attached patch fixes the problem end re-enables sound on the -IBM ThinkPad 600E. - -Fixes: eec15edbb0e1 (ACPI / PNP: use device ID list for PNPACPI device enumeration) -Signed-off-by: Witold Szczeponik -Cc: 3.16+ # 3.16+ -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/acpi_pnp.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c -index b193f84..ff6d8ad 100644 ---- a/drivers/acpi/acpi_pnp.c -+++ b/drivers/acpi/acpi_pnp.c -@@ -304,6 +304,8 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = { - {"PNPb006"}, - /* cs423x-pnpbios */ - {"CSC0100"}, -+ {"CSC0103"}, -+ {"CSC0110"}, - {"CSC0000"}, - {"GIM0100"}, /* Guillemot Turtlebeach something appears to be cs4232 compatible */ - /* es18xx-pnpbios */ --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/acpi-SBS-Add-5-us-delay-to-fix-SBS-hangs-on-MacBook.patch b/kernel/kernel/files/patches/mageia/acpi-SBS-Add-5-us-delay-to-fix-SBS-hangs-on-MacBook.patch deleted file mode 100644 index 8e932279..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-SBS-Add-5-us-delay-to-fix-SBS-hangs-on-MacBook.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 3349fb64b2927407017d970dd5c4daf3c5ad69f8 Mon Sep 17 00:00:00 2001 -From: Chris Bainbridge -Date: Wed, 29 Apr 2015 21:21:40 +0100 -Subject: [PATCH] ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook - -Commit 7bc5a2bad0b8 'ACPI: Support _OSI("Darwin") correctly' caused -the MacBook firmware to expose the SBS, resulting in intermittent -hangs of several minutes on boot, and failure to detect or report -the battery. Fix this by adding a 5 us delay to the start of each -SMBUS transaction. This timing is the result of experimentation - -hangs were observed with 3 us but never with 5 us. - -Fixes: 7bc5a2bad0b8 'ACPI: Support _OSI("Darwin") correctly' -Link: https://bugzilla.kernel.org/show_bug.cgi?id=94651 -Signed-off-by: Chris Bainbridge -Cc: 3.18+ # 3.18+ -[ rjw: Subject and changelog ] -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/sbshc.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c -index 26e5b50..bf034f8 100644 ---- a/drivers/acpi/sbshc.c -+++ b/drivers/acpi/sbshc.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - #include "sbshc.h" - - #define PREFIX "ACPI: " -@@ -87,6 +88,8 @@ enum acpi_smb_offset { - ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */ - }; - -+static bool macbook; -+ - static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data) - { - return ec_read(hc->offset + address, data); -@@ -132,6 +135,8 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol, - } - - mutex_lock(&hc->lock); -+ if (macbook) -+ udelay(5); - if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp)) - goto end; - if (temp) { -@@ -257,12 +262,29 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, - acpi_handle handle, acpi_ec_query_func func, - void *data); - -+static int macbook_dmi_match(const struct dmi_system_id *d) -+{ -+ pr_debug("Detected MacBook, enabling workaround\n"); -+ macbook = true; -+ return 0; -+} -+ -+static struct dmi_system_id acpi_smbus_dmi_table[] = { -+ { macbook_dmi_match, "Apple MacBook", { -+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), -+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") }, -+ }, -+ { }, -+}; -+ - static int acpi_smbus_hc_add(struct acpi_device *device) - { - int status; - unsigned long long val; - struct acpi_smb_hc *hc; - -+ dmi_check_system(acpi_smbus_dmi_table); -+ - if (!device) - return -EINVAL; - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/acpi-init-Fix-the-ordering-of-acpi_reserve_resources.patch b/kernel/kernel/files/patches/mageia/acpi-init-Fix-the-ordering-of-acpi_reserve_resources.patch deleted file mode 100644 index a42c2876..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-init-Fix-the-ordering-of-acpi_reserve_resources.patch +++ /dev/null @@ -1,56 +0,0 @@ -From b9a5e5e18fbf223502c0b2264c15024e393da928 Mon Sep 17 00:00:00 2001 -From: "Rafael J. Wysocki" -Date: Thu, 7 May 2015 21:19:39 +0200 -Subject: ACPI / init: Fix the ordering of acpi_reserve_resources() - -Since acpi_reserve_resources() is defined as a device_initcall(), -there's no guarantee that it will be executed in the right order -with respect to the rest of the ACPI initialization code. On some -systems this leads to breakage if, for example, the address range -that should be reserved for the ACPI fixed registers is given to -the PCI host bridge instead if the race is won by the wrong code -path. - -Fix this by turning acpi_reserve_resources() into a void function -and calling it directly from within the ACPI initialization sequence. - -Reported-and-tested-by: George McCollister -Link: http://marc.info/?t=143092384600002&r=1&w=2 -Cc: All applicable -Signed-off-by: Rafael J. Wysocki - -diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c -index 39748bb..7ccba39 100644 ---- a/drivers/acpi/osl.c -+++ b/drivers/acpi/osl.c -@@ -182,7 +182,7 @@ static void __init acpi_request_region (struct acpi_generic_address *gas, - request_mem_region(addr, length, desc); - } - --static int __init acpi_reserve_resources(void) -+static void __init acpi_reserve_resources(void) - { - acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length, - "ACPI PM1a_EVT_BLK"); -@@ -211,10 +211,7 @@ static int __init acpi_reserve_resources(void) - if (!(acpi_gbl_FADT.gpe1_block_length & 0x1)) - acpi_request_region(&acpi_gbl_FADT.xgpe1_block, - acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK"); -- -- return 0; - } --device_initcall(acpi_reserve_resources); - - void acpi_os_printf(const char *fmt, ...) - { -@@ -1845,6 +1842,7 @@ acpi_status __init acpi_os_initialize(void) - - acpi_status __init acpi_os_initialize1(void) - { -+ acpi_reserve_resources(); - kacpid_wq = alloc_workqueue("kacpid", 0, 1); - kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1); - kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0); --- -cgit v0.10.2 - diff --git a/kernel/kernel/files/patches/mageia/acpi-sbs-enable-battery-manager-when-present.patch b/kernel/kernel/files/patches/mageia/acpi-sbs-enable-battery-manager-when-present.patch deleted file mode 100644 index f376d0a2..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-sbs-enable-battery-manager-when-present.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 61f8ff693923e4b19748b0e8287b99778f2661c7 Mon Sep 17 00:00:00 2001 -From: Chris Bainbridge -Date: Wed, 22 Apr 2015 16:40:21 +0100 -Subject: ACPI / SBS: Enable battery manager when present - -From: Chris Bainbridge - -commit 61f8ff693923e4b19748b0e8287b99778f2661c7 upstream. - -Commit 9faf6136ff46 (ACPI / SBS: Disable smart battery manager on -Apple) introduced a regression disabling the SBS battery manager. -The battery manager should be marked as present when -acpi_manager_get_info() returns 0. - -Fixes: 9faf6136ff46 (ACPI / SBS: Disable smart battery manager on Apple) -Signed-off-by: Chris Bainbridge -Signed-off-by: Rafael J. Wysocki -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/acpi/sbs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/acpi/sbs.c -+++ b/drivers/acpi/sbs.c -@@ -670,7 +670,7 @@ static int acpi_sbs_add(struct acpi_devi - if (!sbs_manager_broken) { - result = acpi_manager_get_info(sbs); - if (!result) { -- sbs->manager_present = 0; -+ sbs->manager_present = 1; - for (id = 0; id < MAX_SBS_BAT; ++id) - if ((sbs->batteries_supported & (1 << id))) - acpi_battery_add(sbs, id); diff --git a/kernel/kernel/files/patches/mageia/acpi-table-Use-pr_debug-instead-of-pr_info-for-MADT-.patch b/kernel/kernel/files/patches/mageia/acpi-table-Use-pr_debug-instead-of-pr_info-for-MADT-.patch deleted file mode 100644 index ae6d55d1..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-table-Use-pr_debug-instead-of-pr_info-for-MADT-.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 07f438df22886432ff50772446768f65fbbf3ee0 Mon Sep 17 00:00:00 2001 -From: Hanjun Guo -Date: Tue, 24 Mar 2015 14:02:34 +0000 -Subject: [PATCH] ACPI / table: Use pr_debug() instead of pr_info() for MADT - table scanning - -For a normal 8 cpu sockets system, it will up to 240 cpu threads (Xeon E7 -v2 family for now), and we need 240 entries for local apic or local x2apic -in MADT table, so it will be much verbose information printed with a slow -uart console when system booted, this will be even worse with large system -with 16/32 cpu sockets. - -This patch just use pr_debug() instead of pr_info() for ioapic/iosapic, -local apic/x2apic/sapic structures when scanning the MADT table to remove -those verbose information, but leave other structures unchanged. - -CC: Rafael J Wysocki -Acked-by: Rafael J. Wysocki -Acked-by: Olof Johansson -Acked-by: Grant Likely -Tested-by: Timur Tabi -Signed-off-by: Hanjun Guo -Signed-off-by: Will Deacon ---- - drivers/acpi/tables.c | 30 ++++++++++++++++-------------- - 1 file changed, 16 insertions(+), 14 deletions(-) - -diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c -index 93b8152..f4e5b88 100644 ---- a/drivers/acpi/tables.c -+++ b/drivers/acpi/tables.c -@@ -23,6 +23,8 @@ - * - */ - -+/* Uncomment next line to get verbose printout */ -+/* #define DEBUG */ - #define pr_fmt(fmt) "ACPI: " fmt - - #include -@@ -61,9 +63,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) - { - struct acpi_madt_local_apic *p = - (struct acpi_madt_local_apic *)header; -- pr_info("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", -- p->processor_id, p->id, -- (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); -+ pr_debug("LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", -+ p->processor_id, p->id, -+ (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); - } - break; - -@@ -71,9 +73,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) - { - struct acpi_madt_local_x2apic *p = - (struct acpi_madt_local_x2apic *)header; -- pr_info("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", -- p->local_apic_id, p->uid, -- (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); -+ pr_debug("X2APIC (apic_id[0x%02x] uid[0x%02x] %s)\n", -+ p->local_apic_id, p->uid, -+ (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); - } - break; - -@@ -81,8 +83,8 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) - { - struct acpi_madt_io_apic *p = - (struct acpi_madt_io_apic *)header; -- pr_info("IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", -- p->id, p->address, p->global_irq_base); -+ pr_debug("IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", -+ p->id, p->address, p->global_irq_base); - } - break; - -@@ -155,9 +157,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) - { - struct acpi_madt_io_sapic *p = - (struct acpi_madt_io_sapic *)header; -- pr_info("IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", -- p->id, (void *)(unsigned long)p->address, -- p->global_irq_base); -+ pr_debug("IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", -+ p->id, (void *)(unsigned long)p->address, -+ p->global_irq_base); - } - break; - -@@ -165,9 +167,9 @@ void acpi_table_print_madt_entry(struct acpi_subtable_header *header) - { - struct acpi_madt_local_sapic *p = - (struct acpi_madt_local_sapic *)header; -- pr_info("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", -- p->processor_id, p->id, p->eid, -- (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); -+ pr_debug("LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", -+ p->processor_id, p->id, p->eid, -+ (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled"); - } - break; - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/acpi-video-Allow-forcing-native-backlight-on-non-win.patch b/kernel/kernel/files/patches/mageia/acpi-video-Allow-forcing-native-backlight-on-non-win.patch deleted file mode 100644 index 676fb105..00000000 --- a/kernel/kernel/files/patches/mageia/acpi-video-Allow-forcing-native-backlight-on-non-win.patch +++ /dev/null @@ -1,77 +0,0 @@ -From ff92cfe7cbc05c6c62f5b06c7d9090f4c853cd51 Mon Sep 17 00:00:00 2001 -From: Aaron Lu -Date: Wed, 11 Mar 2015 22:09:57 +0100 -Subject: [PATCH] ACPI / video: Allow forcing native backlight on non win8 - machines - -The native backlight behavior (so not registering both the acpi-video -and the vendor backlight driver) can be useful on some non win8 machines -too, so change the behavior of the video.use_native_backlight=1 or 0 -kernel cmdline option to be: if user has set video.use_native_backlight=1 -or 0, use that no matter if it is a win8 system or not. Also, we will -put some known systems into the DMI table to make them either use native -backlight interface or not, and the use_native_backlight_dmi is used to -reflect that. - -Original-by: Hans de Goede -Acked-by: Hans de Goede -Signed-off-by: Aaron Lu -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/video.c | 19 +++++++++++++------ - 1 file changed, 13 insertions(+), 6 deletions(-) - -diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c -index 26eb70c..2f45dca 100644 ---- a/drivers/acpi/video.c -+++ b/drivers/acpi/video.c -@@ -82,9 +82,15 @@ module_param(allow_duplicates, bool, 0644); - * For Windows 8 systems: used to decide if video module - * should skip registering backlight interface of its own. - */ --static int use_native_backlight_param = -1; -+enum { -+ NATIVE_BACKLIGHT_NOT_SET = -1, -+ NATIVE_BACKLIGHT_OFF, -+ NATIVE_BACKLIGHT_ON, -+}; -+ -+static int use_native_backlight_param = NATIVE_BACKLIGHT_NOT_SET; - module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); --static bool use_native_backlight_dmi = true; -+static int use_native_backlight_dmi = NATIVE_BACKLIGHT_NOT_SET; - - static int register_count; - static struct mutex video_list_lock; -@@ -237,15 +243,16 @@ static void acpi_video_switch_brightness(struct work_struct *work); - - static bool acpi_video_use_native_backlight(void) - { -- if (use_native_backlight_param != -1) -+ if (use_native_backlight_param != NATIVE_BACKLIGHT_NOT_SET) - return use_native_backlight_param; -- else -+ else if (use_native_backlight_dmi != NATIVE_BACKLIGHT_NOT_SET) - return use_native_backlight_dmi; -+ return acpi_osi_is_win8(); - } - - bool acpi_video_verify_backlight_support(void) - { -- if (acpi_osi_is_win8() && acpi_video_use_native_backlight() && -+ if (acpi_video_use_native_backlight() && - backlight_device_registered(BACKLIGHT_RAW)) - return false; - return acpi_video_backlight_support(); -@@ -414,7 +421,7 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d) - - static int __init video_disable_native_backlight(const struct dmi_system_id *d) - { -- use_native_backlight_dmi = false; -+ use_native_backlight_dmi = NATIVE_BACKLIGHT_OFF; - return 0; - } - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/alsa-emu10k1-emu10k2-32-bit-dma-mode.patch b/kernel/kernel/files/patches/mageia/alsa-emu10k1-emu10k2-32-bit-dma-mode.patch deleted file mode 100644 index 3761d1dc..00000000 --- a/kernel/kernel/files/patches/mageia/alsa-emu10k1-emu10k2-32-bit-dma-mode.patch +++ /dev/null @@ -1,205 +0,0 @@ -From 7241ea558c6715501e777396b5fc312c372e11d9 Mon Sep 17 00:00:00 2001 -From: Peter Zubaj -Date: Tue, 28 Apr 2015 21:57:29 +0200 -Subject: ALSA: emu10k1: Emu10k2 32 bit DMA mode - -From: Peter Zubaj - -commit 7241ea558c6715501e777396b5fc312c372e11d9 upstream. - -Looks like audigy emu10k2 (probably emu10k1 - sb live too) support two -modes for DMA. Second mode is useful for 64 bit os with more then 2 GB -of ram (fixes problems with big soundfont loading) - -1) 32MB from 2 GB address space using 8192 pages (used now as default) -2) 16MB from 4 GB address space using 4096 pages - -Mode is set using HCFG_EXPANDED_MEM flag in HCFG register. -Also format of emu10k2 page table is then different. - -Signed-off-by: Peter Zubaj -Tested-by: Takashi Iwai -Signed-off-by: Takashi Iwai -Signed-off-by: Greg Kroah-Hartman - ---- - include/sound/emu10k1.h | 14 +++++++++----- - sound/pci/emu10k1/emu10k1_callback.c | 4 ++-- - sound/pci/emu10k1/emu10k1_main.c | 17 ++++++++++++----- - sound/pci/emu10k1/emupcm.c | 2 +- - sound/pci/emu10k1/memory.c | 11 ++++++----- - 5 files changed, 30 insertions(+), 18 deletions(-) - ---- a/include/sound/emu10k1.h -+++ b/include/sound/emu10k1.h -@@ -41,7 +41,8 @@ - - #define EMUPAGESIZE 4096 - #define MAXREQVOICES 8 --#define MAXPAGES 8192 -+#define MAXPAGES0 4096 /* 32 bit mode */ -+#define MAXPAGES1 8192 /* 31 bit mode */ - #define RESERVED 0 - #define NUM_MIDI 16 - #define NUM_G 64 /* use all channels */ -@@ -50,8 +51,7 @@ - - /* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */ - #define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */ --#define AUDIGY_DMA_MASK 0x7fffffffUL /* 31bit FIXME - 32 should work? */ -- /* See ALSA bug #1276 - rlrevell */ -+#define AUDIGY_DMA_MASK 0xffffffffUL /* 32bit mode */ - - #define TMEMSIZE 256*1024 - #define TMEMSIZEREG 4 -@@ -466,8 +466,11 @@ - - #define MAPB 0x0d /* Cache map B */ - --#define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */ --#define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ -+#define MAP_PTE_MASK0 0xfffff000 /* The 20 MSBs of the PTE indexed by the PTI */ -+#define MAP_PTI_MASK0 0x00000fff /* The 12 bit index to one of the 4096 PTE dwords */ -+ -+#define MAP_PTE_MASK1 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */ -+#define MAP_PTI_MASK1 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ - - /* 0x0e, 0x0f: Not used */ - -@@ -1704,6 +1707,7 @@ struct snd_emu10k1 { - unsigned short model; /* subsystem id */ - unsigned int card_type; /* EMU10K1_CARD_* */ - unsigned int ecard_ctrl; /* ecard control bits */ -+ unsigned int address_mode; /* address mode */ - unsigned long dma_mask; /* PCI DMA mask */ - unsigned int delay_pcm_irq; /* in samples */ - int max_cache_pages; /* max memory size / PAGE_SIZE */ ---- a/sound/pci/emu10k1/emu10k1_callback.c -+++ b/sound/pci/emu10k1/emu10k1_callback.c -@@ -415,7 +415,7 @@ start_voice(struct snd_emux_voice *vp) - snd_emu10k1_ptr_write(hw, Z2, ch, 0); - - /* invalidate maps */ -- temp = (hw->silent_page.addr << 1) | MAP_PTI_MASK; -+ temp = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); - snd_emu10k1_ptr_write(hw, MAPA, ch, temp); - snd_emu10k1_ptr_write(hw, MAPB, ch, temp); - #if 0 -@@ -436,7 +436,7 @@ start_voice(struct snd_emux_voice *vp) - snd_emu10k1_ptr_write(hw, CDF, ch, sample); - - /* invalidate maps */ -- temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK; -+ temp = ((unsigned int)hw->silent_page.addr << hw_address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); - snd_emu10k1_ptr_write(hw, MAPA, ch, temp); - snd_emu10k1_ptr_write(hw, MAPB, ch, temp); - ---- a/sound/pci/emu10k1/emu10k1_main.c -+++ b/sound/pci/emu10k1/emu10k1_main.c -@@ -282,7 +282,7 @@ static int snd_emu10k1_init(struct snd_e - snd_emu10k1_ptr_write(emu, TCB, 0, 0); /* taken from original driver */ - snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */ - -- silent_page = (emu->silent_page.addr << 1) | MAP_PTI_MASK; -+ silent_page = (emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); - for (ch = 0; ch < NUM_G; ch++) { - snd_emu10k1_ptr_write(emu, MAPA, ch, silent_page); - snd_emu10k1_ptr_write(emu, MAPB, ch, silent_page); -@@ -348,6 +348,11 @@ static int snd_emu10k1_init(struct snd_e - outl(reg | A_IOCFG_GPOUT0, emu->port + A_IOCFG); - } - -+ if (emu->address_mode == 0) { -+ /* use 16M in 4G */ -+ outl(inl(emu->port + HCFG) | HCFG_EXPANDED_MEM, emu->port + HCFG); -+ } -+ - return 0; - } - -@@ -1877,8 +1882,10 @@ int snd_emu10k1_create(struct snd_card * - - is_audigy = emu->audigy = c->emu10k2_chip; - -+ /* set addressing mode */ -+ emu->address_mode = is_audigy ? 0 : 1; - /* set the DMA transfer mask */ -- emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK; -+ emu->dma_mask = emu->address_mode ? EMU10K1_DMA_MASK : AUDIGY_DMA_MASK; - if (pci_set_dma_mask(pci, emu->dma_mask) < 0 || - pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) { - dev_err(card->dev, -@@ -1903,7 +1910,7 @@ int snd_emu10k1_create(struct snd_card * - - emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT; - if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), -- 32 * 1024, &emu->ptb_pages) < 0) { -+ (emu->address_mode ? 32 : 16) * 1024, &emu->ptb_pages) < 0) { - err = -ENOMEM; - goto error; - } -@@ -2002,8 +2009,8 @@ int snd_emu10k1_create(struct snd_card * - - /* Clear silent pages and set up pointers */ - memset(emu->silent_page.area, 0, PAGE_SIZE); -- silent_page = emu->silent_page.addr << 1; -- for (idx = 0; idx < MAXPAGES; idx++) -+ silent_page = emu->silent_page.addr << emu->address_mode; -+ for (idx = 0; idx < (emu->address_mode ? MAXPAGES1 : MAXPAGES0); idx++) - ((u32 *)emu->ptb_pages.area)[idx] = cpu_to_le32(silent_page | idx); - - /* set up voice indices */ ---- a/sound/pci/emu10k1/emupcm.c -+++ b/sound/pci/emu10k1/emupcm.c -@@ -380,7 +380,7 @@ static void snd_emu10k1_pcm_init_voice(s - snd_emu10k1_ptr_write(emu, Z1, voice, 0); - snd_emu10k1_ptr_write(emu, Z2, voice, 0); - /* invalidate maps */ -- silent_page = ((unsigned int)emu->silent_page.addr << 1) | MAP_PTI_MASK; -+ silent_page = ((unsigned int)emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); - snd_emu10k1_ptr_write(emu, MAPA, voice, silent_page); - snd_emu10k1_ptr_write(emu, MAPB, voice, silent_page); - /* modulation envelope */ ---- a/sound/pci/emu10k1/memory.c -+++ b/sound/pci/emu10k1/memory.c -@@ -34,10 +34,11 @@ - * aligned pages in others - */ - #define __set_ptb_entry(emu,page,addr) \ -- (((u32 *)(emu)->ptb_pages.area)[page] = cpu_to_le32(((addr) << 1) | (page))) -+ (((u32 *)(emu)->ptb_pages.area)[page] = cpu_to_le32(((addr) << (emu->address_mode)) | (page))) - - #define UNIT_PAGES (PAGE_SIZE / EMUPAGESIZE) --#define MAX_ALIGN_PAGES (MAXPAGES / UNIT_PAGES) -+#define MAX_ALIGN_PAGES0 (MAXPAGES0 / UNIT_PAGES) -+#define MAX_ALIGN_PAGES1 (MAXPAGES1 / UNIT_PAGES) - /* get aligned page from offset address */ - #define get_aligned_page(offset) ((offset) >> PAGE_SHIFT) - /* get offset address from aligned page */ -@@ -124,7 +125,7 @@ static int search_empty_map_area(struct - } - page = blk->mapped_page + blk->pages; - } -- size = MAX_ALIGN_PAGES - page; -+ size = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0) - page; - if (size >= max_size) { - *nextp = pos; - return page; -@@ -181,7 +182,7 @@ static int unmap_memblk(struct snd_emu10 - q = get_emu10k1_memblk(p, mapped_link); - end_page = q->mapped_page; - } else -- end_page = MAX_ALIGN_PAGES; -+ end_page = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0); - - /* remove links */ - list_del(&blk->mapped_link); -@@ -307,7 +308,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10 - if (snd_BUG_ON(!emu)) - return NULL; - if (snd_BUG_ON(runtime->dma_bytes <= 0 || -- runtime->dma_bytes >= MAXPAGES * EMUPAGESIZE)) -+ runtime->dma_bytes >= (emu->address_mode ? MAXPAGES1 : MAXPAGES0) * EMUPAGESIZE)) - return NULL; - hdr = emu->memhdr; - if (snd_BUG_ON(!hdr)) diff --git a/kernel/kernel/files/patches/mageia/alsa-emu10k1-fix-card-shortname-string-buffer-overflow.patch b/kernel/kernel/files/patches/mageia/alsa-emu10k1-fix-card-shortname-string-buffer-overflow.patch deleted file mode 100644 index c40ddf8b..00000000 --- a/kernel/kernel/files/patches/mageia/alsa-emu10k1-fix-card-shortname-string-buffer-overflow.patch +++ /dev/null @@ -1,62 +0,0 @@ -From d02260824e2cad626fb2a9d62e27006d34b6dedc Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Mon, 27 Apr 2015 13:00:09 +0200 -Subject: ALSA: emu10k1: Fix card shortname string buffer overflow - -From: Takashi Iwai - -commit d02260824e2cad626fb2a9d62e27006d34b6dedc upstream. - -Some models provide too long string for the shortname that has 32bytes -including the terminator, and it results in a non-terminated string -exposed to the user-space. This isn't too critical, though, as the -string is stopped at the succeeding longname string. - -This patch fixes such entries by dropping "SB" prefix (it's enough to -fit within 32 bytes, so far). Meanwhile, it also changes strcpy() -with strlcpy() to make sure that this kind of problem won't happen in -future, too. - -Signed-off-by: Takashi Iwai -Signed-off-by: Greg Kroah-Hartman - ---- - sound/pci/emu10k1/emu10k1.c | 6 ++++-- - sound/pci/emu10k1/emu10k1_main.c | 4 ++-- - 2 files changed, 6 insertions(+), 4 deletions(-) - ---- a/sound/pci/emu10k1/emu10k1.c -+++ b/sound/pci/emu10k1/emu10k1.c -@@ -183,8 +183,10 @@ static int snd_card_emu10k1_probe(struct - } - #endif - -- strcpy(card->driver, emu->card_capabilities->driver); -- strcpy(card->shortname, emu->card_capabilities->name); -+ strlcpy(card->driver, emu->card_capabilities->driver, -+ sizeof(card->driver)); -+ strlcpy(card->shortname, emu->card_capabilities->name, -+ sizeof(card->shortname)); - snprintf(card->longname, sizeof(card->longname), - "%s (rev.%d, serial:0x%x) at 0x%lx, irq %i", - card->shortname, emu->revision, emu->serial, emu->port, emu->irq); ---- a/sound/pci/emu10k1/emu10k1_main.c -+++ b/sound/pci/emu10k1/emu10k1_main.c -@@ -1421,7 +1421,7 @@ static struct snd_emu_chip_details emu_c - * - */ - {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102, -- .driver = "Audigy2", .name = "SB Audigy 2 ZS Notebook [SB0530]", -+ .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]", - .id = "Audigy2", - .emu10k2_chip = 1, - .ca0108_chip = 1, -@@ -1571,7 +1571,7 @@ static struct snd_emu_chip_details emu_c - .adc_1361t = 1, /* 24 bit capture instead of 16bit */ - .ac97_chip = 1} , - {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10051102, -- .driver = "Audigy2", .name = "SB Audigy 2 Platinum EX [SB0280]", -+ .driver = "Audigy2", .name = "Audigy 2 Platinum EX [SB0280]", - .id = "Audigy2", - .emu10k2_chip = 1, - .ca0102_chip = 1, diff --git a/kernel/kernel/files/patches/mageia/blk-mq-don-t-lose-requests-if-a-stopped-queue-restar.patch b/kernel/kernel/files/patches/mageia/blk-mq-don-t-lose-requests-if-a-stopped-queue-restar.patch deleted file mode 100644 index ec8e4140..00000000 --- a/kernel/kernel/files/patches/mageia/blk-mq-don-t-lose-requests-if-a-stopped-queue-restar.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 9ba52e5812e53f20f23600d79449a3ec05a0254f Mon Sep 17 00:00:00 2001 -From: Shaohua Li -Date: Mon, 4 May 2015 14:32:48 -0600 -Subject: [PATCH] blk-mq: don't lose requests if a stopped queue restarts - -Normally if driver is busy to dispatch a request the logic is like below: -block layer: driver: - __blk_mq_run_hw_queue -a. blk_mq_stop_hw_queue -b. rq add to ctx->dispatch - -later: -1. blk_mq_start_hw_queue -2. __blk_mq_run_hw_queue - -But it's possible step 1-2 runs between a and b. And since rq isn't in -ctx->dispatch yet, step 2 will not run rq. The rq might get lost if -there are no subsequent requests kick in. - -Signed-off-by: Shaohua Li -Signed-off-by: Jens Axboe ---- - block/blk-mq.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/block/blk-mq.c b/block/blk-mq.c -index 76f460e..e68b71b 100644 ---- a/block/blk-mq.c -+++ b/block/blk-mq.c -@@ -858,6 +858,16 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) - spin_lock(&hctx->lock); - list_splice(&rq_list, &hctx->dispatch); - spin_unlock(&hctx->lock); -+ /* -+ * the queue is expected stopped with BLK_MQ_RQ_QUEUE_BUSY, but -+ * it's possible the queue is stopped and restarted again -+ * before this. Queue restart will dispatch requests. And since -+ * requests in rq_list aren't added into hctx->dispatch yet, -+ * the requests in rq_list might get lost. -+ * -+ * blk_mq_run_hw_queue() already checks the STOPPED bit -+ **/ -+ blk_mq_run_hw_queue(hctx, true); - } - } - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/blk-mq-fix-CPU-hotplug-handling.patch b/kernel/kernel/files/patches/mageia/blk-mq-fix-CPU-hotplug-handling.patch deleted file mode 100644 index 3f6f2fbf..00000000 --- a/kernel/kernel/files/patches/mageia/blk-mq-fix-CPU-hotplug-handling.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 2a34c0872adf252f23a6fef2d051a169ac796cef Mon Sep 17 00:00:00 2001 -From: Ming Lei -Date: Tue, 21 Apr 2015 10:00:20 +0800 -Subject: [PATCH] blk-mq: fix CPU hotplug handling - -hctx->tags has to be set as NULL in case that it is to be unmapped -no matter if set->tags[hctx->queue_num] is NULL or not in blk_mq_map_swqueue() -because shared tags can be freed already from another request queue. - -The same situation has to be considered during handling CPU online too. -Unmapped hw queue can be remapped after CPU topo is changed, so we need -to allocate tags for the hw queue in blk_mq_map_swqueue(). Then tags -allocation for hw queue can be removed in hctx cpu online notifier, and it -is reasonable to do that after mapping is updated. - -Cc: -Reported-by: Dongsu Park -Tested-by: Dongsu Park -Signed-off-by: Ming Lei -Signed-off-by: Jens Axboe ---- - block/blk-mq.c | 34 +++++++++++++--------------------- - 1 file changed, 13 insertions(+), 21 deletions(-) - -diff --git a/block/blk-mq.c b/block/blk-mq.c -index 1fccb98..76f460e 100644 ---- a/block/blk-mq.c -+++ b/block/blk-mq.c -@@ -1574,22 +1574,6 @@ static int blk_mq_hctx_cpu_offline(struc - return NOTIFY_OK; - } - --static int blk_mq_hctx_cpu_online(struct blk_mq_hw_ctx *hctx, int cpu) --{ -- struct request_queue *q = hctx->queue; -- struct blk_mq_tag_set *set = q->tag_set; -- -- if (set->tags[hctx->queue_num]) -- return NOTIFY_OK; -- -- set->tags[hctx->queue_num] = blk_mq_init_rq_map(set, hctx->queue_num); -- if (!set->tags[hctx->queue_num]) -- return NOTIFY_STOP; -- -- hctx->tags = set->tags[hctx->queue_num]; -- return NOTIFY_OK; --} -- - static int blk_mq_hctx_notify(void *data, unsigned long action, - unsigned int cpu) - { -@@ -1597,8 +1581,11 @@ static int blk_mq_hctx_notify(void *data - - if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) - return blk_mq_hctx_cpu_offline(hctx, cpu); -- else if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) -- return blk_mq_hctx_cpu_online(hctx, cpu); -+ -+ /* -+ * In case of CPU online, tags may be reallocated -+ * in blk_mq_map_swqueue() after mapping is updated. -+ */ - - return NOTIFY_OK; - } -@@ -1780,6 +1767,7 @@ static void blk_mq_map_swqueue(struct re - unsigned int i; - struct blk_mq_hw_ctx *hctx; - struct blk_mq_ctx *ctx; -+ struct blk_mq_tag_set *set = q->tag_set; - - queue_for_each_hw_ctx(q, hctx, i) { - cpumask_clear(hctx->cpumask); -@@ -1806,16 +1794,20 @@ static void blk_mq_map_swqueue(struct re - * disable it and free the request entries. - */ - if (!hctx->nr_ctx) { -- struct blk_mq_tag_set *set = q->tag_set; -- - if (set->tags[i]) { - blk_mq_free_rq_map(set, set->tags[i], i); - set->tags[i] = NULL; -- hctx->tags = NULL; - } -+ hctx->tags = NULL; - continue; - } - -+ /* unmapped hw queue can be remapped after CPU topo changed */ -+ if (!set->tags[i]) -+ set->tags[i] = blk_mq_init_rq_map(set, i); -+ hctx->tags = set->tags[i]; -+ WARN_ON(!hctx->tags); -+ - /* - * Initialize batch roundrobin counts - */ diff --git a/kernel/kernel/files/patches/mageia/blk-mq-fix-FUA-request-hang.patch b/kernel/kernel/files/patches/mageia/blk-mq-fix-FUA-request-hang.patch deleted file mode 100644 index 46d66ddb..00000000 --- a/kernel/kernel/files/patches/mageia/blk-mq-fix-FUA-request-hang.patch +++ /dev/null @@ -1,38 +0,0 @@ -From b2387ddcced8de3e6471a2fb16a409577063016f Mon Sep 17 00:00:00 2001 -From: Shaohua Li -Date: Fri, 1 May 2015 09:59:44 -0700 -Subject: [PATCH] blk-mq: fix FUA request hang - -When a FUA request enters its DATA stage of flush pipeline, the -request is added to mq requeue list, the request will then be added to -ctx->rq_list. blk_mq_attempt_merge() might merge the request with a bio. -Later when the request is finished the flush pipeline, the -request->__data_len is 0. Then I only saw the bio gets endio called, the -original request never finish. - -Adding REQ_FLUSH_SEQ into REQ_NOMERGE_FLAGS looks an easy fix. - -stable: 3.15+ - -Signed-off-by: Shaohua Li -Signed-off-by: Jens Axboe ---- - include/linux/blk_types.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h -index a1b25e3..b7299fe 100644 ---- a/include/linux/blk_types.h -+++ b/include/linux/blk_types.h -@@ -220,7 +220,7 @@ enum rq_flag_bits { - - /* This mask is used for both bio and request merge checking */ - #define REQ_NOMERGE_FLAGS \ -- (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) -+ (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_FLUSH_SEQ) - - #define REQ_RAHEAD (1ULL << __REQ_RAHEAD) - #define REQ_THROTTLED (1ULL << __REQ_THROTTLED) --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/blk-mq-fix-race-between-timeout-and-CPU-hotplug.patch b/kernel/kernel/files/patches/mageia/blk-mq-fix-race-between-timeout-and-CPU-hotplug.patch deleted file mode 100644 index cedd2137..00000000 --- a/kernel/kernel/files/patches/mageia/blk-mq-fix-race-between-timeout-and-CPU-hotplug.patch +++ /dev/null @@ -1,62 +0,0 @@ -From f054b56c951bf1731ba7314a4c7f1cc0b2977cc9 Mon Sep 17 00:00:00 2001 -From: Ming Lei -Date: Tue, 21 Apr 2015 10:00:19 +0800 -Subject: [PATCH] blk-mq: fix race between timeout and CPU hotplug - -Firstly during CPU hotplug, even queue is freezed, timeout -handler still may come and access hctx->tags, which may cause -use after free, so this patch deactivates timeout handler -inside CPU hotplug notifier. - -Secondly, tags can be shared by more than one queues, so we -have to check if the hctx has been unmapped, otherwise -still use-after-free on tags can be triggered. - -Cc: -Reported-by: Dongsu Park -Tested-by: Dongsu Park -Signed-off-by: Ming Lei -Signed-off-by: Jens Axboe ---- - block/blk-mq.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/block/blk-mq.c b/block/blk-mq.c -index ade8a2d..1fccb98 100644 ---- a/block/blk-mq.c -+++ b/block/blk-mq.c -@@ -677,8 +677,11 @@ static void blk_mq_rq_timer(unsigned long priv) - data.next = blk_rq_timeout(round_jiffies_up(data.next)); - mod_timer(&q->timeout, data.next); - } else { -- queue_for_each_hw_ctx(q, hctx, i) -- blk_mq_tag_idle(hctx); -+ queue_for_each_hw_ctx(q, hctx, i) { -+ /* the hctx may be unmapped, so check it here */ -+ if (blk_mq_hw_queue_mapped(hctx)) -+ blk_mq_tag_idle(hctx); -+ } - } - } - -@@ -2090,9 +2093,16 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, - */ - list_for_each_entry(q, &all_q_list, all_q_node) - blk_mq_freeze_queue_start(q); -- list_for_each_entry(q, &all_q_list, all_q_node) -+ list_for_each_entry(q, &all_q_list, all_q_node) { - blk_mq_freeze_queue_wait(q); - -+ /* -+ * timeout handler can't touch hw queue during the -+ * reinitialization -+ */ -+ del_timer_sync(&q->timeout); -+ } -+ - list_for_each_entry(q, &all_q_list, all_q_node) - blk_mq_queue_reinit(q); - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/block-Make-CFQ-default-to-IOPS-mode-on-SSDs.patch b/kernel/kernel/files/patches/mageia/block-Make-CFQ-default-to-IOPS-mode-on-SSDs.patch new file mode 100644 index 00000000..b26bf714 --- /dev/null +++ b/kernel/kernel/files/patches/mageia/block-Make-CFQ-default-to-IOPS-mode-on-SSDs.patch @@ -0,0 +1,58 @@ +From 41c0126b3f22ef36b97b3c38b8f29569848a5ce2 Mon Sep 17 00:00:00 2001 +From: Tahsin Erdogan +Date: Tue, 19 May 2015 13:55:21 -0700 +Subject: block: Make CFQ default to IOPS mode on SSDs + +CFQ idling causes reduced IOPS throughput on non-rotational disks. +Since disk head seeking is not applicable to SSDs, it doesn't really +help performance by anticipating future near-by IO requests. + +By turning off idling (and switching to IOPS mode), we allow other +processes to dispatch IO requests down to the driver and so increase IO +throughput. + +Following FIO benchmark results were taken on a cloud SSD offering with +idling on and off: + +Idling iops avg-lat(ms) stddev bw +------------------------------------------------------ + On 7054 90.107 38.697 28217KB/s + Off 29255 21.836 11.730 117022KB/s + +fio --name=temp --size=100G --time_based --ioengine=libaio \ + --randrepeat=0 --direct=1 --invalidate=1 --verify=0 \ + --verify_fatal=0 --rw=randread --blocksize=4k --group_reporting=1 \ + --filename=/dev/sdb --runtime=10 --iodepth=64 --numjobs=10 + +And the following is from a local SSD run: + +Idling iops avg-lat(ms) stddev bw +------------------------------------------------------ + On 19320 33.043 14.068 77281KB/s + Off 21626 29.465 12.662 86507KB/s + +fio --name=temp --size=5G --time_based --ioengine=libaio \ + --randrepeat=0 --direct=1 --invalidate=1 --verify=0 \ + --verify_fatal=0 --rw=randread --blocksize=4k --group_reporting=1 \ + --filename=/fio_data --runtime=10 --iodepth=64 --numjobs=10 + +Reviewed-by: Nauman Rafique +Signed-off-by: Tahsin Erdogan +Signed-off-by: Jens Axboe + +diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c +index 5da8e6e..402be01 100644 +--- a/block/cfq-iosched.c ++++ b/block/cfq-iosched.c +@@ -4460,7 +4460,7 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e) + cfqd->cfq_slice[1] = cfq_slice_sync; + cfqd->cfq_target_latency = cfq_target_latency; + cfqd->cfq_slice_async_rq = cfq_slice_async_rq; +- cfqd->cfq_slice_idle = cfq_slice_idle; ++ cfqd->cfq_slice_idle = blk_queue_nonrot(q) ? 0 : cfq_slice_idle; + cfqd->cfq_group_idle = cfq_group_idle; + cfqd->cfq_latency = 1; + cfqd->hw_tag = -1; +-- +cgit v0.10.2 + diff --git a/kernel/kernel/files/patches/mageia/block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch b/kernel/kernel/files/patches/mageia/block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch new file mode 100644 index 00000000..7d188d69 --- /dev/null +++ b/kernel/kernel/files/patches/mageia/block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch @@ -0,0 +1,95 @@ +From 0bb979472a7401022109e81dd89d777adea58710 Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Wed, 10 Jun 2015 08:01:20 -0600 +Subject: cfq-iosched: fix the setting of IOPS mode on SSDs + +A previous commit wanted to make CFQ default to IOPS mode on +non-rotational storage, however it did so when the queue was +initialized and the non-rotational flag is only set later on +in the probe. + +Add an elevator hook that gets called off the add_disk() path, +at that point we know that feature probing has finished, and +we can reliably check for the various flags that drivers can +set. + +Fixes: 41c0126b ("block: Make CFQ default to IOPS mode on SSDs") +Tested-by: Romain Francoise +Signed-off-by: Jens Axboe + +diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c +index c808ad8..d1d0cb2 100644 +--- a/block/cfq-iosched.c ++++ b/block/cfq-iosched.c +@@ -4508,7 +4508,7 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e) + cfqd->cfq_slice[1] = cfq_slice_sync; + cfqd->cfq_target_latency = cfq_target_latency; + cfqd->cfq_slice_async_rq = cfq_slice_async_rq; +- cfqd->cfq_slice_idle = blk_queue_nonrot(q) ? 0 : cfq_slice_idle; ++ cfqd->cfq_slice_idle = cfq_slice_idle; + cfqd->cfq_group_idle = cfq_group_idle; + cfqd->cfq_latency = 1; + cfqd->hw_tag = -1; +@@ -4525,6 +4525,18 @@ out_free: + return ret; + } + ++static void cfq_registered_queue(struct request_queue *q) ++{ ++ struct elevator_queue *e = q->elevator; ++ struct cfq_data *cfqd = e->elevator_data; ++ ++ /* ++ * Default to IOPS mode with no idling for SSDs ++ */ ++ if (blk_queue_nonrot(q)) ++ cfqd->cfq_slice_idle = 0; ++} ++ + /* + * sysfs parts below --> + */ +@@ -4640,6 +4652,7 @@ static struct elevator_type iosched_cfq = { + .elevator_may_queue_fn = cfq_may_queue, + .elevator_init_fn = cfq_init_queue, + .elevator_exit_fn = cfq_exit_queue, ++ .elevator_registered_fn = cfq_registered_queue, + }, + .icq_size = sizeof(struct cfq_io_cq), + .icq_align = __alignof__(struct cfq_io_cq), +diff --git a/block/elevator.c b/block/elevator.c +index 59794d0..5f04527 100644 +--- a/block/elevator.c ++++ b/block/elevator.c +@@ -810,6 +810,8 @@ int elv_register_queue(struct request_queue *q) + } + kobject_uevent(&e->kobj, KOBJ_ADD); + e->registered = 1; ++ if (e->type->ops.elevator_registered_fn) ++ e->type->ops.elevator_registered_fn(q); + } + return error; + } +diff --git a/include/linux/elevator.h b/include/linux/elevator.h +index 45a9147..638b324 100644 +--- a/include/linux/elevator.h ++++ b/include/linux/elevator.h +@@ -39,6 +39,7 @@ typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct reques + typedef int (elevator_init_fn) (struct request_queue *, + struct elevator_type *e); + typedef void (elevator_exit_fn) (struct elevator_queue *); ++typedef void (elevator_registered_fn) (struct request_queue *); + + struct elevator_ops + { +@@ -68,6 +69,7 @@ struct elevator_ops + + elevator_init_fn *elevator_init_fn; + elevator_exit_fn *elevator_exit_fn; ++ elevator_registered_fn *elevator_registered_fn; + }; + + #define ELV_NAME_MAX (16) +-- +cgit v0.10.2 + diff --git a/kernel/kernel/files/patches/mageia/bluetooth-hci_usb-disable-isoc-transfers.patch b/kernel/kernel/files/patches/mageia/bluetooth-hci_usb-disable-isoc-transfers.patch deleted file mode 100644 index 34ced55d..00000000 --- a/kernel/kernel/files/patches/mageia/bluetooth-hci_usb-disable-isoc-transfers.patch +++ /dev/null @@ -1,23 +0,0 @@ -Add quirk to disable ISOC transfers for device -"ID 1131:1001 Integrated System Solution Corp. KY-BT100 Bluetooth Adapter" -http://qa.mandriva.com/show_bug.cgi?id=30638 - -Signed-off-by: Herton Ronaldo Krzesinski ---- - drivers/bluetooth/btusb.c | 3 +++ - 1 file changed, 3 insertions(+) - -(status: submitted upstream to bluez-devel ML on 2007-09-29) - ---- linux-2.6.28/drivers/bluetooth/btusb.c.orig 2009-02-11 10:29:20.000000000 -0500 -+++ linux-2.6.28/drivers/bluetooth/btusb.c 2009-02-11 10:30:27.000000000 -0500 -@@ -120,6 +120,9 @@ static struct usb_device_id blacklist_ta - /* Kensington Bluetooth USB adapter */ - { USB_DEVICE(0x047d, 0x105e), .driver_info = BTUSB_WRONG_SCO_MTU }, - -+ /* ISSC Bluetooth Adapter v3.1 */ -+ { USB_DEVICE(0x1131, 0x1001), .driver_info = BTUSB_BROKEN_ISOC }, -+ - /* RTX Telecom based adapters with buggy SCO support */ - { USB_DEVICE(0x0400, 0x0807), .driver_info = BTUSB_BROKEN_ISOC }, - { USB_DEVICE(0x0400, 0x080a), .driver_info = BTUSB_BROKEN_ISOC }, diff --git a/kernel/kernel/files/patches/mageia/firmware-efi-Fix-error-handling-in-add_sysfs_runtime_map_entr.patch b/kernel/kernel/files/patches/mageia/firmware-efi-Fix-error-handling-in-add_sysfs_runtime_map_entr.patch deleted file mode 100644 index ae1c331d..00000000 --- a/kernel/kernel/files/patches/mageia/firmware-efi-Fix-error-handling-in-add_sysfs_runtime_map_entr.patch +++ /dev/null @@ -1,55 +0,0 @@ -From d67e199611b986b345ea3087ee2e4a15da1c98b3 Mon Sep 17 00:00:00 2001 -From: Dan Carpenter -Date: Tue, 21 Apr 2015 16:46:28 +0300 -Subject: [PATCH] efi: Fix error handling in add_sysfs_runtime_map_entry() - -I spotted two (difficult to hit) bugs while reviewing this. - -1) There is a double free bug because we unregister "map_kset" in - add_sysfs_runtime_map_entry() and also efi_runtime_map_init(). -2) If we fail to allocate "entry" then we should return - ERR_PTR(-ENOMEM) instead of NULL. - -Signed-off-by: Dan Carpenter -Cc: Dave Young -Cc: Guangyu Sun -Cc: -Signed-off-by: Matt Fleming ---- - drivers/firmware/efi/runtime-map.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c -index 87b8e3b..5c55227 100644 ---- a/drivers/firmware/efi/runtime-map.c -+++ b/drivers/firmware/efi/runtime-map.c -@@ -120,7 +120,8 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr) - entry = kzalloc(sizeof(*entry), GFP_KERNEL); - if (!entry) { - kset_unregister(map_kset); -- return entry; -+ map_kset = NULL; -+ return ERR_PTR(-ENOMEM); - } - - memcpy(&entry->md, efi_runtime_map + nr * efi_memdesc_size, -@@ -132,6 +133,7 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr) - if (ret) { - kobject_put(&entry->kobj); - kset_unregister(map_kset); -+ map_kset = NULL; - return ERR_PTR(ret); - } - -@@ -195,8 +197,6 @@ out_add_entry: - entry = *(map_entries + j); - kobject_put(&entry->kobj); - } -- if (map_kset) -- kset_unregister(map_kset); - out: - return ret; - } --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/fs-aufs-3.19-modular.patch b/kernel/kernel/files/patches/mageia/fs-aufs4-modular.patch similarity index 55% rename from kernel/kernel/files/patches/mageia/fs-aufs-3.19-modular.patch rename to kernel/kernel/files/patches/mageia/fs-aufs4-modular.patch index d172ebbc..c1fa58a0 100644 --- a/kernel/kernel/files/patches/mageia/fs-aufs-3.19-modular.patch +++ b/kernel/kernel/files/patches/mageia/fs-aufs4-modular.patch @@ -1,20 +1,22 @@ fs/aufs/Kconfig | 2 +- fs/dcache.c | 1 + + fs/file_table.c | 2 ++ fs/inode.c | 2 ++ fs/namespace.c | 2 ++ fs/notify/group.c | 4 ++++ fs/notify/mark.c | 4 ++++ - fs/open.c | 1 + + fs/open.c | 2 ++ + fs/read_write.c | 2 ++ fs/splice.c | 2 ++ security/commoncap.c | 2 ++ security/device_cgroup.c | 2 ++ security/security.c | 10 ++++++++++ - 11 files changed, 31 insertions(+), 1 deletion(-) + 13 files changed, 36 insertions(+), 1 deletion(-) -diff -Nurp linux-3.19-aufs/fs/aufs/Kconfig linux-3.19-aufs-modular/fs/aufs/Kconfig ---- linux-3.19-aufs/fs/aufs/Kconfig 2015-02-22 23:16:18.302926737 +0200 -+++ linux-3.19-aufs-modular/fs/aufs/Kconfig 2015-02-22 23:23:41.617919334 +0200 +diff -Nurp linux-4.1-aufs4/fs/aufs/Kconfig linux-4.1-aufs4-mod/fs/aufs/Kconfig +--- linux-4.1-aufs4/fs/aufs/Kconfig 2015-06-25 20:09:18.250319377 +0200 ++++ linux-4.1-aufs4-mod/fs/aufs/Kconfig 2015-06-25 20:11:30.629136790 +0200 @@ -1,5 +1,5 @@ config AUFS_FS - bool "Aufs (Advanced multi layered unification filesystem) support" @@ -22,10 +24,10 @@ diff -Nurp linux-3.19-aufs/fs/aufs/Kconfig linux-3.19-aufs-modular/fs/aufs/Kconf help Aufs is a stackable unification filesystem such as Unionfs, which unifies several directories and provides a merged single -diff -Nurp linux-3.19-aufs/fs/dcache.c linux-3.19-aufs-modular/fs/dcache.c ---- linux-3.19-aufs/fs/dcache.c 2015-02-22 23:16:18.313926786 +0200 -+++ linux-3.19-aufs-modular/fs/dcache.c 2015-02-22 23:23:41.620919348 +0200 -@@ -1124,6 +1124,7 @@ rename_retry: +diff -Nurp linux-4.1-aufs4/fs/dcache.c linux-4.1-aufs4-mod/fs/dcache.c +--- linux-4.1-aufs4/fs/dcache.c 2015-06-25 20:09:18.280319109 +0200 ++++ linux-4.1-aufs4-mod/fs/dcache.c 2015-06-25 20:11:30.629136790 +0200 +@@ -1269,6 +1269,7 @@ rename_retry: seq = 1; goto again; } @@ -33,10 +35,29 @@ diff -Nurp linux-3.19-aufs/fs/dcache.c linux-3.19-aufs-modular/fs/dcache.c /* * Search for at least 1 mount point in the dentry's subdirs. -diff -Nurp linux-3.19-aufs/fs/inode.c linux-3.19-aufs-modular/fs/inode.c ---- linux-3.19-aufs/fs/inode.c 2015-02-22 23:16:18.314926790 +0200 -+++ linux-3.19-aufs-modular/fs/inode.c 2015-02-22 23:23:41.617919334 +0200 -@@ -57,6 +57,7 @@ static struct hlist_head *inode_hashtabl +diff -Nurp linux-4.1-aufs4/fs/file_table.c linux-4.1-aufs4-mod/fs/file_table.c +--- linux-4.1-aufs4/fs/file_table.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/fs/file_table.c 2015-06-25 23:47:57.011958835 +0200 +@@ -147,6 +147,7 @@ over: + } + return ERR_PTR(-ENFILE); + } ++EXPORT_SYMBOL(get_empty_filp); + + /** + * alloc_file - allocate and initialize a 'struct file' +@@ -308,6 +309,7 @@ void put_filp(struct file *file) + file_free(file); + } + } ++EXPORT_SYMBOL(put_filp); + + void __init files_init(unsigned long mempages) + { +diff -Nurp linux-4.1-aufs4/fs/inode.c linux-4.1-aufs4-mod/fs/inode.c +--- linux-4.1-aufs4/fs/inode.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/fs/inode.c 2015-06-25 22:45:45.000000000 +0200 +@@ -58,6 +58,7 @@ static struct hlist_head *inode_hashtabl static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock); __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock); @@ -44,18 +65,18 @@ diff -Nurp linux-3.19-aufs/fs/inode.c linux-3.19-aufs-modular/fs/inode.c /* * Empty aops. Can be used for the cases where the user does not -@@ -1515,6 +1516,7 @@ int update_time(struct inode *inode, str - mark_inode_dirty_sync(inode); - return 0; +@@ -1575,6 +1576,7 @@ static int update_time(struct inode *ino + + return update_time(inode, time, flags); } +EXPORT_SYMBOL(update_time); /** * touch_atime - update the access time -diff -Nurp linux-3.19-aufs/fs/namespace.c linux-3.19-aufs-modular/fs/namespace.c ---- linux-3.19-aufs/fs/namespace.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/fs/namespace.c 2015-02-22 23:23:41.618919339 +0200 -@@ -454,6 +454,7 @@ void __mnt_drop_write(struct vfsmount *m +diff -Nurp linux-4.1-aufs4/fs/namespace.c linux-4.1-aufs4-mod/fs/namespace.c +--- linux-4.1-aufs4/fs/namespace.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/fs/namespace.c 2015-06-25 20:11:30.629136790 +0200 +@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *m mnt_dec_writers(real_mount(mnt)); preempt_enable(); } @@ -63,7 +84,7 @@ diff -Nurp linux-3.19-aufs/fs/namespace.c linux-3.19-aufs-modular/fs/namespace.c /** * mnt_drop_write - give up write access to a mount -@@ -1728,6 +1729,7 @@ int iterate_mounts(int (*f)(struct vfsmo +@@ -1768,6 +1769,7 @@ int iterate_mounts(int (*f)(struct vfsmo } return 0; } @@ -71,9 +92,9 @@ diff -Nurp linux-3.19-aufs/fs/namespace.c linux-3.19-aufs-modular/fs/namespace.c static void cleanup_group_ids(struct mount *mnt, struct mount *end) { -diff -Nurp linux-3.19-aufs/fs/notify/group.c linux-3.19-aufs-modular/fs/notify/group.c ---- linux-3.19-aufs/fs/notify/group.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/fs/notify/group.c 2015-02-22 23:23:41.618919339 +0200 +diff -Nurp linux-4.1-aufs4/fs/notify/group.c linux-4.1-aufs4-mod/fs/notify/group.c +--- linux-4.1-aufs4/fs/notify/group.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/fs/notify/group.c 2015-06-25 20:11:30.629136790 +0200 @@ -22,6 +22,7 @@ #include #include @@ -106,9 +127,9 @@ diff -Nurp linux-3.19-aufs/fs/notify/group.c linux-3.19-aufs-modular/fs/notify/g int fsnotify_fasync(int fd, struct file *file, int on) { -diff -Nurp linux-3.19-aufs/fs/notify/mark.c linux-3.19-aufs-modular/fs/notify/mark.c ---- linux-3.19-aufs/fs/notify/mark.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/fs/notify/mark.c 2015-02-22 23:23:41.618919339 +0200 +diff -Nurp linux-4.1-aufs4/fs/notify/mark.c linux-4.1-aufs4-mod/fs/notify/mark.c +--- linux-4.1-aufs4/fs/notify/mark.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/fs/notify/mark.c 2015-06-25 20:11:30.629136790 +0200 @@ -109,6 +109,7 @@ void fsnotify_put_mark(struct fsnotify_m mark->free_mark(mark); } @@ -141,9 +162,9 @@ diff -Nurp linux-3.19-aufs/fs/notify/mark.c linux-3.19-aufs-modular/fs/notify/ma static int fsnotify_mark_destroy(void *ignored) { -diff -Nurp linux-3.19-aufs/fs/open.c linux-3.19-aufs-modular/fs/open.c ---- linux-3.19-aufs/fs/open.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/fs/open.c 2015-02-22 23:23:41.618919339 +0200 +diff -Nurp linux-4.1-aufs4/fs/open.c linux-4.1-aufs4-mod/fs/open.c +--- linux-4.1-aufs4/fs/open.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/fs/open.c 2015-06-25 23:49:02.741362661 +0200 @@ -62,6 +62,7 @@ int do_truncate(struct dentry *dentry, l mutex_unlock(&dentry->d_inode->i_mutex); return ret; @@ -152,10 +173,37 @@ diff -Nurp linux-3.19-aufs/fs/open.c linux-3.19-aufs-modular/fs/open.c long vfs_truncate(struct path *path, loff_t length) { -diff -Nurp linux-3.19-aufs/fs/splice.c linux-3.19-aufs-modular/fs/splice.c ---- linux-3.19-aufs/fs/splice.c 2015-02-22 23:16:18.315926795 +0200 -+++ linux-3.19-aufs-modular/fs/splice.c 2015-02-22 23:23:41.619919343 +0200 -@@ -1127,6 +1127,7 @@ long do_splice_from(struct pipe_inode_in +@@ -676,6 +677,7 @@ int open_check_o_direct(struct file *f) + } + return 0; + } ++EXPORT_SYMBOL(open_check_o_direct); + + static int do_dentry_open(struct file *f, + int (*open)(struct inode *, struct file *), +diff -Nurp linux-4.1-aufs4/fs/read_write.c linux-4.1-aufs4-mod/fs/read_write.c +--- linux-4.1-aufs4/fs/read_write.c 2015-06-25 20:09:18.280319109 +0200 ++++ linux-4.1-aufs4-mod/fs/read_write.c 2015-06-25 23:43:56.804138140 +0200 +@@ -504,6 +504,7 @@ vfs_readf_t vfs_readf(struct file *file) + return new_sync_read; + return ERR_PTR(-ENOSYS); + } ++EXPORT_SYMBOL(vfs_readf); + + vfs_writef_t vfs_writef(struct file *file) + { +@@ -515,6 +516,7 @@ vfs_writef_t vfs_writef(struct file *fil + return new_sync_write; + return ERR_PTR(-ENOSYS); + } ++EXPORT_SYMBOL(vfs_writef); + + ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) + { +diff -Nurp linux-4.1-aufs4/fs/splice.c linux-4.1-aufs4-mod/fs/splice.c +--- linux-4.1-aufs4/fs/splice.c 2015-06-25 20:09:18.280319109 +0200 ++++ linux-4.1-aufs4-mod/fs/splice.c 2015-06-25 20:11:30.629136790 +0200 +@@ -1114,6 +1114,7 @@ long do_splice_from(struct pipe_inode_in return splice_write(pipe, out, ppos, len, flags); } @@ -163,7 +211,7 @@ diff -Nurp linux-3.19-aufs/fs/splice.c linux-3.19-aufs-modular/fs/splice.c /* * Attempt to initiate a splice from a file to a pipe. -@@ -1153,6 +1154,7 @@ long do_splice_to(struct file *in, loff_ +@@ -1140,6 +1141,7 @@ long do_splice_to(struct file *in, loff_ return splice_read(in, ppos, pipe, len, flags); } @@ -171,10 +219,10 @@ diff -Nurp linux-3.19-aufs/fs/splice.c linux-3.19-aufs-modular/fs/splice.c /** * splice_direct_to_actor - splices data directly between two non-pipes -diff -Nurp linux-3.19-aufs/security/commoncap.c linux-3.19-aufs-modular/security/commoncap.c ---- linux-3.19-aufs/security/commoncap.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/security/commoncap.c 2015-02-22 23:23:41.619919343 +0200 -@@ -979,9 +979,11 @@ int cap_mmap_addr(unsigned long addr) +diff -Nurp linux-4.1-aufs4/security/commoncap.c linux-4.1-aufs4-mod/security/commoncap.c +--- linux-4.1-aufs4/security/commoncap.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/security/commoncap.c 2015-06-25 20:11:30.629136790 +0200 +@@ -975,9 +975,11 @@ int cap_mmap_addr(unsigned long addr) } return ret; } @@ -186,9 +234,9 @@ diff -Nurp linux-3.19-aufs/security/commoncap.c linux-3.19-aufs-modular/security return 0; } +EXPORT_SYMBOL(cap_mmap_file); -diff -Nurp linux-3.19-aufs/security/device_cgroup.c linux-3.19-aufs-modular/security/device_cgroup.c ---- linux-3.19-aufs/security/device_cgroup.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/security/device_cgroup.c 2015-02-22 23:23:41.619919343 +0200 +diff -Nurp linux-4.1-aufs4/security/device_cgroup.c linux-4.1-aufs4-mod/security/device_cgroup.c +--- linux-4.1-aufs4/security/device_cgroup.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/security/device_cgroup.c 2015-06-25 20:11:30.629136790 +0200 @@ -7,6 +7,7 @@ #include #include @@ -205,10 +253,10 @@ diff -Nurp linux-3.19-aufs/security/device_cgroup.c linux-3.19-aufs-modular/secu int devcgroup_inode_mknod(int mode, dev_t dev) { -diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/security.c ---- linux-3.19-aufs/security/security.c 2015-02-09 04:54:22.000000000 +0200 -+++ linux-3.19-aufs-modular/security/security.c 2015-02-22 23:23:41.619919343 +0200 -@@ -407,6 +407,7 @@ int security_path_rmdir(struct path *dir +diff -Nurp linux-4.1-aufs4/security/security.c linux-4.1-aufs4-mod/security/security.c +--- linux-4.1-aufs4/security/security.c 2015-06-22 07:05:43.000000000 +0200 ++++ linux-4.1-aufs4-mod/security/security.c 2015-06-25 20:11:30.629136790 +0200 +@@ -430,6 +430,7 @@ int security_path_rmdir(struct path *dir return 0; return security_ops->path_rmdir(dir, dentry); } @@ -216,7 +264,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_path_unlink(struct path *dir, struct dentry *dentry) { -@@ -423,6 +424,7 @@ int security_path_symlink(struct path *d +@@ -446,6 +447,7 @@ int security_path_symlink(struct path *d return 0; return security_ops->path_symlink(dir, dentry, old_name); } @@ -224,7 +272,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_path_link(struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry) -@@ -431,6 +433,7 @@ int security_path_link(struct dentry *ol +@@ -454,6 +456,7 @@ int security_path_link(struct dentry *ol return 0; return security_ops->path_link(old_dentry, new_dir, new_dentry); } @@ -232,7 +280,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_path_rename(struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry, -@@ -458,6 +461,7 @@ int security_path_truncate(struct path * +@@ -481,6 +484,7 @@ int security_path_truncate(struct path * return 0; return security_ops->path_truncate(path); } @@ -240,7 +288,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_path_chmod(struct path *path, umode_t mode) { -@@ -465,6 +469,7 @@ int security_path_chmod(struct path *pat +@@ -488,6 +492,7 @@ int security_path_chmod(struct path *pat return 0; return security_ops->path_chmod(path, mode); } @@ -248,7 +296,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) { -@@ -472,6 +477,7 @@ int security_path_chown(struct path *pat +@@ -495,6 +500,7 @@ int security_path_chown(struct path *pat return 0; return security_ops->path_chown(path, uid, gid); } @@ -256,7 +304,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_path_chroot(struct path *path) { -@@ -557,6 +563,7 @@ int security_inode_readlink(struct dentr +@@ -580,6 +586,7 @@ int security_inode_readlink(struct dentr return 0; return security_ops->inode_readlink(dentry); } @@ -264,7 +312,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) { -@@ -571,6 +578,7 @@ int security_inode_permission(struct ino +@@ -594,6 +601,7 @@ int security_inode_permission(struct ino return 0; return security_ops->inode_permission(inode, mask); } @@ -272,7 +320,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_inode_setattr(struct dentry *dentry, struct iattr *attr) { -@@ -693,6 +701,7 @@ int security_file_permission(struct file +@@ -716,6 +724,7 @@ int security_file_permission(struct file return fsnotify_perm(file, mask); } @@ -280,7 +328,7 @@ diff -Nurp linux-3.19-aufs/security/security.c linux-3.19-aufs-modular/security/ int security_file_alloc(struct file *file) { -@@ -753,6 +762,7 @@ int security_mmap_file(struct file *file +@@ -775,6 +784,7 @@ int security_mmap_file(struct file *file return ret; return ima_file_mmap(file, prot); } diff --git a/kernel/kernel/files/patches/mageia/fs-aufs-3.19.patch b/kernel/kernel/files/patches/mageia/fs-aufs4.patch similarity index 93% rename from kernel/kernel/files/patches/mageia/fs-aufs-3.19.patch rename to kernel/kernel/files/patches/mageia/fs-aufs4.patch index 858eaefb..0025b6e6 100644 --- a/kernel/kernel/files/patches/mageia/fs-aufs-3.19.patch +++ b/kernel/kernel/files/patches/mageia/fs-aufs4.patch @@ -1,102 +1,103 @@ Documentation/ABI/testing/debugfs-aufs | 50 + Documentation/ABI/testing/sysfs-aufs | 31 + - Documentation/filesystems/aufs/README | 389 +++++ - Documentation/filesystems/aufs/design/01intro.txt | 148 ++ - Documentation/filesystems/aufs/design/02struct.txt | 238 +++ - Documentation/filesystems/aufs/design/03lookup.txt | 120 ++ - Documentation/filesystems/aufs/design/04branch.txt | 62 + + Documentation/filesystems/aufs/README | 383 ++++ + Documentation/filesystems/aufs/design/01intro.txt | 157 ++ + Documentation/filesystems/aufs/design/02struct.txt | 245 +++ + .../filesystems/aufs/design/03atomic_open.txt | 72 + + Documentation/filesystems/aufs/design/03lookup.txt | 100 ++ + Documentation/filesystems/aufs/design/04branch.txt | 61 + .../filesystems/aufs/design/05wbr_policy.txt | 51 + Documentation/filesystems/aufs/design/06fhsm.txt | 105 ++ - Documentation/filesystems/aufs/design/06mmap.txt | 33 + + Documentation/filesystems/aufs/design/06mmap.txt | 59 + Documentation/filesystems/aufs/design/06xattr.txt | 81 + Documentation/filesystems/aufs/design/07export.txt | 45 + Documentation/filesystems/aufs/design/08shwh.txt | 39 + - Documentation/filesystems/aufs/design/10dynop.txt | 33 + - Documentation/filesystems/aufs/design/99plan.txt | 45 + - MAINTAINERS | 14 + + Documentation/filesystems/aufs/design/10dynop.txt | 34 + + MAINTAINERS | 13 + drivers/block/loop.c | 18 + fs/Kconfig | 1 + fs/Makefile | 1 + fs/aufs/Kconfig | 185 ++ fs/aufs/Makefile | 36 + fs/aufs/aufs.h | 46 + - fs/aufs/branch.c | 1397 +++++++++++++++ - fs/aufs/branch.h | 254 +++ - fs/aufs/cpup.c | 1290 ++++++++++++++ + fs/aufs/branch.c | 1401 +++++++++++++++ + fs/aufs/branch.h | 266 +++ + fs/aufs/cpup.c | 1306 ++++++++++++++ fs/aufs/cpup.h | 81 + fs/aufs/dbgaufs.c | 419 +++++ fs/aufs/dbgaufs.h | 35 + fs/aufs/dcsub.c | 211 +++ - fs/aufs/dcsub.h | 112 ++ - fs/aufs/debug.c | 509 ++++++ - fs/aufs/debug.h | 249 +++ - fs/aufs/dentry.c | 1083 ++++++++++++ + fs/aufs/dcsub.h | 123 ++ + fs/aufs/debug.c | 427 +++++ + fs/aufs/debug.h | 212 +++ + fs/aufs/dentry.c | 1092 ++++++++++++ fs/aufs/dentry.h | 220 +++ - fs/aufs/dinfo.c | 531 ++++++ - fs/aufs/dir.c | 632 +++++++ - fs/aufs/dir.h | 117 ++ - fs/aufs/dynop.c | 366 ++++ - fs/aufs/dynop.h | 62 + - fs/aufs/export.c | 818 +++++++++ - fs/aufs/f_op.c | 801 +++++++++ + fs/aufs/dinfo.c | 537 ++++++ + fs/aufs/dir.c | 740 ++++++++ + fs/aufs/dir.h | 118 ++ + fs/aufs/dynop.c | 356 ++++ + fs/aufs/dynop.h | 61 + + fs/aufs/export.c | 819 +++++++++ + fs/aufs/f_op.c | 725 ++++++++ fs/aufs/fhsm.c | 412 +++++ - fs/aufs/file.c | 816 +++++++++ - fs/aufs/file.h | 271 +++ - fs/aufs/finfo.c | 143 ++ - fs/aufs/fstype.h | 456 +++++ + fs/aufs/file.c | 828 +++++++++ + fs/aufs/file.h | 278 +++ + fs/aufs/finfo.c | 144 ++ + fs/aufs/fstype.h | 387 +++++ fs/aufs/hfsnotify.c | 275 +++ fs/aufs/hfsplus.c | 43 + - fs/aufs/hnotify.c | 701 ++++++++ - fs/aufs/i_op.c | 1286 ++++++++++++++ - fs/aufs/i_op_add.c | 878 ++++++++++ - fs/aufs/i_op_del.c | 494 ++++++ - fs/aufs/i_op_ren.c | 1021 +++++++++++ + fs/aufs/hnotify.c | 697 ++++++++ + fs/aufs/i_op.c | 1434 +++++++++++++++ + fs/aufs/i_op_add.c | 919 ++++++++++ + fs/aufs/i_op_del.c | 497 ++++++ + fs/aufs/i_op_ren.c | 1004 +++++++++++ fs/aufs/iinfo.c | 264 +++ - fs/aufs/inode.c | 483 +++++ - fs/aufs/inode.h | 654 +++++++ + fs/aufs/inode.c | 487 ++++++ + fs/aufs/inode.h | 660 +++++++ fs/aufs/ioctl.c | 206 +++ fs/aufs/loop.c | 132 ++ fs/aufs/loop.h | 39 + - fs/aufs/magic.mk | 54 + + fs/aufs/magic.mk | 30 + fs/aufs/module.c | 196 +++ fs/aufs/module.h | 91 + fs/aufs/mvdown.c | 681 ++++++++ - fs/aufs/opts.c | 1837 ++++++++++++++++++++ - fs/aufs/opts.h | 200 +++ - fs/aufs/plink.c | 519 ++++++ - fs/aufs/poll.c | 42 + + fs/aufs/opts.c | 1822 ++++++++++++++++++++ + fs/aufs/opts.h | 197 +++ + fs/aufs/plink.c | 515 ++++++ + fs/aufs/poll.c | 39 + fs/aufs/posix_acl.c | 86 + fs/aufs/procfs.c | 156 ++ fs/aufs/rdu.c | 375 ++++ fs/aufs/rwsem.h | 178 ++ - fs/aufs/sbinfo.c | 340 ++++ + fs/aufs/sbinfo.c | 343 ++++ fs/aufs/spl.h | 98 ++ - fs/aufs/super.c | 996 +++++++++++ - fs/aufs/super.h | 628 +++++++ + fs/aufs/super.c | 991 +++++++++++ + fs/aufs/super.h | 622 +++++++ fs/aufs/sysaufs.c | 91 + fs/aufs/sysaufs.h | 88 + fs/aufs/sysfs.c | 336 ++++ fs/aufs/sysrq.c | 144 ++ - fs/aufs/vdir.c | 876 ++++++++++ - fs/aufs/vfsub.c | 783 +++++++++ - fs/aufs/vfsub.h | 288 +++ + fs/aufs/vdir.c | 875 ++++++++++ + fs/aufs/vfsub.c | 835 +++++++++ + fs/aufs/vfsub.h | 273 +++ fs/aufs/wbr_policy.c | 752 ++++++++ - fs/aufs/whout.c | 1048 +++++++++++ + fs/aufs/whout.c | 1050 +++++++++++ fs/aufs/whout.h | 72 + fs/aufs/wkq.c | 200 +++ fs/aufs/wkq.h | 78 + - fs/aufs/xattr.c | 321 ++++ - fs/aufs/xino.c | 1305 ++++++++++++++ + fs/aufs/xattr.c | 331 ++++ + fs/aufs/xino.c | 1284 ++++++++++++++ fs/buffer.c | 2 +- fs/dcache.c | 2 +- - fs/inode.c | 2 +- fs/proc/base.c | 2 +- fs/proc/nommu.c | 5 +- fs/proc/task_mmu.c | 7 +- fs/proc/task_nommu.c | 5 +- + fs/read_write.c | 22 + fs/splice.c | 10 +- - include/linux/fs.h | 1 + + include/linux/file.h | 1 + + include/linux/fs.h | 6 + include/linux/mm.h | 22 + include/linux/mm_types.h | 2 + include/linux/splice.h | 6 + @@ -105,14 +106,13 @@ kernel/fork.c | 2 +- mm/Makefile | 2 +- mm/filemap.c | 2 +- - mm/fremap.c | 16 +- mm/madvise.c | 4 +- mm/memory.c | 2 +- - mm/mmap.c | 12 +- + mm/mmap.c | 17 +- mm/msync.c | 4 +- mm/nommu.c | 10 +- mm/prfile.c | 86 + - 113 files changed, 32970 insertions(+), 34 deletions(-) + 113 files changed, 33091 insertions(+), 34 deletions(-) diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs new file mode 100644 @@ -209,12 +209,12 @@ index 0000000..82f9518 + will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README new file mode 100644 -index 0000000..b81588a +index 0000000..27faa06f --- /dev/null +++ b/Documentation/filesystems/aufs/README -@@ -0,0 +1,389 @@ +@@ -0,0 +1,383 @@ + -+Aufs3 -- advanced multi layered unification filesystem version 3.x ++Aufs4 -- advanced multi layered unification filesystem version 4.x +http://aufs.sf.net +Junjiro R. Okajima + @@ -222,7 +222,7 @@ index 0000000..b81588a +0. Introduction +---------------------------------------- +In the early days, aufs was entirely re-designed and re-implemented -+Unionfs Version 1.x series. After many original ideas, approaches, ++Unionfs Version 1.x series. Adding many original ideas, approaches, +improvements and implementations, it becomes totally different from +Unionfs while keeping the basic features. +Recently, Unionfs Version 2.x series begin taking some of the same @@ -230,7 +230,7 @@ index 0000000..b81588a +Unionfs is being developed by Professor Erez Zadok at Stony Brook +University and his team. + -+Aufs3 supports linux-3.0 and later. ++Aufs4 supports linux-4.0 and later, and for linux-3.x series try aufs3. +If you want older kernel version support, try aufs2-2.6.git or +aufs2-standalone.git repository, aufs1 from CVS on SourceForge. + @@ -257,7 +257,12 @@ index 0000000..b81588a +- dynamic branch manipulation, add, del. +- etc... + -+Also there are many enhancements in aufs1, such as: ++Also there are many enhancements in aufs, such as: ++- test only the highest one for the directory permission (dirperm1) ++- copyup on open (coo=) ++- 'move' policy for copy-up between two writable branches, after ++ checking free space. ++- xattr, acl +- readdir(3) in userspace. +- keep inode number by external inode number table +- keep the timestamps of file/dir in internal copyup operation @@ -287,93 +292,82 @@ index 0000000..b81588a +- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX. +- and more... + -+Currently these features are dropped temporary from aufs3. ++Currently these features are dropped temporary from aufs4. +See design/08plan.txt in detail. -+- test only the highest one for the directory permission (dirperm1) -+- copyup on open (coo=) +- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs + (robr) +- statistics of aufs thread (/sys/fs/aufs/stat) -+- delegation mode (dlgt) -+ a delegation of the internal branch access to support task I/O -+ accounting, which also supports Linux Security Modules (LSM) mainly -+ for Suse AppArmor. -+- intent.open/create (file open in a single lookup) + +Features or just an idea in the future (see also design/*.txt), +- reorder the branch index without del/re-add. +- permanent xino files for NFSD +- an option for refreshing the opened files after add/del branches -+- 'move' policy for copy-up between two writable branches, after -+ checking free space. +- light version, without branch manipulation. (unnecessary?) +- copyup in userspace +- inotify in userspace +- readv/writev -+- xattr, acl + + +2. Download +---------------------------------------- -+There were three GIT trees for aufs3, aufs3-linux.git, -+aufs3-standalone.git, and aufs-util.git. Note that there is no "3" in ++There are three GIT trees for aufs4, aufs4-linux.git, ++aufs4-standalone.git, and aufs-util.git. Note that there is no "4" in +"aufs-util.git." -+While the aufs-util is always necessary, you need either of aufs3-linux -+or aufs3-standalone. ++While the aufs-util is always necessary, you need either of aufs4-linux ++or aufs4-standalone. + -+The aufs3-linux tree includes the whole linux mainline GIT tree, ++The aufs4-linux tree includes the whole linux mainline GIT tree, +git://git.kernel.org/.../torvalds/linux.git. +And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot -+build aufs3 as an external kernel module. ++build aufs4 as an external kernel module. +Several extra patches are not included in this tree. Only -+aufs3-standalong tree contains them. They are describe in the later ++aufs4-standalone tree contains them. They are describe in the later +section "Configuration and Compilation." + -+On the other hand, the aufs3-standalone tree has only aufs source files ++On the other hand, the aufs4-standalone tree has only aufs source files +and necessary patches, and you can select CONFIG_AUFS_FS=m. +But you need to apply all aufs patches manually. + -+You will find GIT branches whose name is in form of "aufs3.x" where "x" -+represents the linux kernel version, "linux-3.x". For instance, -+"aufs3.0" is for linux-3.0. For latest "linux-3.x-rcN", use -+"aufs3.x-rcN" branch. ++You will find GIT branches whose name is in form of "aufs4.x" where "x" ++represents the linux kernel version, "linux-4.x". For instance, ++"aufs4.0" is for linux-4.0. For latest "linux-4.x-rcN", use ++"aufs4.x-rcN" branch. + -+o aufs3-linux tree ++o aufs4-linux tree +$ git clone --reference /your/linux/git/tree \ -+ git://git.code.sf.net/p/aufs/aufs3-linux aufs3-linux.git ++ git://github.com/sfjro/aufs4-linux.git aufs4-linux.git +- if you don't have linux GIT tree, then remove "--reference ..." -+$ cd aufs3-linux.git -+$ git checkout origin/aufs3.0 ++$ cd aufs4-linux.git ++$ git checkout origin/aufs4.0 + +Or You may want to directly git-pull aufs into your linux GIT tree, and +leave the patch-work to GIT. +$ cd /your/linux/git/tree -+$ git remote add aufs3 https://github.com/sfjro/aufs3-linux.git -+- aufs3-linux.git tree also exists on github. -+$ git fetch aufs3 -+$ git checkout -b my3.14 v3.14 -+$ (add your change...) -+$ git pull aufs3 aufs3.14 -+- now you have v3.14 + your_changes + aufs3.14 in you my3.14 branch. ++$ git remote add aufs4 git://github.com/sfjro/aufs4-linux.git ++$ git fetch aufs4 ++$ git checkout -b my4.0 v4.0 ++$ (add your local change...) ++$ git pull aufs4 aufs4.0 ++- now you have v4.0 + your_changes + aufs4.0 in you my4.0 branch. +- you may need to solve some conflicts between your_changes and -+ aufs3.14. in this case, git-rerere is recommended so that you can -+ solve the similar confilicts automatically when you upgrade to 3.15 or ++ aufs4.0. in this case, git-rerere is recommended so that you can ++ solve the similar conflicts automatically when you upgrade to 4.1 or + later in the future. + -+o aufs3-standalone tree -+$ git clone git://git.code.sf.net/p/aufs/aufs3-standalone \ -+ aufs3-standalone.git -+$ cd aufs3-standalone.git -+$ git checkout origin/aufs3.0 ++o aufs4-standalone tree ++$ git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git ++$ cd aufs4-standalone.git ++$ git checkout origin/aufs4.0 + +o aufs-util tree -+$ git clone git://git.code.sf.net/p/aufs/aufs-util \ -+ aufs-util.git ++$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git ++- note that the public aufs-util.git is on SourceForge instead of ++ GitHUB. +$ cd aufs-util.git -+$ git checkout origin/aufs3.0 ++$ git checkout origin/aufs4.0 + -+Note: The 3.x-rcN branch is to be used with `rc' kernel versions ONLY. -+The minor version number, 'x' in '3.x', of aufs may not always ++Note: The 4.x-rcN branch is to be used with `rc' kernel versions ONLY. ++The minor version number, 'x' in '4.x', of aufs may not always +follow the minor version number of the kernel. +Because changes in the kernel that cause the use of a new +minor version number do not always require changes to aufs-util. @@ -385,8 +379,8 @@ index 0000000..b81588a +nearest lower number. + +For (an unreleased) example: -+If you are using "linux-3.10" and the "aufs3.10" branch -+does not exist in aufs-util repository, then "aufs3.9", "aufs3.8" ++If you are using "linux-4.10" and the "aufs4.10" branch ++does not exist in aufs-util repository, then "aufs4.9", "aufs4.8" +or something numerically smaller is the branch for your kernel. + +Also you can view all branches by @@ -397,19 +391,19 @@ index 0000000..b81588a +---------------------------------------- +Make sure you have git-checkout'ed the correct branch. + -+For aufs3-linux tree, ++For aufs4-linux tree, +- enable CONFIG_AUFS_FS. +- set other aufs configurations if necessary. + -+For aufs3-standalone tree, ++For aufs4-standalone tree, +There are several ways to build. + +1. -+- apply ./aufs3-kbuild.patch to your kernel source files. -+- apply ./aufs3-base.patch too. -+- apply ./aufs3-mmap.patch too. -+- apply ./aufs3-standalone.patch too, if you have a plan to set -+ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs3-standalone.patch. ++- apply ./aufs4-kbuild.patch to your kernel source files. ++- apply ./aufs4-base.patch too. ++- apply ./aufs4-mmap.patch too. ++- apply ./aufs4-standalone.patch too, if you have a plan to set ++ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs4-standalone.patch. +- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your + kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild. +- enable CONFIG_AUFS_FS, you can select either @@ -426,9 +420,9 @@ index 0000000..b81588a + +2. +- module only (CONFIG_AUFS_FS=m). -+- apply ./aufs3-base.patch to your kernel source files. -+- apply ./aufs3-mmap.patch too. -+- apply ./aufs3-standalone.patch too. ++- apply ./aufs4-base.patch to your kernel source files. ++- apply ./aufs4-mmap.patch too. ++- apply ./aufs4-standalone.patch too. +- build your kernel, don't forget "make headers_install", and reboot. +- edit ./config.mk and set other aufs configurations if necessary. + Note: You should read $PWD/fs/aufs/Kconfig carefully which describes @@ -447,7 +441,7 @@ index 0000000..b81588a + available in aufs standalone version's Makefile only), or copy + $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever + you like manually. By default, the target directory is $PWD/usr. -+- no need to apply aufs3-kbuild.patch, nor copying source files to your ++- no need to apply aufs4-kbuild.patch, nor copying source files to your + kernel source tree. + +Note: The header file aufs_type.h is necessary to build aufs-util @@ -467,9 +461,9 @@ index 0000000..b81588a + then run "make install_ulib" too. And refer to the aufs manual in + detail. + -+There several other patches in aufs3-standalone.git. They are all ++There several other patches in aufs4-standalone.git. They are all +optional. When you meet some problems, they will help you. -+- aufs3-loopback.patch ++- aufs4-loopback.patch + Supports a nested loopback mount in a branch-fs. This patch is + unnecessary until aufs produces a message like "you may want to try + another patch for loopback file". @@ -604,10 +598,10 @@ index 0000000..b81588a +# End: ; diff --git a/Documentation/filesystems/aufs/design/01intro.txt b/Documentation/filesystems/aufs/design/01intro.txt new file mode 100644 -index 0000000..7f491fb +index 0000000..02a8c7b --- /dev/null +++ b/Documentation/filesystems/aufs/design/01intro.txt -@@ -0,0 +1,148 @@ +@@ -0,0 +1,157 @@ + +# Copyright (C) 2005-2015 Junjiro R. Okajima + @@ -625,7 +619,7 @@ index 0000000..7f491fb +- multi layered stackable unification filesystem, the member directory + is called as a branch. +- branch permission and attribute, 'readonly', 'real-readonly', -+ 'readwrite', 'whiteout-able', 'link-able whiteout' and their ++ 'readwrite', 'whiteout-able', 'link-able whiteout', etc. and their + combination. +- internal "file copy-on-write". +- logical deletion, whiteout. @@ -676,11 +670,16 @@ index 0000000..7f491fb +- unnecessary copy-up may happen, for example mmap(MAP_PRIVATE) after + open(O_RDWR). + -+Unionfs has a longer history. When I started implementing a stacking filesystem -+(Aug 2005), it already existed. It has virtual super_block, inode, -+dentry and file objects and they have an array pointing lower same kind -+objects. After contributing many patches for Unionfs, I re-started my -+project AUFS (Jun 2006). ++In linux-3.18, "overlay" filesystem (formerly known as "overlayfs") was ++merged into mainline. This is another implementation of UnionMount as a ++separated filesystem. All the limitations and known problems which ++UnionMount are equally inherited to "overlay" filesystem. ++ ++Unionfs has a longer history. When I started implementing a stackable ++filesystem (Aug 2005), it already existed. It has virtual super_block, ++inode, dentry and file objects and they have an array pointing lower ++same kind objects. After contributing many patches for Unionfs, I ++re-started my project AUFS (Jun 2006). + +In AUFS, the structure of filesystem resembles to Unionfs, but I +implemented my own ideas, approaches and enhancements and it became @@ -702,11 +701,14 @@ index 0000000..7f491fb +- DM snapshot-merge may help a lot when users try merging. in the + fs-layer union, users will use rsync(1). + ++You may want to read my old paper "Filesystems in LiveCD" ++(http://aufs.sourceforge.net/aufs2/report/sq/sq.pdf). + -+Several characters/aspects of aufs ++ ++Several characters/aspects/persona of aufs +---------------------------------------------------------------------- + -+Aufs has several characters or aspects. ++Aufs has several characters, aspects or persona. +1. a filesystem, callee of VFS helper +2. sub-VFS, caller of VFS helper for branches +3. a virtual filesystem which maintains persistent inode number @@ -737,10 +739,11 @@ index 0000000..7f491fb +numbers. This is particularly important to support exporting a +filesystem via NFS. Aufs is a virtual filesystem which doesn't have a +backend block device for its own. But some storage is necessary to -+maintain inode number. It may be a large space and may not suit to keep -+in memory. Aufs rents some space from its first writable branch -+filesystem (by default) and creates file(s) on it. These files are -+created by aufs internally and removed soon (currently) keeping opened. ++keep and maintain the inode numbers. It may be a large space and may not ++suit to keep in memory. Aufs rents some space from its first writable ++branch filesystem (by default) and creates file(s) on it. These files ++are created by aufs internally and removed soon (currently) keeping ++opened. +Note: Because these files are removed, they are totally gone after + unmounting aufs. It means the inode numbers are not persistent + across unmount or reboot. I have a plan to make them really @@ -758,10 +761,10 @@ index 0000000..7f491fb +about it. But currently I have implemented it in kernel space. diff --git a/Documentation/filesystems/aufs/design/02struct.txt b/Documentation/filesystems/aufs/design/02struct.txt new file mode 100644 -index 0000000..f185393 +index 0000000..1a5e5d0 --- /dev/null +++ b/Documentation/filesystems/aufs/design/02struct.txt -@@ -0,0 +1,238 @@ +@@ -0,0 +1,245 @@ + +# Copyright (C) 2005-2015 Junjiro R. Okajima + @@ -780,18 +783,18 @@ index 0000000..f185393 + +Aufs lookup operation finds /ro/fileA and gets dentry for that. These +pointers are stored in a aufs dentry. The array in aufs dentry will be, -+- [0] = NULL ++- [0] = NULL (because /rw/fileA doesn't exist) +- [1] = /ro/fileA + +This style of an array is essentially same to the aufs +superblock/inode/dentry/file objects. + +Because aufs supports manipulating branches, ie. add/delete/change -+dynamically, these objects has its own generation. When branches are -+changed, the generation in aufs superblock is incremented. And a -+generation in other object are compared when it is accessed. -+When a generation in other objects are obsoleted, aufs refreshes the -+internal array. ++branches dynamically, these objects has its own generation. When ++branches are changed, the generation in aufs superblock is ++incremented. And a generation in other object are compared when it is ++accessed. When a generation in other objects are obsoleted, aufs ++refreshes the internal array. + + +Superblock @@ -799,8 +802,8 @@ index 0000000..f185393 +Additionally aufs superblock has some data for policies to select one +among multiple writable branches, XIB files, pseudo-links and kobject. +See below in detail. -+About the policies which supports copy-down a directory, see policy.txt -+too. ++About the policies which supports copy-down a directory, see ++wbr_policy.txt too. + + +Branch and XINO(External Inode Number Translation Table) @@ -820,13 +823,20 @@ index 0000000..f185393 +might appear. If your branch filesystem consumes disk space for such +holes, then you should specify 'xino=' option at mounting aufs. + ++Aufs has a mount option to free the disk blocks for such holes in XINO ++files on tmpfs or ramdisk. But it is not so effective actually. If you ++meet a problem of disk shortage due to XINO files, then you should try ++"tmpfs-ino.patch" (and "vfs-ino.patch" too) in aufs4-standalone.git. ++The patch localizes the assignment inumbers per tmpfs-mount and avoid ++the holes in XINO files. ++ +Also a writable branch has three kinds of "whiteout bases". All these -+are existed when the branch is joined to aufs and the names are ++are existed when the branch is joined to aufs, and their names are +whiteout-ed doubly, so that users will never see their names in aufs +hierarchy. -+1. a regular file which will be linked to all whiteouts. ++1. a regular file which will be hardlinked to all whiteouts. +2. a directory to store a pseudo-link. -+3. a directory to store an "orphan-ed" file temporary. ++3. a directory to store an "orphan"-ed file temporary. + +1. Whiteout Base + When you remove a file on a readonly branch, aufs handles it as a @@ -843,8 +853,8 @@ index 0000000..f185393 + creating a file under this dir, the file is unlinked. + +Because aufs supports manipulating branches, ie. add/delete/change -+dynamically, a branch has its own id. When the branch order changes, aufs -+finds the new index by searching the branch id. ++dynamically, a branch has its own id. When the branch order changes, ++aufs finds the new index by searching the branch id. + + +Pseudo-link @@ -857,7 +867,7 @@ index 0000000..f185393 +simple list. If fileB is read after unlinking fileA, aufs returns +filedata from the pseudo-link instead of the lower readonly +branch. Because the pseudo-link is based upon the inode, to keep the -+inode number by xino (see above) is important. ++inode number by xino (see above) is essentially necessary. + +All the hardlinks under the Pseudo-link Directory of the writable branch +should be restored in a proper location later. Aufs provides a utility @@ -875,12 +885,13 @@ index 0000000..f185393 +XIB(external inode number bitmap) +---------------------------------------------------------------------- +Addition to the xino file per a branch, aufs has an external inode number -+bitmap in a superblock object. It is also a file such like a xino file. ++bitmap in a superblock object. It is also an internal file such like a ++xino file. +It is a simple bitmap to mark whether the aufs inode number is in-use or +not. +To reduce the file I/O, aufs prepares a single memory page to cache xib. + -+Aufs implements a feature to truncate/refresh both of xino and xib to ++As well as XINO files, aufs has a feature to truncate/refresh XIB to +reduce the number of consumed disk blocks for these files. + + @@ -892,7 +903,7 @@ index 0000000..f185393 +with eliminating the whiteout-ed ones, and sets it to file (dir) +object. So the file object has its entry list until it is closed. The +entry list will be updated when the file position is zero and becomes -+old. This decision is made in aufs automatically. ++obsoleted. This decision is made in aufs automatically. + +The dynamically allocated memory block for the name of entries has a +unit of 512 bytes (by default) and stores the names contiguously (no @@ -931,9 +942,8 @@ index 0000000..f185393 +its completion. This approach solves a problem of a signal handler +simply. +If aufs didn't adopt the workqueue and changed the privilege of the -+process, and if the mkdir/write call arises SIGXFSZ or other signal, -+then the user process might gain a privilege or the generated core file -+was owned by a superuser. ++process, then the process may receive the unexpected SIGXFSZ or other ++signals. + +Also aufs uses the system global workqueue ("events" kernel thread) too +for asynchronous tasks, such like handling inotify/fsnotify, re-creating a @@ -951,7 +961,7 @@ index 0000000..f185393 + +Basically the whiteout represents "logical deletion" which stops aufs to +lookup further, but also it represents "dir is opaque" which also stop -+lookup. ++further lookup. + +In aufs, rmdir(2) and rename(2) for dir uses whiteout alternatively. +In order to make several functions in a single systemcall to be @@ -959,7 +969,7 @@ index 0000000..f185393 +unique whiteouted name. +For example, in rename(2) dir where the target dir already existed, aufs +renames the target dir to a temporary unique whiteouted name before the -+actual rename on a branch and then handles other actions (make it opaque, ++actual rename on a branch, and then handles other actions (make it opaque, +update the attributes, etc). If an error happens in these actions, aufs +simply renames the whiteouted name back and returns an error. If all are +succeeded, aufs registers a function to remove the whiteouted unique @@ -989,7 +999,7 @@ index 0000000..f185393 +- diropq for the ancestor directories may exist on the upper branch. +- free space on the lower branch will reduce. +- another access to the file may happen during moving-down, including -+ UDBA. ++ UDBA (see "Revalidate Dentry and UDBA"). +- the file should not be hard-linked nor pseudo-linked. they should be + handled by auplink utility later. + @@ -1000,35 +1010,103 @@ index 0000000..f185393 +- etc. + +For this purpose, use "aumvdown" command in aufs-util.git. +diff --git a/Documentation/filesystems/aufs/design/03atomic_open.txt b/Documentation/filesystems/aufs/design/03atomic_open.txt +new file mode 100644 +index 0000000..d2c9834 +--- /dev/null ++++ b/Documentation/filesystems/aufs/design/03atomic_open.txt +@@ -0,0 +1,72 @@ ++ ++# Copyright (C) 2015 Junjiro R. Okajima ++ ++Support for a branch who has its ->atomic_open() ++---------------------------------------------------------------------- ++The filesystems who implement its ->atomic_open() are not majority. For ++example NFSv4 does, and aufs should call NFSv4 ->atomic_open, ++particularly for open(O_CREAT|O_EXCL, 0400) case. Other than ++->atomic_open(), NFSv4 returns an error for this open(2). While I am not ++sure whether all filesystems who have ->atomic_open() behave like this, ++but NFSv4 surely returns the error. ++ ++In order to support ->atomic_open() for aufs, there are a few ++approaches. ++ ++A. Introduce aufs_atomic_open() ++ - calls one of VFS:do_last(), lookup_open() or atomic_open() for ++ branch fs. ++B. Introduce aufs_atomic_open() calling create, open and chmod. this is ++ an aufs user Pip Cet's approach ++ - calls aufs_create(), VFS finish_open() and notify_change(). ++ - pass fake-mode to finish_open(), and then correct the mode by ++ notify_change(). ++C. Extend aufs_open() to call branch fs's ->atomic_open() ++ - no aufs_atomic_open(). ++ - aufs_lookup() registers the TID to an aufs internal object. ++ - aufs_create() does nothing when the matching TID is registered, but ++ registers the mode. ++ - aufs_open() calls branch fs's ->atomic_open() when the matching ++ TID is registered. ++D. Extend aufs_open() to re-try branch fs's ->open() with superuser's ++ credential ++ - no aufs_atomic_open(). ++ - aufs_create() registers the TID to an internal object. this info ++ represents "this process created this file just now." ++ - when aufs gets EACCES from branch fs's ->open(), then confirm the ++ registered TID and re-try open() with superuser's credential. ++ ++Pros and cons for each approach. ++ ++A. ++ - straightforward but highly depends upon VFS internal. ++ - the atomic behavaiour is kept. ++ - some of parameters such as nameidata are hard to reproduce for ++ branch fs. ++ - large overhead. ++B. ++ - easy to implement. ++ - the atomic behavaiour is lost. ++C. ++ - the atomic behavaiour is kept. ++ - dirty and tricky. ++ - VFS checks whether the file is created correctly after calling ++ ->create(), which means this approach doesn't work. ++D. ++ - easy to implement. ++ - the atomic behavaiour is lost. ++ - to open a file with superuser's credential and give it to a user ++ process is a bad idea, since the file object keeps the credential ++ in it. It may affect LSM or something. This approach doesn't work ++ either. ++ ++The approach A is ideal, but it hard to implement. So here is a ++variation of A, which is to be implemented. ++ ++A-1. Introduce aufs_atomic_open() ++ - calls branch fs ->atomic_open() if exists. otherwise calls ++ vfs_create() and finish_open(). ++ - the demerit is that the several checks after branch fs ++ ->atomic_open() are lost. in the ordinary case, the checks are ++ done by VFS:do_last(), lookup_open() and atomic_open(). some can ++ be implemented in aufs, but not all I am afraid. diff --git a/Documentation/filesystems/aufs/design/03lookup.txt b/Documentation/filesystems/aufs/design/03lookup.txt new file mode 100644 -index 0000000..55ade95 +index 0000000..7adf4cc --- /dev/null +++ b/Documentation/filesystems/aufs/design/03lookup.txt -@@ -0,0 +1,120 @@ +@@ -0,0 +1,100 @@ + +# Copyright (C) 2005-2015 Junjiro R. Okajima + +Lookup in a Branch +---------------------------------------------------------------------- +Since aufs has a character of sub-VFS (see Introduction), it operates -+lookup for branches as VFS does. It may be a heavy work. Generally -+speaking struct nameidata is a bigger structure and includes many -+information. But almost all lookup operation in aufs is the simplest -+case, ie. lookup only an entry directly connected to its parent. Digging -+down the directory hierarchy is unnecessary. ++lookup for branches as VFS does. It may be a heavy work. But almost all ++lookup operation in aufs is the simplest case, ie. lookup only an entry ++directly connected to its parent. Digging down the directory hierarchy ++is unnecessary. VFS has a function lookup_one_len() for that use, and ++aufs calls it. + -+VFS has a function lookup_one_len() for that use, but it is not usable -+for a branch filesystem which requires struct nameidata. So aufs -+implements a simple lookup wrapper function. When a branch filesystem -+allows NULL as nameidata, it calls lookup_one_len(). Otherwise it builds -+a simplest nameidata and calls lookup_hash(). -+Here aufs applies "a principle in NFSD", ie. if the filesystem supports -+NFS-export, then it has to support NULL as a nameidata parameter for -+->create(), ->lookup() and ->d_revalidate(). So the lookup wrapper in -+aufs tests if ->s_export_op in the branch is NULL or not. -+ -+When a branch is a remote filesystem, aufs basically trusts its ++When a branch is a remote filesystem, aufs basically relies upon its +->d_revalidate(), also aufs forces the hardest revalidate tests for +them. +For d_revalidate, aufs implements three levels of revalidate tests. See @@ -1043,7 +1121,7 @@ index 0000000..55ade95 +- "dirA" exists under /ro, but /rw. and its mode is 0700. +- user invoked "chmod a+rx /au/dirA" +- the internal copy-up is activated and "/rw/dirA" is created and its -+ permission bits are set to world readble. ++ permission bits are set to world readable. +- then "/au/dirA" becomes world readable? + +In this case, /ro/dirA is still 0700 since it exists in readonly branch, @@ -1052,8 +1130,9 @@ index 0000000..55ade95 +allowed it by chmod. Should really aufs rejects showing the entries +under /ro/dirA? + -+To be honest, I don't have a best solution for this case. So aufs -+implements 'dirperm1' and 'nodirperm1' and leave it to users. ++To be honest, I don't have a good solution for this case. So aufs ++implements 'dirperm1' and 'nodirperm1' mount options, and leave it to ++users. +When dirperm1 is specified, aufs checks only the highest one for the +directory permission, and shows the entries. Otherwise, as usual, checks +every dir existing on all branches and rejects the request. @@ -1063,17 +1142,6 @@ index 0000000..55ade95 +branch is many. + + -+Loopback Mount -+---------------------------------------------------------------------- -+Basically aufs supports any type of filesystem and block device for a -+branch (actually there are some exceptions). But it is prohibited to add -+a loopback mounted one whose backend file exists in a filesystem which is -+already added to aufs. The reason is to protect aufs from a recursive -+lookup. If it was allowed, the aufs lookup operation might re-enter a -+lookup for the loopback mounted branch in the same context, and will -+cause a deadlock. -+ -+ +Revalidate Dentry and UDBA (User's Direct Branch Access) +---------------------------------------------------------------------- +Generally VFS helpers re-validate a dentry as a part of lookup. @@ -1123,15 +1191,15 @@ index 0000000..55ade95 + itself. +3. No Extra Validation + This is the simplest test and doesn't add any additional revalidation -+ test, and skip therevalidatin in step 4. It is useful and improves ++ test, and skip the revalidation in step 4. It is useful and improves + aufs performance when system surely hide the aufs branches from user, + by over-mounting something (or another method). diff --git a/Documentation/filesystems/aufs/design/04branch.txt b/Documentation/filesystems/aufs/design/04branch.txt new file mode 100644 -index 0000000..644ceb1 +index 0000000..1d11dbe --- /dev/null +++ b/Documentation/filesystems/aufs/design/04branch.txt -@@ -0,0 +1,62 @@ +@@ -0,0 +1,61 @@ + +# Copyright (C) 2005-2015 Junjiro R. Okajima + @@ -1144,8 +1212,7 @@ index 0000000..644ceb1 +Add a Branch +---------------------------------------------------------------------- +o Confirm the adding dir exists outside of aufs, including loopback -+ mount. -+- and other various attributes... ++ mount, and its various attributes. +o Initialize the xino file and whiteout bases if necessary. + See struct.txt. + @@ -1160,7 +1227,7 @@ index 0000000..644ceb1 + writable branch, and the writable branch is world-writable, then a + malicious guy may create /etc/passwd on the writable branch directly + and the infected file will be valid in aufs. -+ I am afraid it can be a security issue, but nothing to do except ++ I am afraid it can be a security issue, but aufs can do nothing except + producing a warning. + + @@ -1196,7 +1263,7 @@ index 0000000..644ceb1 + same named entry on the upper branch. diff --git a/Documentation/filesystems/aufs/design/05wbr_policy.txt b/Documentation/filesystems/aufs/design/05wbr_policy.txt new file mode 100644 -index 0000000..fc64d70 +index 0000000..0419a90 --- /dev/null +++ b/Documentation/filesystems/aufs/design/05wbr_policy.txt @@ -0,0 +1,51 @@ @@ -1210,9 +1277,9 @@ index 0000000..fc64d70 +writable branch which has the parent (or ancestor) dir of the target +file is chosen (top-down-parent policy). +By user's request, aufs implements some other policies to select the -+writable branch, for file creation two policies, round-robin and -+most-free-space policies. For copy-up three policies, top-down-parent, -+bottom-up-parent and bottom-up policies. ++writable branch, for file creation several policies, round-robin, ++most-free-space, and other policies. For copy-up, top-down-parent, ++bottom-up-parent, bottom-up and others. + +As expected, the round-robin policy selects the branch in circular. When +you have two writable branches and creates 10 new files, 5 files will be @@ -1253,7 +1320,7 @@ index 0000000..fc64d70 + copyup policy. diff --git a/Documentation/filesystems/aufs/design/06fhsm.txt b/Documentation/filesystems/aufs/design/06fhsm.txt new file mode 100644 -index 0000000..6cf01ae +index 0000000..0eb7a82 --- /dev/null +++ b/Documentation/filesystems/aufs/design/06fhsm.txt @@ -0,0 +1,105 @@ @@ -1264,9 +1331,9 @@ index 0000000..6cf01ae +---------------------------------------------------------------------- +Hierarchical Storage Management (or HSM) is a well-known feature in the +storage world. Aufs provides this feature as file-based with multiple -+writable branches, based upon the principle of "Colder-Lower". ++writable branches, based upon the principle of "Colder, the Lower". +Here the word "colder" means that the less used files, and "lower" means -+that the position in the order of the stacked branches. ++that the position in the order of the stacked branches vertically. +These multiple writable branches are prioritized, ie. the topmost one +should be the fastest drive and be used heavily. + @@ -1364,10 +1431,10 @@ index 0000000..6cf01ae +should restore the original file state after an error happens. diff --git a/Documentation/filesystems/aufs/design/06mmap.txt b/Documentation/filesystems/aufs/design/06mmap.txt new file mode 100644 -index 0000000..9abea60 +index 0000000..f22d2a1 --- /dev/null +++ b/Documentation/filesystems/aufs/design/06mmap.txt -@@ -0,0 +1,33 @@ +@@ -0,0 +1,59 @@ + +# Copyright (C) 2005-2015 Junjiro R. Okajima + @@ -1377,7 +1444,7 @@ index 0000000..9abea60 +interaction with aufs. It means aufs_mmap() calls the branch fs's +->mmap(). +This approach is simple and good, but there is one problem. -+Under /proc, several entries show the mmap-ped files by its path (with ++Under /proc, several entries show the mmapped files by its path (with +device and inode number), and the printed path will be the path on the +branch fs's instead of virtual aufs's. +This is not a problem in most cases, but some utilities lsof(1) (and its @@ -1394,16 +1461,42 @@ index 0000000..9abea60 + incremented. +- merging vma maintains the ref count too. + -+This is not a good approach. It just faking the printed path. But it ++This is not a good approach. It just fakes the printed path. But it +leaves all behaviour around f_mapping unchanged. This is surely an +advantage. +Actually aufs had adopted another complicated approach which calls +generic_file_mmap() and handles struct vm_operations_struct. In this +approach, aufs met a hard problem and I could not solve it without +switching the approach. ++ ++There may be one more another approach which is ++- bind-mount the branch-root onto the aufs-root internally ++- grab the new vfsmount (ie. struct mount) ++- lazy-umount the branch-root internally ++- in open(2) the aufs-file, open the branch-file with the hidden ++ vfsmount (instead of the original branch's vfsmount) ++- ideally this "bind-mount and lazy-umount" should be done atomically, ++ but it may be possible from userspace by the mount helper. ++ ++Adding the internal hidden vfsmount and using it in opening a file, the ++file path under /proc will be printed correctly. This approach looks ++smarter, but is not possible I am afraid. ++- aufs-root may be bind-mount later. when it happens, another hidden ++ vfsmount will be required. ++- it is hard to get the chance to bind-mount and lazy-umount ++ + in kernel-space, FS can have vfsmount in open(2) via ++ file->f_path, and aufs can know its vfsmount. But several locks are ++ already acquired, and if aufs tries to bind-mount and lazy-umount ++ here, then it may cause a deadlock. ++ + in user-space, bind-mount doesn't invoke the mount helper. ++- since /proc shows dev and ino, aufs has to give vma these info. it ++ means a new member vm_prinode will be necessary. this is essentially ++ equivalent to vm_prfile described above. ++ ++I have to give up this "looks-smater" approach. diff --git a/Documentation/filesystems/aufs/design/06xattr.txt b/Documentation/filesystems/aufs/design/06xattr.txt new file mode 100644 -index 0000000..d16f822 +index 0000000..ec1e68c --- /dev/null +++ b/Documentation/filesystems/aufs/design/06xattr.txt @@ -0,0 +1,81 @@ @@ -1414,7 +1507,7 @@ index 0000000..d16f822 +---------------------------------------------------------------------- +For the inode standard attributes (owner, group, timestamps, etc.), aufs +shows the values from the topmost existing file. This behaviour is good -+for the non-dir entreis since the bahaviour exactly matches the shown ++for the non-dir entries since the bahaviour exactly matches the shown +information. But for the directories, aufs considers all the same named +entries on the lower branches. Which means, if one of the lower entry +rejects readdir call, then aufs returns an error even if the topmost @@ -1427,14 +1520,14 @@ index 0000000..d16f822 + +A similar issue can happen around XATTR. +getxattr(2) and listxattr(2) families behave as if dirperm1 option is -+always set. Otherwise these very unpleasant situation can happen. -+- listxattr(2) may return the duplicated entires. ++always set. Otherwise these very unpleasant situation would happen. ++- listxattr(2) may return the duplicated entries. +- users may not be able to remove or reset the XATTR forever, + + +XATTR/EA support in the internal (copy,move)-(up,down) +---------------------------------------------------------------------- -+Generally the extended attributes of inode are categorazied as these. ++Generally the extended attributes of inode are categorized as these. +- "security" for LSM and capability. +- "system" for posix ACL, 'acl' mount option is required for the branch + fs generally. @@ -1448,12 +1541,12 @@ index 0000000..d16f822 + +In copy-up, the support for XATTR on the dst branch may differ from the +src branch. In this case, the copy-up operation will get an error and -+the original user operation which triggered the copy-up fails. It can -+happen that even all copy-up will fail. ++the original user operation which triggered the copy-up will fail. It ++can happen that even all copy-up will fail. +When both of src and dst branches support XATTR and if an error occurs +during copying XATTR, then the copy-up should fail obviously. That is a +good reason and aufs should return an error to userspace. But when only -+the src branch support XATTR, aufs should not return an error. ++the src branch support that XATTR, aufs should not return an error. +For example, the src branch supports ACL but the dst branch doesn't +because the dst branch may natively un-support it or temporary +un-support it due to "noacl" mount option. Of course, the dst branch fs @@ -1467,15 +1560,15 @@ index 0000000..d16f822 + +For the copy-up operation, there two basic approaches. +- copy the specified XATTR only (by category above), and return the -+ error if it happens inconditionally. ++ error unconditionally if it happens. +- copy all XATTR, and ignore the error on the specified category only. + +In order to support XATTR and to implement the correct behaviour, aufs -+chooses the latter approach and introduces some attributes for its -+branch, "icexsec", "icexsys", "icextr", "icexusr", and "icexoth". ++chooses the latter approach and introduces some new branch attributes, ++"icexsec", "icexsys", "icextr", "icexusr", and "icexoth". +They correspond to the XATTR namespaces (see above). Additionally, to be -+convenient, "icex" is also provided which means all "ix*" attributes are -+set. ++convenient, "icex" is also provided which means all "icex*" attributes ++are set (here the word "icex" stands for "ignore copy-error on XATTR"). + +The meaning of these attributes is to ignore the error from setting +XATTR on that branch. @@ -1490,7 +1583,7 @@ index 0000000..d16f822 +now, aufs implements the branch attributes to ignore the error. diff --git a/Documentation/filesystems/aufs/design/07export.txt b/Documentation/filesystems/aufs/design/07export.txt new file mode 100644 -index 0000000..50744ea +index 0000000..221d70c --- /dev/null +++ b/Documentation/filesystems/aufs/design/07export.txt @@ -0,0 +1,45 @@ @@ -1521,10 +1614,10 @@ index 0000000..50744ea + + find the index of a branch from its id in handle, and check it is + still exist in aufs. + + 1st level: get the inode number from handle and search it in cache. -+ + 2nd level: if not found, get the parent inode number from handle and -+ search it in cache. and then open the parent dir, find the matching -+ inode number by vfs_readdir() and get its name, and call -+ lookup_one_len() for the target dentry. ++ + 2nd level: if not found in cache, get the parent inode number from ++ the handle and search it in cache. and then open the found parent ++ dir, find the matching inode number by vfs_readdir() and get its ++ name, and call lookup_one_len() for the target dentry. + + 3rd level: if the parent dir is not cached, call + exportfs_decode_fh() for a branch and get the parent on a branch, + build a pathname of it, convert it a pathname in aufs, call @@ -1586,10 +1679,10 @@ index 0000000..181dc02 +initramfs will use it to replace the old one at the next boot. diff --git a/Documentation/filesystems/aufs/design/10dynop.txt b/Documentation/filesystems/aufs/design/10dynop.txt new file mode 100644 -index 0000000..0e40da0 +index 0000000..9d502b5 --- /dev/null +++ b/Documentation/filesystems/aufs/design/10dynop.txt -@@ -0,0 +1,33 @@ +@@ -0,0 +1,34 @@ + +# Copyright (C) 2010-2015 Junjiro R. Okajima + @@ -1601,84 +1694,34 @@ index 0000000..0e40da0 +operation. Some FS have multiple sets of them. For instance, ext2 has +three sets, one for XIP, for NOBH, and for normal. +Since aufs overrides and redirects these operations, sometimes aufs has -+to change its behaviour according to the branch FS type. More imporantly ++to change its behaviour according to the branch FS type. More importantly +VFS acts differently if a function (member in the struct) is set or +not. It means aufs should have several sets of operations and select one +among them according to the branch FS definition. + -+In order to solve this problem and not to affect the behavour of VFS, ++In order to solve this problem and not to affect the behaviour of VFS, +aufs defines these operations dynamically. For instance, aufs defines -+aio_read function for struct file_operations, but it may not be set to -+the file_operations. When the branch FS doesn't have it, aufs doesn't -+set it to its file_operations while the function definition itself is -+still alive. So the behaviour of io_submit(2) will not change, and it -+will return an error when aio_read is not defined. ++dummy direct_IO function for struct address_space_operations, but it may ++not be set to the address_space_operations actually. When the branch FS ++doesn't have it, aufs doesn't set it to its address_space_operations ++while the function definition itself is still alive. So the behaviour ++itself will not change, and it will return an error when direct_IO is ++not set. + +The lifetime of these dynamically generated operation object is +maintained by aufs branch object. When the branch is removed from aufs, +the reference counter of the object is decremented. When it reaches +zero, the dynamically generated operation object will be freed. + -+This approach is designed to support AIO (io_submit), Direcit I/O and -+XIP mainly. -+Currently this approach is applied to file_operations and -+vm_operations_struct for regular files only. -diff --git a/Documentation/filesystems/aufs/design/99plan.txt b/Documentation/filesystems/aufs/design/99plan.txt -new file mode 100644 -index 0000000..73a8fae ---- /dev/null -+++ b/Documentation/filesystems/aufs/design/99plan.txt -@@ -0,0 +1,45 @@ -+ -+# Copyright (C) 2005-2015 Junjiro R. Okajima -+ -+Plan -+ -+Restoring some features which was implemented in aufs1. -+They were dropped in aufs2 in order to make source files simpler and -+easier to be reviewed. -+ -+ -+Being Another Aufs's Readonly Branch (robr) -+---------------------------------------------------------------------- -+Aufs1 allows aufs to be another aufs's readonly branch. -+This feature was developed by a user's request. But it may not be used -+currecnly. -+ -+ -+Refresh the Opened File (refrof) -+---------------------------------------------------------------------- -+This option is implemented in aufs1 but incomplete. -+ -+When user reads from a file, he expects to get its latest filedata -+generally. If the file is removed and a new same named file is created, -+the content he gets is unchanged, ie. the unlinked filedata. -+ -+Let's try case study again. -+- aufs has two branches. -+ /au = /rw + /ro -+- "fileA" exists under /ro, but /rw. -+- user opened "/au/fileA". -+- he or someone else inserts a branch (/new) between /rw and /ro. -+ /au = /rw + /new + /ro -+- the new branch has "fileA". -+- user reads from the opened "fileA" -+- which filedata should aufs return, from /ro or /new? -+ -+Some people says it has to be "from /ro" and it is a semantics of Unix. -+The others say it should be "from /new" because the file is not removed -+and it is equivalent to the case of someone else modifies the file. -+ -+Here again I don't have a best and final answer. I got an idea to -+implement 'refrof' and 'norefrof' option. When 'refrof' (REFResh the -+Opened File) is specified (by default), aufs returns the filedata from -+/new. -+Otherwise from /new. ++This approach is designed to support AIO (io_submit), Direct I/O and ++XIP (DAX) mainly. ++Currently this approach is applied to address_space_operations for ++regular files only. diff --git a/MAINTAINERS b/MAINTAINERS -index d66a97d..1c113a4 100644 +index d8afd29..feac5ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -1833,6 +1833,20 @@ F: include/linux/audit.h +@@ -1880,6 +1880,19 @@ F: include/linux/audit.h F: include/uapi/linux/audit.h F: kernel/audit* @@ -1687,8 +1730,7 @@ index d66a97d..1c113a4 100644 +L: linux-unionfs@vger.kernel.org +L: aufs-users@lists.sourceforge.net (members only) +W: http://aufs.sourceforge.net -+T: git://git.code.sf.net/p/aufs/aufs3-linux -+T: git://github.com/sfjro/aufs3-linux.git ++T: git://github.com/sfjro/aufs4-linux.git +S: Supported +F: Documentation/filesystems/aufs/ +F: Documentation/ABI/testing/debugfs-aufs @@ -1700,10 +1742,10 @@ index d66a97d..1c113a4 100644 M: Miguel Ojeda Sandonis W: http://miguelojeda.es/auxdisplay.htm diff --git a/drivers/block/loop.c b/drivers/block/loop.c -index 6cb1beb..30efd68 100644 +index d7173cb..0160952 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c -@@ -692,6 +692,24 @@ static inline int is_loop_device(struct file *file) +@@ -540,6 +540,24 @@ static inline int is_loop_device(struct file *file) return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR; } @@ -1729,22 +1771,22 @@ index 6cb1beb..30efd68 100644 static ssize_t loop_attr_show(struct device *dev, char *page, diff --git a/fs/Kconfig b/fs/Kconfig -index 664991a..1481093 100644 +index 011f433..b1083f6 100644 --- a/fs/Kconfig +++ b/fs/Kconfig -@@ -210,6 +210,7 @@ source "fs/ufs/Kconfig" +@@ -218,6 +218,7 @@ source "fs/pstore/Kconfig" + source "fs/sysv/Kconfig" + source "fs/ufs/Kconfig" source "fs/exofs/Kconfig" - source "fs/f2fs/Kconfig" - source "fs/efivarfs/Kconfig" +source "fs/aufs/Kconfig" endif # MISC_FILESYSTEMS diff --git a/fs/Makefile b/fs/Makefile -index bedff48..9e7c0b7 100644 +index cb92fd4..8c2df12 100644 --- a/fs/Makefile +++ b/fs/Makefile -@@ -126,3 +126,4 @@ obj-y += exofs/ # Multiple modules +@@ -127,3 +127,4 @@ obj-y += exofs/ # Multiple modules obj-$(CONFIG_CEPH_FS) += ceph/ obj-$(CONFIG_PSTORE) += pstore/ obj-$(CONFIG_EFIVAR_FS) += efivarfs/ @@ -2036,10 +2078,10 @@ index 0000000..75290bd +#endif /* __AUFS_H__ */ diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c new file mode 100644 -index 0000000..cf61201 +index 0000000..d34e789 --- /dev/null +++ b/fs/aufs/branch.c -@@ -0,0 +1,1397 @@ +@@ -0,0 +1,1401 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -2154,6 +2196,7 @@ index 0000000..cf61201 +{ + struct au_branch *add_branch; + struct dentry *root; ++ struct inode *inode; + int err; + + err = -ENOMEM; @@ -2185,8 +2228,10 @@ index 0000000..cf61201 + err = au_sbr_realloc(au_sbi(sb), new_nbranch); + if (!err) + err = au_di_realloc(au_di(root), new_nbranch); -+ if (!err) -+ err = au_ii_realloc(au_ii(root->d_inode), new_nbranch); ++ if (!err) { ++ inode = d_inode(root); ++ err = au_ii_realloc(au_ii(inode), new_nbranch); ++ } + if (!err) + return add_branch; /* success */ + @@ -2228,7 +2273,7 @@ index 0000000..cf61201 +{ + int err; + aufs_bindex_t bend, bindex; -+ struct dentry *root; ++ struct dentry *root, *h_dentry; + struct inode *inode, *h_inode; + + root = sb->s_root; @@ -2256,7 +2301,7 @@ index 0000000..cf61201 + goto out; + } + -+ inode = add->path.dentry->d_inode; ++ inode = d_inode(add->path.dentry); + err = -ENOENT; + if (unlikely(!inode->i_nlink)) { + pr_err("no existence %s\n", add->pathname); @@ -2281,7 +2326,7 @@ index 0000000..cf61201 + goto out; + } + -+ err = test_br(add->path.dentry->d_inode, add->perm, add->pathname); ++ err = test_br(d_inode(add->path.dentry), add->perm, add->pathname); + if (unlikely(err)) + goto out; + @@ -2298,7 +2343,8 @@ index 0000000..cf61201 + + err = 0; + if (au_opt_test(au_mntflags(sb), WARN_PERM)) { -+ h_inode = au_h_dptr(root, 0)->d_inode; ++ h_dentry = au_h_dptr(root, 0); ++ h_inode = d_inode(h_dentry); + if ((h_inode->i_mode & S_IALLUGO) != (inode->i_mode & S_IALLUGO) + || !uid_eq(h_inode->i_uid, inode->i_uid) + || !gid_eq(h_inode->i_gid, inode->i_gid)) @@ -2325,6 +2371,7 @@ index 0000000..cf61201 + struct mutex *h_mtx; + struct au_wbr *wbr; + struct au_hinode *hdir; ++ struct dentry *h_dentry; + + err = vfsub_mnt_want_write(au_br_mnt(br)); + if (unlikely(err)) @@ -2337,10 +2384,11 @@ index 0000000..cf61201 + h_mtx = NULL; + bindex = au_br_index(sb, br->br_id); + if (0 <= bindex) { -+ hdir = au_hi(sb->s_root->d_inode, bindex); ++ hdir = au_hi(d_inode(sb->s_root), bindex); + au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); + } else { -+ h_mtx = &au_br_dentry(br)->d_inode->i_mutex; ++ h_dentry = au_br_dentry(br); ++ h_mtx = &d_inode(h_dentry)->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_PARENT); + } + if (!wbr) @@ -2403,6 +2451,7 @@ index 0000000..cf61201 + struct au_opt_add *add) +{ + int err; ++ struct inode *h_inode; + + err = 0; + memset(&br->br_xino, 0, sizeof(br->br_xino)); @@ -2423,7 +2472,8 @@ index 0000000..cf61201 + } + + if (au_opt_test(au_mntflags(sb), XINO)) { -+ err = au_xino_br(sb, br, add->path.dentry->d_inode->i_ino, ++ h_inode = d_inode(add->path.dentry); ++ err = au_xino_br(sb, br, h_inode->i_ino, + au_sbr(sb, 0)->br_xino.xi_file, /*do_test*/1); + if (unlikely(err)) { + AuDebugOn(br->br_xino.xi_file); @@ -2492,11 +2542,11 @@ index 0000000..cf61201 + aufs_bindex_t bindex) +{ + struct dentry *root, *h_dentry; -+ struct inode *root_inode; ++ struct inode *root_inode, *h_inode; + aufs_bindex_t bend, amount; + + root = sb->s_root; -+ root_inode = root->d_inode; ++ root_inode = d_inode(root); + bend = au_sbend(sb); + amount = bend + 1 - bindex; + h_dentry = au_br_dentry(br); @@ -2505,8 +2555,8 @@ index 0000000..cf61201 + au_br_do_add_hdp(au_di(root), bindex, bend, amount); + au_br_do_add_hip(au_ii(root_inode), bindex, bend, amount); + au_set_h_dptr(root, bindex, dget(h_dentry)); -+ au_set_h_iptr(root_inode, bindex, au_igrab(h_dentry->d_inode), -+ /*flags*/0); ++ h_inode = d_inode(h_dentry); ++ au_set_h_iptr(root_inode, bindex, au_igrab(h_inode), /*flags*/0); + au_sbilist_unlock(); +} + @@ -2519,7 +2569,7 @@ index 0000000..cf61201 + struct au_branch *add_branch; + + root = sb->s_root; -+ root_inode = root->d_inode; ++ root_inode = d_inode(root); + IMustLock(root_inode); + err = test_add(sb, add, remount); + if (unlikely(err < 0)) @@ -2555,7 +2605,7 @@ index 0000000..cf61201 + au_cpup_attr_all(root_inode, /*force*/1); + sb->s_maxbytes = h_dentry->d_sb->s_maxbytes; + } else -+ au_add_nlink(root_inode, h_dentry->d_inode); ++ au_add_nlink(root_inode, d_inode(h_dentry)); + + /* + * this test/set prevents aufs from handling unnecesary notify events @@ -2642,7 +2692,7 @@ index 0000000..cf61201 +static int au_test_dbusy(struct dentry *dentry, aufs_bindex_t bstart, + aufs_bindex_t bend) +{ -+ return au_test_ibusy(dentry->d_inode, bstart, bend); ++ return au_test_ibusy(d_inode(dentry), bstart, bend); +} + +/* @@ -2775,7 +2825,7 @@ index 0000000..cf61201 + + sigen = au_sigen(root->d_sb); + DiMustNoWaiters(root); -+ IiMustNoWaiters(root->d_inode); ++ IiMustNoWaiters(d_inode(root)); + di_write_unlock(root); + err = test_dentry_busy(root, bindex, sigen, verbose); + if (!err) @@ -2831,7 +2881,6 @@ index 0000000..cf61201 + unsigned long long ull, max; + aufs_bindex_t bstart; + struct file *file, **array; -+ struct inode *inode; + struct dentry *root; + struct au_hfile *hfile; + @@ -2852,8 +2901,7 @@ index 0000000..cf61201 + /* AuDbg("%pD\n", file); */ + fi_read_lock(file); + bstart = au_fbstart(file); -+ inode = file_inode(file); -+ if (!S_ISDIR(inode->i_mode)) { ++ if (!d_is_dir(file->f_path.dentry)) { + hfile = &au_fi(file)->fi_htop; + if (hfile->hf_br->br_id == br_id) + err = -EBUSY; @@ -2886,7 +2934,7 @@ index 0000000..cf61201 + break; + + /* AuDbg("%pD\n", file); */ -+ AuDebugOn(!S_ISDIR(file_inode(file)->i_mode)); ++ AuDebugOn(!d_is_dir(file->f_path.dentry)); + bfound = -1; + fidir = au_fi(file)->fi_hdir; + AuDebugOn(!fidir); @@ -2988,7 +3036,7 @@ index 0000000..cf61201 + SiMustWriteLock(sb); + + root = sb->s_root; -+ inode = root->d_inode; ++ inode = d_inode(root); + sbinfo = au_sbi(sb); + bend = sbinfo->si_bend; + @@ -3104,10 +3152,10 @@ index 0000000..cf61201 + } + + if (!bindex) { -+ au_cpup_attr_all(root->d_inode, /*force*/1); ++ au_cpup_attr_all(d_inode(root), /*force*/1); + sb->s_maxbytes = au_sbr_sb(sb, 0)->s_maxbytes; + } else -+ au_sub_nlink(root->d_inode, del->h_path.dentry->d_inode); ++ au_sub_nlink(d_inode(root), d_inode(del->h_path.dentry)); + if (au_opt_test(mnt_flags, PLINK)) + au_plink_half_refresh(sb, br_id); + @@ -3231,7 +3279,6 @@ index 0000000..cf61201 + aufs_bindex_t br_id; + unsigned char verbose, writer; + struct file *file, *hf, **array; -+ struct inode *inode; + struct au_hfile *hfile; + + mnt_flags = au_mntflags(sb); @@ -3260,10 +3307,9 @@ index 0000000..cf61201 + goto out_array; + } + -+ inode = file_inode(file); + hfile = &au_fi(file)->fi_htop; + hf = hfile->hf_file; -+ if (!S_ISREG(inode->i_mode) ++ if (!d_is_reg(file->f_path.dentry) + || !(file->f_mode & FMODE_WRITE) + || hfile->hf_br->br_id != br_id + || !(hf->f_mode & FMODE_WRITE)) @@ -3336,7 +3382,7 @@ index 0000000..cf61201 + } + AuDbg("bindex b%d\n", bindex); + -+ err = test_br(mod->h_root->d_inode, mod->perm, mod->path); ++ err = test_br(d_inode(mod->h_root), mod->perm, mod->path); + if (unlikely(err)) + goto out; + @@ -3364,7 +3410,7 @@ index 0000000..cf61201 + if (!au_br_writable(mod->perm)) { + /* rw --> ro, file might be mmapped */ + DiMustNoWaiters(root); -+ IiMustNoWaiters(root->d_inode); ++ IiMustNoWaiters(d_inode(root)); + di_write_unlock(root); + err = au_br_mod_files_ro(sb, bindex); + /* aufs_write_lock() calls ..._child() */ @@ -3439,10 +3485,10 @@ index 0000000..cf61201 +} diff --git a/fs/aufs/branch.h b/fs/aufs/branch.h new file mode 100644 -index 0000000..61f5ca1 +index 0000000..7b9e7c9 --- /dev/null +++ b/fs/aufs/branch.h -@@ -0,0 +1,254 @@ +@@ -0,0 +1,266 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -3582,6 +3628,18 @@ index 0000000..61f5ca1 +#endif +} + ++static inline int au_br_test_oflag(int oflag, struct au_branch *br) ++{ ++ int err, exec_flag; ++ ++ err = 0; ++ exec_flag = oflag & __FMODE_EXEC; ++ if (unlikely(exec_flag && (au_br_mnt(br)->mnt_flags & MNT_NOEXEC))) ++ err = -EACCES; ++ ++ return err; ++} ++ +/* ---------------------------------------------------------------------- */ + +/* branch.c */ @@ -3606,10 +3664,10 @@ index 0000000..61f5ca1 +static const loff_t au_loff_max = LLONG_MAX; + +int au_xib_trunc(struct super_block *sb); -+ssize_t xino_fread(au_readf_t func, struct file *file, void *buf, size_t size, ++ssize_t xino_fread(vfs_readf_t func, struct file *file, void *buf, size_t size, + loff_t *pos); -+ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size, -+ loff_t *pos); ++ssize_t xino_fwrite(vfs_writef_t func, struct file *file, void *buf, ++ size_t size, loff_t *pos); +struct file *au_xino_create2(struct file *base_file, struct file *copy_src); +struct file *au_xino_create(struct super_block *sb, char *fname, int silent); +ino_t au_xino_new_ino(struct super_block *sb); @@ -3699,10 +3757,10 @@ index 0000000..61f5ca1 +#endif /* __AUFS_BRANCH_H__ */ diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c new file mode 100644 -index 0000000..26ee630 +index 0000000..f6f6818 --- /dev/null +++ b/fs/aufs/cpup.c -@@ -0,0 +1,1290 @@ +@@ -0,0 +1,1306 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -3822,7 +3880,7 @@ index 0000000..26ee630 + + dt->dt_dentry = dentry; + dt->dt_h_path = *h_path; -+ h_inode = h_path->dentry->d_inode; ++ h_inode = d_inode(h_path->dentry); + dt->dt_atime = h_inode->i_atime; + dt->dt_mtime = h_inode->i_mtime; + /* smp_mb(); */ @@ -3858,6 +3916,8 @@ index 0000000..26ee630 + struct au_cpup_reg_attr *h_src_attr) +{ + int err, sbits, icex; ++ unsigned int mnt_flags; ++ unsigned char verbose; + struct iattr ia; + struct path h_path; + struct inode *h_isrc, *h_idst; @@ -3865,10 +3925,10 @@ index 0000000..26ee630 + struct au_branch *br; + + h_path.dentry = au_h_dptr(dst, bindex); -+ h_idst = h_path.dentry->d_inode; ++ h_idst = d_inode(h_path.dentry); + br = au_sbr(dst->d_sb, bindex); + h_path.mnt = au_br_mnt(br); -+ h_isrc = h_src->d_inode; ++ h_isrc = d_inode(h_src); + ia.ia_valid = ATTR_FORCE | ATTR_UID | ATTR_GID + | ATTR_ATIME | ATTR_MTIME + | ATTR_ATIME_SET | ATTR_MTIME_SET; @@ -3909,8 +3969,11 @@ index 0000000..26ee630 + } + + icex = br->br_perm & AuBrAttr_ICEX; -+ if (!err) -+ err = au_cpup_xattr(h_path.dentry, h_src, icex); ++ if (!err) { ++ mnt_flags = au_mntflags(dst->d_sb); ++ verbose = !!au_opt_test(mnt_flags, VERBOSE); ++ err = au_cpup_xattr(h_path.dentry, h_src, icex, verbose); ++ } + + return err; +} @@ -4094,7 +4157,7 @@ index 0000000..26ee630 + } + + /* try stopping to update while we copyup */ -+ IMustLock(file[SRC].dentry->d_inode); ++ IMustLock(d_inode(file[SRC].dentry)); + err = au_copy_file(file[DST].file, file[SRC].file, cpg->len); + + fput(file[DST].file); @@ -4116,7 +4179,7 @@ index 0000000..26ee630 + struct inode *h_src_inode, *h_dst_inode; + + err = 0; -+ h_src_inode = au_h_iptr(cpg->dentry->d_inode, cpg->bsrc); ++ h_src_inode = au_h_iptr(d_inode(cpg->dentry), cpg->bsrc); + l = i_size_read(h_src_inode); + if (cpg->len == -1 || l < cpg->len) + cpg->len = l; @@ -4128,7 +4191,13 @@ index 0000000..26ee630 + h_path.dentry = au_h_dptr(cpg->dentry, cpg->bsrc); + h_path.mnt = au_sbr_mnt(cpg->dentry->d_sb, cpg->bsrc); + h_src_attr->iflags = h_src_inode->i_flags; -+ err = vfs_getattr(&h_path, &h_src_attr->st); ++ if (!au_test_nfs(h_src_inode->i_sb)) ++ err = vfs_getattr(&h_path, &h_src_attr->st); ++ else { ++ mutex_unlock(&h_src_inode->i_mutex); ++ err = vfs_getattr(&h_path, &h_src_attr->st); ++ mutex_lock_nested(&h_src_inode->i_mutex, AuLsc_I_CHILD); ++ } + if (unlikely(err)) { + mutex_unlock(&h_src_inode->i_mutex); + goto out; @@ -4142,7 +4211,7 @@ index 0000000..26ee630 + } + if (!err && (h_src_inode->i_state & I_LINKABLE)) { + h_path.dentry = au_h_dptr(cpg->dentry, cpg->bdst); -+ h_dst_inode = h_path.dentry->d_inode; ++ h_dst_inode = d_inode(h_path.dentry); + spin_lock(&h_dst_inode->i_lock); + h_dst_inode->i_state |= I_LINKABLE; + spin_unlock(&h_dst_inode->i_lock); @@ -4161,9 +4230,11 @@ index 0000000..26ee630 + char *k; + char __user *u; + } sym; ++ struct inode *h_inode = d_inode(h_src); ++ const struct inode_operations *h_iop = h_inode->i_op; + + err = -ENOSYS; -+ if (unlikely(!h_src->d_inode->i_op->readlink)) ++ if (unlikely(!h_iop->readlink)) + goto out; + + err = -ENOMEM; @@ -4174,7 +4245,7 @@ index 0000000..26ee630 + /* unnecessary to support mmap_sem since symlink is not mmap-able */ + old_fs = get_fs(); + set_fs(KERNEL_DS); -+ symlen = h_src->d_inode->i_op->readlink(h_src, sym.u, PATH_MAX); ++ symlen = h_iop->readlink(h_src, sym.u, PATH_MAX); + err = symlen; + set_fs(old_fs); + @@ -4200,13 +4271,13 @@ index 0000000..26ee630 + struct au_dtime dt; + struct path h_path; + struct dentry *h_src, *h_dst, *h_parent; -+ struct inode *h_inode, *h_dir; ++ struct inode *h_inode, *h_dir, *dir, *inode; + struct super_block *sb; + + /* bsrc branch can be ro/rw. */ + h_src = au_h_dptr(cpg->dentry, cpg->bsrc); -+ h_inode = h_src->d_inode; -+ AuDebugOn(h_inode != au_h_iptr(cpg->dentry->d_inode, cpg->bsrc)); ++ h_inode = d_inode(h_src); ++ AuDebugOn(h_inode != au_h_iptr(d_inode(cpg->dentry), cpg->bsrc)); + + /* try stopping to be referenced while we are creating */ + h_dst = au_h_dptr(cpg->dentry, cpg->bdst); @@ -4214,7 +4285,7 @@ index 0000000..26ee630 + AuDebugOn(strncmp(h_dst->d_name.name, AUFS_WH_PFX, + AUFS_WH_PFX_LEN)); + h_parent = h_dst->d_parent; /* dir inode is locked */ -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + IMustLock(h_dir); + AuDebugOn(h_parent != h_dst->d_parent); + @@ -4245,10 +4316,11 @@ index 0000000..26ee630 + * strange behaviour from the users view, + * particularry setattr case + */ -+ if (au_ibstart(dst_parent->d_inode) == cpg->bdst) -+ au_cpup_attr_nlink(dst_parent->d_inode, -+ /*force*/1); -+ au_cpup_attr_nlink(cpg->dentry->d_inode, /*force*/1); ++ dir = d_inode(dst_parent); ++ if (au_ibstart(dir) == cpg->bdst) ++ au_cpup_attr_nlink(dir, /*force*/1); ++ inode = d_inode(cpg->dentry); ++ au_cpup_attr_nlink(inode, /*force*/1); + } + break; + case S_IFLNK: @@ -4274,7 +4346,7 @@ index 0000000..26ee630 + && (h_inode->i_nlink == 1 + || (h_inode->i_state & I_LINKABLE)) + /* todo: unnecessary? */ -+ /* && cpg->dentry->d_inode->i_nlink == 1 */ ++ /* && d_inode(cpg->dentry)->i_nlink == 1 */ + && cpg->bdst < cpg->bsrc + && !au_ftest_cpup(cpg->flags, KEEPLINO)) + au_xino_write(sb, cpg->bsrc, h_inode->i_ino, /*ino*/0); @@ -4325,7 +4397,7 @@ index 0000000..26ee630 + goto out; + + h_parent = h_dentry->d_parent; /* dir inode is locked */ -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + IMustLock(h_dir); + AuDbg("%pd %pd\n", h_dentry, h_path->dentry); + /* no delegation since it is just created */ @@ -4349,7 +4421,7 @@ index 0000000..26ee630 + aufs_bindex_t old_ibstart; + unsigned char isdir, plink; + struct dentry *h_src, *h_dst, *h_parent; -+ struct inode *dst_inode, *h_dir, *inode, *delegated; ++ struct inode *dst_inode, *h_dir, *inode, *delegated, *src_inode; + struct super_block *sb; + struct au_branch *br; + /* to reuduce stack size */ @@ -4370,11 +4442,11 @@ index 0000000..26ee630 + a->h_path.mnt = au_br_mnt(br); + h_dst = au_h_dptr(cpg->dentry, cpg->bdst); + h_parent = h_dst->d_parent; /* dir inode is locked */ -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + IMustLock(h_dir); + + h_src = au_h_dptr(cpg->dentry, cpg->bsrc); -+ inode = cpg->dentry->d_inode; ++ inode = d_inode(cpg->dentry); + + if (!dst_parent) + dst_parent = dget_parent(cpg->dentry); @@ -4399,7 +4471,7 @@ index 0000000..26ee630 + err = PTR_ERR(h_src); + if (IS_ERR(h_src)) + goto out_parent; -+ if (unlikely(!h_src->d_inode)) { ++ if (unlikely(d_is_negative(h_src))) { + err = -EIO; + AuIOErr("i%lu exists on a upper branch " + "but not pseudo-linked\n", @@ -4438,7 +4510,7 @@ index 0000000..26ee630 + err = cpup_entry(cpg, dst_parent, &a->h_src_attr); + if (unlikely(err)) + goto out_rev; -+ dst_inode = h_dst->d_inode; ++ dst_inode = d_inode(h_dst); + mutex_lock_nested(&dst_inode->i_mutex, AuLsc_I_CHILD2); + /* todo: necessary? */ + /* au_pin_hdir_unlock(cpg->pin); */ @@ -4473,9 +4545,10 @@ index 0000000..26ee630 + if (unlikely(err)) + goto out_rev; + ++ src_inode = d_inode(h_src); + if (!isdir -+ && (h_src->d_inode->i_nlink > 1 -+ || h_src->d_inode->i_state & I_LINKABLE) ++ && (src_inode->i_nlink > 1 ++ || src_inode->i_state & I_LINKABLE) + && plink) + au_plink_append(inode, cpg->bdst, h_dst); + @@ -4492,7 +4565,7 @@ index 0000000..26ee630 + au_dtime_store(&a->dt, dst_parent, &a->h_path); + a->h_path.dentry = h_dst; + rerr = 0; -+ if (h_dst->d_inode) { ++ if (d_is_positive(h_dst)) { + if (!isdir) { + /* no delegation since it is just created */ + rerr = vfsub_unlink(h_dir, &a->h_path, @@ -4512,7 +4585,7 @@ index 0000000..26ee630 + return err; +} + -+#if 0 /* unused */ ++#if 0 /* reserved */ +struct au_cpup_single_args { + int *errp; + struct au_cp_generic *cpg; @@ -4568,14 +4641,14 @@ index 0000000..26ee630 + return do_sio; +} + -+#if 0 /* unused */ ++#if 0 /* reserved */ +int au_sio_cpup_single(struct au_cp_generic *cpg, struct dentry *dst_parent) +{ + int err, wkq_err; + struct dentry *h_dentry; + + h_dentry = au_h_dptr(cpg->dentry, cpg->bsrc); -+ if (!au_cpup_sio_test(pin, h_dentry->d_inode->i_mode)) ++ if (!au_cpup_sio_test(pin, d_inode(h_dentry)->i_mode)) + err = au_cpup_single(cpg, dst_parent); + else { + struct au_cpup_single_args args = { @@ -4656,9 +4729,9 @@ index 0000000..26ee630 + } + + parent = dget_parent(dentry); -+ h_dir = au_h_iptr(parent->d_inode, cpg->bdst); ++ h_dir = au_h_iptr(d_inode(parent), cpg->bdst); + if (!au_test_h_perm_sio(h_dir, MAY_EXEC | MAY_WRITE) -+ && !au_cpup_sio_test(cpg->pin, dentry->d_inode->i_mode)) ++ && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode)) + err = au_cpup_simple(cpg); + else { + struct au_cpup_simple_args args = { @@ -4689,7 +4762,7 @@ index 0000000..26ee630 + for (bsrc = cpg->bdst + 1; bsrc <= bend; bsrc++) { + h_dentry = au_h_dptr(dentry, bsrc); + if (h_dentry) { -+ AuDebugOn(!h_dentry->d_inode); ++ AuDebugOn(d_is_negative(h_dentry)); + break; + } + } @@ -4779,19 +4852,19 @@ index 0000000..26ee630 + + dget(wh_dentry); + h_path.dentry = wh_dentry; -+ if (!S_ISDIR(wh_dentry->d_inode->i_mode)) { ++ if (!d_is_dir(wh_dentry)) { + /* no delegation since it is just created */ -+ err = vfsub_unlink(h_parent->d_inode, &h_path, ++ err = vfsub_unlink(d_inode(h_parent), &h_path, + /*delegated*/NULL, /*force*/0); + } else -+ err = vfsub_rmdir(h_parent->d_inode, &h_path); ++ err = vfsub_rmdir(d_inode(h_parent), &h_path); + if (unlikely(err)) { + AuIOErr("failed remove copied-up tmp file %pd(%d)\n", + wh_dentry, err); + err = -EIO; + } + au_dtime_revert(&dt); -+ au_set_hi_wh(dentry->d_inode, bdst, wh_dentry); ++ au_set_hi_wh(d_inode(dentry), bdst, wh_dentry); + +out_wh: + dput(wh_dentry); @@ -4827,7 +4900,7 @@ index 0000000..26ee630 + dentry = cpg->dentry; + bdst = cpg->bdst; + parent = dget_parent(dentry); -+ dir = parent->d_inode; ++ dir = d_inode(parent); + h_orph = NULL; + h_parent = NULL; + h_dir = au_igrab(au_h_iptr(dir, bdst)); @@ -4839,7 +4912,7 @@ index 0000000..26ee630 + + h_parent = dget(au_h_dptr(parent, bdst)); + au_set_h_dptr(parent, bdst, dget(h_orph)); -+ h_tmpdir = h_orph->d_inode; ++ h_tmpdir = d_inode(h_orph); + au_set_h_iptr(dir, bdst, au_igrab(h_tmpdir), /*flags*/0); + + mutex_lock_nested(&h_tmpdir->i_mutex, AuLsc_I_PARENT3); @@ -4852,7 +4925,7 @@ index 0000000..26ee630 + } + + if (!au_test_h_perm_sio(h_tmpdir, MAY_EXEC | MAY_WRITE) -+ && !au_cpup_sio_test(cpg->pin, dentry->d_inode->i_mode)) ++ && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode)) + err = au_cpup_wh(cpg, file); + else { + struct au_cpup_wh_args args = { @@ -4893,7 +4966,7 @@ index 0000000..26ee630 +{ + int err; + struct au_pin pin; -+ struct dentry *d, *parent, *h_parent, *real_parent; ++ struct dentry *d, *parent, *h_parent, *real_parent, *h_dentry; + + err = 0; + parent = dget_parent(dentry); @@ -4926,8 +4999,9 @@ index 0000000..26ee630 + di_write_lock_child3(d); + + /* somebody else might create while we were sleeping */ -+ if (!au_h_dptr(d, bdst) || !au_h_dptr(d, bdst)->d_inode) { -+ if (au_h_dptr(d, bdst)) ++ h_dentry = au_h_dptr(d, bdst); ++ if (!h_dentry || d_is_negative(h_dentry)) { ++ if (h_dentry) + au_update_dbstart(d); + + au_pin_set_dentry(&pin, d); @@ -4977,7 +5051,7 @@ index 0000000..26ee630 + struct inode *dir; + + parent = dget_parent(dentry); -+ dir = parent->d_inode; ++ dir = d_inode(parent); + err = 0; + if (au_h_iptr(dir, bdst)) + goto out; @@ -5082,7 +5156,7 @@ index 0000000..3355f08 +#endif /* __AUFS_CPUP_H__ */ diff --git a/fs/aufs/dbgaufs.c b/fs/aufs/dbgaufs.c new file mode 100644 -index 0000000..68af344 +index 0000000..c7c612c --- /dev/null +++ b/fs/aufs/dbgaufs.c @@ -0,0 +1,419 @@ @@ -5432,7 +5506,7 @@ index 0000000..68af344 +void dbgaufs_si_fin(struct au_sbinfo *sbinfo) +{ + /* -+ * This function is a dynamic '__init' function actually, ++ * This function is a dynamic '__fin' function actually, + * so the tiny check for si_rwsem is unnecessary. + */ + /* AuRwMustWriteLock(&sbinfo->si_rwsem); */ @@ -5765,10 +5839,10 @@ index 0000000..f9d9d52 +} diff --git a/fs/aufs/dcsub.h b/fs/aufs/dcsub.h new file mode 100644 -index 0000000..3d18314 +index 0000000..2aa87ac --- /dev/null +++ b/fs/aufs/dcsub.h -@@ -0,0 +1,112 @@ +@@ -0,0 +1,123 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -5785,8 +5859,6 @@ index 0000000..3d18314 +#include +#include + -+struct dentry; -+ +struct au_dpage { + int ndentry; + struct dentry **dentries; @@ -5821,10 +5893,12 @@ index 0000000..3d18314 +static inline int au_d_hashed_positive(struct dentry *d) +{ + int err; -+ struct inode *inode = d->d_inode; ++ struct inode *inode = d_inode(d); + + err = 0; -+ if (unlikely(d_unhashed(d) || !inode || !inode->i_nlink)) ++ if (unlikely(d_unhashed(d) ++ || d_is_negative(d) ++ || !inode->i_nlink)) + err = -ENOENT; + return err; +} @@ -5832,11 +5906,11 @@ index 0000000..3d18314 +static inline int au_d_linkable(struct dentry *d) +{ + int err; -+ struct inode *inode = d->d_inode; ++ struct inode *inode = d_inode(d); + + err = au_d_hashed_positive(d); + if (err -+ && inode ++ && d_is_positive(d) + && (inode->i_state & I_LINKABLE)) + err = 0; + return err; @@ -5851,8 +5925,10 @@ index 0000000..3d18314 + if (!IS_ROOT(d)) + err = au_d_hashed_positive(d); + else { -+ inode = d->d_inode; -+ if (unlikely(d_unlinked(d) || !inode || !inode->i_nlink)) ++ inode = d_inode(d); ++ if (unlikely(d_unlinked(d) ++ || d_is_negative(d) ++ || !inode->i_nlink)) + err = -ENOENT; + } + return err; @@ -5863,7 +5939,7 @@ index 0000000..3d18314 + int err; + + err = au_d_alive(d); -+ if (unlikely(err || IS_DEADDIR(d->d_inode))) ++ if (unlikely(err || IS_DEADDIR(d_inode(d)))) + err = -ENOENT; + return err; +} @@ -5874,6 +5950,15 @@ index 0000000..3d18314 + && !memcmp(a->name, b->name, a->len); +} + ++/* ++ * by the commit ++ * 360f547 2015-01-25 dcache: let the dentry count go down to zero without ++ * taking d_lock ++ * the type of d_lockref.count became int, but the inlined function d_count() ++ * still returns unsigned int. ++ * I don't know why. Maybe it is for every d_count() users? ++ * Anyway au_dcount() lives on. ++ */ +static inline int au_dcount(struct dentry *d) +{ + return (int)d_count(d); @@ -5883,10 +5968,10 @@ index 0000000..3d18314 +#endif /* __AUFS_DCSUB_H__ */ diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c new file mode 100644 -index 0000000..b60f242 +index 0000000..e553cef --- /dev/null +++ b/fs/aufs/debug.c -@@ -0,0 +1,509 @@ +@@ -0,0 +1,427 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -5895,7 +5980,6 @@ index 0000000..b60f242 + * debug print functions + */ + -+#include +#include "aufs.h" + +/* Returns 0, or -errno. arg is in kp->arg. */ @@ -6068,14 +6152,16 @@ index 0000000..b60f242 + au_dcount(dentry), dentry->d_flags, + d_unhashed(dentry) ? "un" : ""); + hn = -1; -+ if (bindex >= 0 && dentry->d_inode && au_test_aufs(dentry->d_sb)) { -+ iinfo = au_ii(dentry->d_inode); ++ if (bindex >= 0 ++ && d_is_positive(dentry) ++ && au_test_aufs(dentry->d_sb)) { ++ iinfo = au_ii(d_inode(dentry)); + if (iinfo) { + hn = !!au_hn(iinfo->ii_hinode + bindex); + wh = iinfo->ii_hinode[0 + bindex].hi_whdentry; + } + } -+ do_pri_inode(bindex, dentry->d_inode, hn, wh); ++ do_pri_inode(bindex, d_inode(dentry), hn, wh); + return 0; +} + @@ -6114,7 +6200,7 @@ index 0000000..b60f242 + } + a[0] = 0; + if (bindex < 0 -+ && file->f_path.dentry ++ && !IS_ERR_OR_NULL(file->f_path.dentry) + && au_test_aufs(file->f_path.dentry->d_sb) + && au_fi(file)) + snprintf(a, sizeof(a), ", gen %d, mmapped %d", @@ -6122,7 +6208,7 @@ index 0000000..b60f242 + dpri("f%d: mode 0x%x, flags 0%o, cnt %ld, v %llu, pos %llu%s\n", + bindex, file->f_mode, file->f_flags, (long)file_count(file), + file->f_version, file->f_pos, a); -+ if (file->f_path.dentry) ++ if (!IS_ERR_OR_NULL(file->f_path.dentry)) + do_pri_dentry(bindex, file->f_path.dentry); + return 0; +} @@ -6137,7 +6223,7 @@ index 0000000..b60f242 + + err = do_pri_file(-1, file); + if (err -+ || !file->f_path.dentry ++ || IS_ERR_OR_NULL(file->f_path.dentry) + || !au_test_aufs(file->f_path.dentry->d_sb)) + return; + @@ -6228,45 +6314,9 @@ index 0000000..b60f242 + +/* ---------------------------------------------------------------------- */ + -+void au_dbg_sleep_jiffy(int jiffy) -+{ -+ while (jiffy) -+ jiffy = schedule_timeout_uninterruptible(jiffy); -+} -+ -+void au_dbg_iattr(struct iattr *ia) -+{ -+#define AuBit(name) \ -+ do { \ -+ if (ia->ia_valid & ATTR_ ## name) \ -+ dpri(#name "\n"); \ -+ } while (0) -+ AuBit(MODE); -+ AuBit(UID); -+ AuBit(GID); -+ AuBit(SIZE); -+ AuBit(ATIME); -+ AuBit(MTIME); -+ AuBit(CTIME); -+ AuBit(ATIME_SET); -+ AuBit(MTIME_SET); -+ AuBit(FORCE); -+ AuBit(ATTR_FLAG); -+ AuBit(KILL_SUID); -+ AuBit(KILL_SGID); -+ AuBit(FILE); -+ AuBit(KILL_PRIV); -+ AuBit(OPEN); -+ AuBit(TIMES_SET); -+#undef AuBit -+ dpri("ia_file %p\n", ia->ia_file); -+} -+ -+/* ---------------------------------------------------------------------- */ -+ +void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line) +{ -+ struct inode *h_inode, *inode = dentry->d_inode; ++ struct inode *h_inode, *inode = d_inode(dentry); + struct dentry *h_dentry; + aufs_bindex_t bindex, bend, bi; + @@ -6287,7 +6337,7 @@ index 0000000..b60f242 + if (!h_dentry) + continue; + h_inode = au_h_iptr(inode, bindex); -+ if (unlikely(h_inode != h_dentry->d_inode)) { ++ if (unlikely(h_inode != d_inode(h_dentry))) { + au_debug_on(); + AuDbg("b%d, %s:%d\n", bindex, func, line); + AuDbgDentry(dentry); @@ -6298,29 +6348,6 @@ index 0000000..b60f242 + } +} + -+void au_dbg_verify_dir_parent(struct dentry *dentry, unsigned int sigen) -+{ -+ struct dentry *parent; -+ -+ parent = dget_parent(dentry); -+ AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode)); -+ AuDebugOn(IS_ROOT(dentry)); -+ AuDebugOn(au_digen_test(parent, sigen)); -+ dput(parent); -+} -+ -+void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen) -+{ -+ struct dentry *parent; -+ struct inode *inode; -+ -+ parent = dget_parent(dentry); -+ inode = dentry->d_inode; -+ AuDebugOn(inode && S_ISDIR(dentry->d_inode->i_mode)); -+ AuDebugOn(au_digen_test(parent, sigen)); -+ dput(parent); -+} -+ +void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen) +{ + int err, i, j; @@ -6355,26 +6382,6 @@ index 0000000..b60f242 + +/* ---------------------------------------------------------------------- */ + -+void au_debug_sbinfo_init(struct au_sbinfo *sbinfo __maybe_unused) -+{ -+#ifdef AuForceNoPlink -+ au_opt_clr(sbinfo->si_mntflags, PLINK); -+#endif -+#ifdef AuForceNoXino -+ au_opt_clr(sbinfo->si_mntflags, XINO); -+#endif -+#ifdef AuForceNoRefrof -+ au_opt_clr(sbinfo->si_mntflags, REFROF); -+#endif -+#ifdef AuForceHnotify -+ au_opt_set_udba(sbinfo->si_mntflags, UDBA_HNOTIFY); -+#endif -+#ifdef AuForceRd0 -+ sbinfo->si_rdblk = 0; -+ sbinfo->si_rdhash = 0; -+#endif -+} -+ +int __init au_debug_init(void) +{ + aufs_bindex_t bindex; @@ -6390,18 +6397,14 @@ index 0000000..b60f242 + pr_warn("CONFIG_4KSTACKS is defined.\n"); +#endif + -+#ifdef AuForceNoBrs -+ sysaufs_brs = 0; -+#endif -+ + return 0; +} diff --git a/fs/aufs/debug.h b/fs/aufs/debug.h new file mode 100644 -index 0000000..67a34f7 +index 0000000..0a2e7e7 --- /dev/null +++ b/fs/aufs/debug.h -@@ -0,0 +1,249 @@ +@@ -0,0 +1,212 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -6497,8 +6500,6 @@ index 0000000..67a34f7 + +/* ---------------------------------------------------------------------- */ + -+struct au_sbinfo; -+struct au_finfo; +struct dentry; +#ifdef CONFIG_AUFS_DEBUG +extern struct mutex au_dbg_mtx; @@ -6516,19 +6517,13 @@ index 0000000..67a34f7 +struct super_block; +void au_dpri_sb(struct super_block *sb); + -+void au_dbg_sleep_jiffy(int jiffy); -+struct iattr; -+void au_dbg_iattr(struct iattr *ia); -+ +#define au_dbg_verify_dinode(d) __au_dbg_verify_dinode(d, __func__, __LINE__) +void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line); -+void au_dbg_verify_dir_parent(struct dentry *dentry, unsigned int sigen); -+void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen); +void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen); +void au_dbg_verify_kthread(void); + +int __init au_debug_init(void); -+void au_debug_sbinfo_init(struct au_sbinfo *sbinfo); ++ +#define AuDbgWhlist(w) do { \ + mutex_lock(&au_dbg_mtx); \ + AuDbg(#w "\n"); \ @@ -6578,41 +6573,16 @@ index 0000000..67a34f7 + mutex_unlock(&au_dbg_mtx); \ +} while (0) + -+#define AuDbgSleep(sec) do { \ -+ AuDbg("sleep %d sec\n", sec); \ -+ ssleep(sec); \ -+} while (0) -+ -+#define AuDbgSleepJiffy(jiffy) do { \ -+ AuDbg("sleep %d jiffies\n", jiffy); \ -+ au_dbg_sleep_jiffy(jiffy); \ -+} while (0) -+ -+#define AuDbgIAttr(ia) do { \ -+ AuDbg("ia_valid 0x%x\n", (ia)->ia_valid); \ -+ au_dbg_iattr(ia); \ -+} while (0) -+ +#define AuDbgSym(addr) do { \ + char sym[KSYM_SYMBOL_LEN]; \ + sprint_symbol(sym, (unsigned long)addr); \ + AuDbg("%s\n", sym); \ +} while (0) -+ -+#define AuInfoSym(addr) do { \ -+ char sym[KSYM_SYMBOL_LEN]; \ -+ sprint_symbol(sym, (unsigned long)addr); \ -+ AuInfo("%s\n", sym); \ -+} while (0) +#else +AuStubVoid(au_dbg_verify_dinode, struct dentry *dentry) -+AuStubVoid(au_dbg_verify_dir_parent, struct dentry *dentry, unsigned int sigen) -+AuStubVoid(au_dbg_verify_nondir_parent, struct dentry *dentry, -+ unsigned int sigen) +AuStubVoid(au_dbg_verify_gen, struct dentry *parent, unsigned int sigen) +AuStubVoid(au_dbg_verify_kthread, void) +AuStubInt0(__init au_debug_init, void) -+AuStubVoid(au_debug_sbinfo_init, struct au_sbinfo *sbinfo) + +#define AuDbgWhlist(w) do {} while (0) +#define AuDbgVdir(v) do {} while (0) @@ -6621,11 +6591,7 @@ index 0000000..67a34f7 +#define AuDbgDentry(d) do {} while (0) +#define AuDbgFile(f) do {} while (0) +#define AuDbgSb(sb) do {} while (0) -+#define AuDbgSleep(sec) do {} while (0) -+#define AuDbgSleepJiffy(jiffy) do {} while (0) -+#define AuDbgIAttr(ia) do {} while (0) +#define AuDbgSym(addr) do {} while (0) -+#define AuInfoSym(addr) do {} while (0) +#endif /* CONFIG_AUFS_DEBUG */ + +/* ---------------------------------------------------------------------- */ @@ -6653,10 +6619,10 @@ index 0000000..67a34f7 +#endif /* __AUFS_DEBUG_H__ */ diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c new file mode 100644 -index 0000000..dd7514b +index 0000000..993c95e --- /dev/null +++ b/fs/aufs/dentry.c -@@ -0,0 +1,1083 @@ +@@ -0,0 +1,1092 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -6691,7 +6657,7 @@ index 0000000..dd7514b + struct au_do_lookup_args *args) +{ + struct dentry *h_dentry; -+ struct inode *h_inode, *inode; ++ struct inode *h_inode; + struct au_branch *br; + int wh_found, opq; + unsigned char wh_able; @@ -6721,11 +6687,15 @@ index 0000000..dd7514b + h_dentry = vfsub_lkup_one(&dentry->d_name, h_parent); + else + h_dentry = au_sio_lkup_one(&dentry->d_name, h_parent); -+ if (IS_ERR(h_dentry)) ++ if (IS_ERR(h_dentry)) { ++ if (PTR_ERR(h_dentry) == -ENAMETOOLONG ++ && !allow_neg) ++ h_dentry = NULL; + goto out; ++ } + -+ h_inode = h_dentry->d_inode; -+ if (!h_inode) { ++ h_inode = d_inode(h_dentry); ++ if (d_is_negative(h_dentry)) { + if (!allow_neg) + goto out_neg; + } else if (wh_found @@ -6738,9 +6708,9 @@ index 0000000..dd7514b + au_set_dbstart(dentry, bindex); + au_set_h_dptr(dentry, bindex, h_dentry); + -+ inode = dentry->d_inode; -+ if (!h_inode || !S_ISDIR(h_inode->i_mode) || !wh_able -+ || (inode && !S_ISDIR(inode->i_mode))) ++ if (!d_is_dir(h_dentry) ++ || !wh_able ++ || (d_really_is_positive(dentry) && !d_is_dir(dentry))) + goto out; /* success */ + + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); @@ -6786,7 +6756,6 @@ index 0000000..dd7514b + }; + const struct qstr *name = &dentry->d_name; + struct dentry *parent; -+ struct inode *inode; + struct super_block *sb; + + sb = dentry->d_sb; @@ -6798,8 +6767,7 @@ index 0000000..dd7514b + if (unlikely(err)) + goto out; + -+ inode = dentry->d_inode; -+ isdir = !!(inode && S_ISDIR(inode->i_mode)); ++ isdir = !!d_is_dir(dentry); + if (!type) + au_fset_lkup(args.flags, ALLOW_NEG); + dirperm1 = !!au_opt_test(au_mntflags(sb), DIRPERM1); @@ -6813,19 +6781,17 @@ index 0000000..dd7514b + + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry) { -+ if (h_dentry->d_inode) ++ if (d_is_positive(h_dentry)) + npositive++; + if (type != S_IFDIR) + break; + continue; + } + h_parent = au_h_dptr(parent, bindex); -+ if (!h_parent) -+ continue; -+ h_dir = h_parent->d_inode; -+ if (!h_dir || !S_ISDIR(h_dir->i_mode)) ++ if (!h_parent || !d_is_dir(h_parent)) + continue; + ++ h_dir = d_inode(h_parent); + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); + h_dentry = au_do_lookup(h_parent, dentry, bindex, &whname, + &args); @@ -6833,7 +6799,8 @@ index 0000000..dd7514b + err = PTR_ERR(h_dentry); + if (IS_ERR(h_dentry)) + goto out_parent; -+ au_fclr_lkup(args.flags, ALLOW_NEG); ++ if (h_dentry) ++ au_fclr_lkup(args.flags, ALLOW_NEG); + if (dirperm1) + au_fset_lkup(args.flags, IGNORE_PERM); + @@ -6841,9 +6808,9 @@ index 0000000..dd7514b + break; + if (!h_dentry) + continue; -+ h_inode = h_dentry->d_inode; -+ if (!h_inode) ++ if (d_is_negative(h_dentry)) + continue; ++ h_inode = d_inode(h_dentry); + npositive++; + if (!args.type) + args.type = h_inode->i_mode & S_IFMT; @@ -6881,7 +6848,7 @@ index 0000000..dd7514b + struct dentry *dentry; + int wkq_err; + -+ if (!au_test_h_perm_sio(parent->d_inode, MAY_EXEC)) ++ if (!au_test_h_perm_sio(d_inode(parent), MAY_EXEC)) + dentry = vfsub_lkup_one(name, parent); + else { + struct vfsub_lkup_one_args args = { @@ -6917,7 +6884,7 @@ index 0000000..dd7514b + err = PTR_ERR(h_dentry); + if (IS_ERR(h_dentry)) + goto out; -+ if (unlikely(h_dentry->d_inode)) { ++ if (unlikely(d_is_positive(h_dentry))) { + err = -EIO; + AuIOErr("%pd should be negative on b%d.\n", h_dentry, bindex); + dput(h_dentry); @@ -6992,10 +6959,11 @@ index 0000000..dd7514b + err = 0; + memset(&ia, -1, sizeof(ia)); + h_sb = h_dentry->d_sb; -+ h_inode = h_dentry->d_inode; -+ if (h_inode) ++ h_inode = NULL; ++ if (d_is_positive(h_dentry)) { ++ h_inode = d_inode(h_dentry); + au_iattr_save(&ia, h_inode); -+ else if (au_test_nfs(h_sb) || au_test_fuse(h_sb)) ++ } else if (au_test_nfs(h_sb) || au_test_fuse(h_sb)) + /* nfs d_revalidate may return 0 for negative dentry */ + /* fuse d_revalidate always return 0 for negative dentry */ + goto out; @@ -7008,7 +6976,7 @@ index 0000000..dd7514b + + err = 0; + if (unlikely(h_d != h_dentry -+ || h_d->d_inode != h_inode ++ || d_inode(h_d) != h_inode + || (h_inode && au_iattr_test(&ia, h_inode)))) + err = au_busy_or_stale(); + dput(h_d); @@ -7027,7 +6995,7 @@ index 0000000..dd7514b + if (udba == AuOpt_UDBA_REVAL + && !au_test_fs_remote(h_dentry->d_sb)) { + IMustLock(h_dir); -+ err = (h_dentry->d_parent->d_inode != h_dir); ++ err = (d_inode(h_dentry->d_parent) != h_dir); + } else if (udba != AuOpt_UDBA_NONE) + err = au_h_verify_dentry(h_dentry, h_parent, br); + @@ -7119,9 +7087,9 @@ index 0000000..dd7514b +{ + struct inode *inode; + -+ inode = dentry->d_inode; -+ if (inode) { -+ if (!S_ISDIR(inode->i_mode)) { ++ if (d_really_is_positive(dentry)) { ++ inode = d_inode(dentry); ++ if (!d_is_dir(dentry)) { + if (inode->i_nlink && !d_unhashed(dentry)) + drop_nlink(inode); + } else { @@ -7168,11 +7136,9 @@ index 0000000..dd7514b +static void au_hide(struct dentry *dentry) +{ + int err; -+ struct inode *inode; + + AuDbgDentry(dentry); -+ inode = dentry->d_inode; -+ if (inode && S_ISDIR(inode->i_mode)) { ++ if (d_is_dir(dentry)) { + /* shrink_dcache_parent(dentry); */ + err = au_hide_children(dentry); + if (unlikely(err)) @@ -7220,20 +7186,26 @@ index 0000000..dd7514b + + err = 0; + AuDebugOn(dinfo->di_bstart < 0); -+ orig_h.dentry = dinfo->di_hdentry[dinfo->di_bstart].hd_dentry; -+ orig_h.inode = orig_h.dentry->d_inode; + orig_h.mode = 0; -+ if (orig_h.inode) ++ orig_h.dentry = dinfo->di_hdentry[dinfo->di_bstart].hd_dentry; ++ orig_h.inode = NULL; ++ if (d_is_positive(orig_h.dentry)) { ++ orig_h.inode = d_inode(orig_h.dentry); + orig_h.mode = orig_h.inode->i_mode & S_IFMT; ++ } + memset(&tmp_h, 0, sizeof(tmp_h)); + if (tmp->di_bstart >= 0) { + tmp_h.dentry = tmp->di_hdentry[tmp->di_bstart].hd_dentry; -+ tmp_h.inode = tmp_h.dentry->d_inode; -+ if (tmp_h.inode) ++ tmp_h.inode = NULL; ++ if (d_is_positive(tmp_h.dentry)) { ++ tmp_h.inode = d_inode(tmp_h.dentry); + tmp_h.mode = tmp_h.inode->i_mode & S_IFMT; ++ } + } + -+ inode = dentry->d_inode; ++ inode = NULL; ++ if (d_really_is_positive(dentry)) ++ inode = d_inode(dentry); + if (!orig_h.inode) { + AuDbg("nagative originally\n"); + if (inode) { @@ -7313,8 +7285,8 @@ index 0000000..dd7514b + h_dentry = hd[bindex].hd_dentry; + if (!h_dentry) + continue; -+ h_inode = h_dentry->d_inode; -+ AuDebugOn(!h_inode); ++ AuDebugOn(d_is_negative(h_dentry)); ++ h_inode = d_inode(h_dentry); + AuDebugOn(orig_h.mode + != (h_inode->i_mode + & S_IFMT)); @@ -7348,10 +7320,9 @@ index 0000000..dd7514b + + DiMustWriteLock(dentry); + AuDebugOn(IS_ROOT(dentry)); -+ AuDebugOn(!parent->d_inode); ++ AuDebugOn(d_really_is_negative(parent)); + + sb = dentry->d_sb; -+ inode = dentry->d_inode; + sigen = au_sigen(sb); + err = au_digen_test(parent, sigen); + if (unlikely(err)) @@ -7367,8 +7338,10 @@ index 0000000..dd7514b + + if (d_unhashed(dentry) || ebrange /* || dinfo->di_tmpfile */) { + AuDebugOn(au_dbstart(dentry) < 0 && au_dbend(dentry) >= 0); -+ if (inode) ++ if (d_really_is_positive(dentry)) { ++ inode = d_inode(dentry); + err = au_refresh_hinode_self(inode); ++ } + au_dbg_verify_dinode(dentry); + if (!err) + goto out_dgen; /* success */ @@ -7525,10 +7498,12 @@ index 0000000..dd7514b + continue; + + /* UDBA tests */ -+ h_inode = h_dentry->d_inode; -+ if (unlikely(!!inode != !!h_inode)) ++ if (unlikely(!!inode != d_is_positive(h_dentry))) + goto err; + ++ h_inode = NULL; ++ if (d_is_positive(h_dentry)) ++ h_inode = d_inode(h_dentry); + h_plus = plus; + h_mode = mode; + h_cached_inode = h_inode; @@ -7587,7 +7562,6 @@ index 0000000..dd7514b +{ + int err; + struct dentry *d, *parent; -+ struct inode *inode; + + if (!au_ftest_si(au_sbi(dentry->d_sb), FAILED_REFRESH_DIR)) + return simple_reval_dpath(dentry, sigen); @@ -7606,7 +7580,6 @@ index 0000000..dd7514b + d = parent; + } + -+ inode = d->d_inode; + if (d != dentry) + di_write_lock_child2(d); + @@ -7663,7 +7636,9 @@ index 0000000..dd7514b + AuTraceErr(err); + goto out; + } -+ inode = dentry->d_inode; ++ inode = NULL; ++ if (d_really_is_positive(dentry)) ++ inode = d_inode(dentry); + if (unlikely(inode && is_bad_inode(inode))) { + err = -EINVAL; + AuTraceErr(err); @@ -7968,10 +7943,10 @@ index 0000000..6516146 +#endif /* __AUFS_DENTRY_H__ */ diff --git a/fs/aufs/dinfo.c b/fs/aufs/dinfo.c new file mode 100644 -index 0000000..cd29ce0 +index 0000000..25b971b --- /dev/null +++ b/fs/aufs/dinfo.c -@@ -0,0 +1,531 @@ +@@ -0,0 +1,537 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -8181,24 +8156,30 @@ index 0000000..cd29ce0 + +void di_read_lock(struct dentry *d, int flags, unsigned int lsc) +{ ++ struct inode *inode; ++ + au_rw_read_lock_nested(&au_di(d)->di_rwsem, lsc); -+ if (d->d_inode) { ++ if (d_really_is_positive(d)) { ++ inode = d_inode(d); + if (au_ftest_lock(flags, IW)) -+ do_ii_write_lock(d->d_inode, lsc); ++ do_ii_write_lock(inode, lsc); + else if (au_ftest_lock(flags, IR)) -+ do_ii_read_lock(d->d_inode, lsc); ++ do_ii_read_lock(inode, lsc); + } +} + +void di_read_unlock(struct dentry *d, int flags) +{ -+ if (d->d_inode) { ++ struct inode *inode; ++ ++ if (d_really_is_positive(d)) { ++ inode = d_inode(d); + if (au_ftest_lock(flags, IW)) { + au_dbg_verify_dinode(d); -+ ii_write_unlock(d->d_inode); ++ ii_write_unlock(inode); + } else if (au_ftest_lock(flags, IR)) { + au_dbg_verify_dinode(d); -+ ii_read_unlock(d->d_inode); ++ ii_read_unlock(inode); + } + } + au_rw_read_unlock(&au_di(d)->di_rwsem); @@ -8206,30 +8187,30 @@ index 0000000..cd29ce0 + +void di_downgrade_lock(struct dentry *d, int flags) +{ -+ if (d->d_inode && au_ftest_lock(flags, IR)) -+ ii_downgrade_lock(d->d_inode); ++ if (d_really_is_positive(d) && au_ftest_lock(flags, IR)) ++ ii_downgrade_lock(d_inode(d)); + au_rw_dgrade_lock(&au_di(d)->di_rwsem); +} + +void di_write_lock(struct dentry *d, unsigned int lsc) +{ + au_rw_write_lock_nested(&au_di(d)->di_rwsem, lsc); -+ if (d->d_inode) -+ do_ii_write_lock(d->d_inode, lsc); ++ if (d_really_is_positive(d)) ++ do_ii_write_lock(d_inode(d), lsc); +} + +void di_write_unlock(struct dentry *d) +{ + au_dbg_verify_dinode(d); -+ if (d->d_inode) -+ ii_write_unlock(d->d_inode); ++ if (d_really_is_positive(d)) ++ ii_write_unlock(d_inode(d)); + au_rw_write_unlock(&au_di(d)->di_rwsem); +} + +void di_write_lock2_child(struct dentry *d1, struct dentry *d2, int isdir) +{ + AuDebugOn(d1 == d2 -+ || d1->d_inode == d2->d_inode ++ || d_inode(d1) == d_inode(d2) + || d1->d_sb != d2->d_sb); + + if (isdir && au_test_subdir(d1, d2)) { @@ -8245,7 +8226,7 @@ index 0000000..cd29ce0 +void di_write_lock2_parent(struct dentry *d1, struct dentry *d2, int isdir) +{ + AuDebugOn(d1 == d2 -+ || d1->d_inode == d2->d_inode ++ || d_inode(d1) == d_inode(d2) + || d1->d_sb != d2->d_sb); + + if (isdir && au_test_subdir(d1, d2)) { @@ -8261,7 +8242,7 @@ index 0000000..cd29ce0 +void di_write_unlock2(struct dentry *d1, struct dentry *d2) +{ + di_write_unlock(d1); -+ if (d1->d_inode == d2->d_inode) ++ if (d_inode(d1) == d_inode(d2)) + au_rw_write_unlock(&au_di(d2)->di_rwsem); + else + di_write_unlock(d2); @@ -8293,8 +8274,7 @@ index 0000000..cd29ce0 + struct dentry *h_dentry; + struct inode *inode, *h_inode; + -+ inode = dentry->d_inode; -+ AuDebugOn(!inode); ++ AuDebugOn(d_really_is_negative(dentry)); + + h_dentry = NULL; + if (au_dbstart(dentry) <= bindex @@ -8305,6 +8285,7 @@ index 0000000..cd29ce0 + goto out; /* success */ + } + ++ inode = d_inode(dentry); + AuDebugOn(bindex < au_ibstart(inode)); + AuDebugOn(au_ibend(inode) < bindex); + h_inode = au_h_iptr(inode, bindex); @@ -8404,7 +8385,7 @@ index 0000000..cd29ce0 + + err = 0; + if (unlikely(au_digen(dentry) != sigen -+ || au_iigen_test(dentry->d_inode, sigen))) ++ || au_iigen_test(d_inode(dentry), sigen))) + err = -EIO; + + return err; @@ -8435,7 +8416,7 @@ index 0000000..cd29ce0 + bend = dinfo->di_bend; + for (bindex = dinfo->di_bstart; bindex <= bend; bindex++) { + h_d = hdp[0 + bindex].hd_dentry; -+ if (h_d && !h_d->d_inode) ++ if (h_d && d_is_negative(h_d)) + au_set_h_dptr(dentry, bindex, NULL); + } + } @@ -8467,7 +8448,7 @@ index 0000000..cd29ce0 + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; -+ if (h_dentry->d_inode) { ++ if (d_is_positive(h_dentry)) { + au_set_dbstart(dentry, bindex); + return; + } @@ -8485,7 +8466,7 @@ index 0000000..cd29ce0 + h_dentry = au_h_dptr(dentry, bindex); + if (!h_dentry) + continue; -+ if (h_dentry->d_inode) { ++ if (d_is_positive(h_dentry)) { + au_set_dbend(dentry, bindex); + return; + } @@ -8505,10 +8486,10 @@ index 0000000..cd29ce0 +} diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c new file mode 100644 -index 0000000..ffee6b4 +index 0000000..6308190 --- /dev/null +++ b/fs/aufs/dir.c -@@ -0,0 +1,632 @@ +@@ -0,0 +1,740 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -8559,8 +8540,7 @@ index 0000000..ffee6b4 + + sz = 0; + if (file) { -+ AuDebugOn(!file_inode(file)); -+ AuDebugOn(!S_ISDIR(file_inode(file)->i_mode)); ++ AuDebugOn(!d_is_dir(file->f_path.dentry)); + + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); @@ -8572,16 +8552,15 @@ index 0000000..ffee6b4 + } + } else { + AuDebugOn(!dentry); -+ AuDebugOn(!dentry->d_inode); -+ AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode)); ++ AuDebugOn(!d_is_dir(dentry)); + + bend = au_dbtaildir(dentry); + for (bindex = au_dbstart(dentry); + bindex <= bend && sz < KMALLOC_MAX_SIZE; + bindex++) { + h_dentry = au_h_dptr(dentry, bindex); -+ if (h_dentry && h_dentry->d_inode) -+ sz += i_size_read(h_dentry->d_inode); ++ if (h_dentry && d_is_positive(h_dentry)) ++ sz += i_size_read(d_inode(h_dentry)); + } + } + if (sz < KMALLOC_MAX_SIZE) @@ -8595,6 +8574,110 @@ index 0000000..ffee6b4 + return sz; +} + ++struct au_dir_ts_arg { ++ struct dentry *dentry; ++ aufs_bindex_t brid; ++}; ++ ++static void au_do_dir_ts(void *arg) ++{ ++ struct au_dir_ts_arg *a = arg; ++ struct au_dtime dt; ++ struct path h_path; ++ struct inode *dir, *h_dir; ++ struct super_block *sb; ++ struct au_branch *br; ++ struct au_hinode *hdir; ++ int err; ++ aufs_bindex_t bstart, bindex; ++ ++ sb = a->dentry->d_sb; ++ if (d_really_is_negative(a->dentry)) ++ goto out; ++ aufs_read_lock(a->dentry, AuLock_DW | AuLock_DIR); /* noflush */ ++ ++ /* no dir->i_mutex lock */ ++ dir = d_inode(a->dentry); ++ bstart = au_ibstart(dir); ++ bindex = au_br_index(sb, a->brid); ++ if (bindex < bstart) ++ goto out_unlock; ++ ++ br = au_sbr(sb, bindex); ++ h_path.dentry = au_h_dptr(a->dentry, bindex); ++ if (!h_path.dentry) ++ goto out_unlock; ++ h_path.mnt = au_br_mnt(br); ++ au_dtime_store(&dt, a->dentry, &h_path); ++ ++ br = au_sbr(sb, bstart); ++ if (!au_br_writable(br->br_perm)) ++ goto out_unlock; ++ h_path.dentry = au_h_dptr(a->dentry, bstart); ++ h_path.mnt = au_br_mnt(br); ++ err = vfsub_mnt_want_write(h_path.mnt); ++ if (err) ++ goto out_unlock; ++ hdir = au_hi(dir, bstart); ++ au_hn_imtx_lock_nested(hdir, AuLsc_I_PARENT); ++ h_dir = au_h_iptr(dir, bstart); ++ if (h_dir->i_nlink ++ && timespec_compare(&h_dir->i_mtime, &dt.dt_mtime) < 0) { ++ dt.dt_h_path = h_path; ++ au_dtime_revert(&dt); ++ } ++ au_hn_imtx_unlock(hdir); ++ vfsub_mnt_drop_write(h_path.mnt); ++ au_cpup_attr_timesizes(dir); ++ ++out_unlock: ++ aufs_read_unlock(a->dentry, AuLock_DW); ++out: ++ dput(a->dentry); ++ au_nwt_done(&au_sbi(sb)->si_nowait); ++ kfree(arg); ++} ++ ++void au_dir_ts(struct inode *dir, aufs_bindex_t bindex) ++{ ++ int perm, wkq_err; ++ aufs_bindex_t bstart; ++ struct au_dir_ts_arg *arg; ++ struct dentry *dentry; ++ struct super_block *sb; ++ ++ IMustLock(dir); ++ ++ dentry = d_find_any_alias(dir); ++ AuDebugOn(!dentry); ++ sb = dentry->d_sb; ++ bstart = au_ibstart(dir); ++ if (bstart == bindex) { ++ au_cpup_attr_timesizes(dir); ++ goto out; ++ } ++ ++ perm = au_sbr_perm(sb, bstart); ++ if (!au_br_writable(perm)) ++ goto out; ++ ++ arg = kmalloc(sizeof(*arg), GFP_NOFS); ++ if (!arg) ++ goto out; ++ ++ arg->dentry = dget(dentry); /* will be dput-ted by au_do_dir_ts() */ ++ arg->brid = au_sbr_id(sb, bindex); ++ wkq_err = au_wkq_nowait(au_do_dir_ts, arg, sb, /*flags*/0); ++ if (unlikely(wkq_err)) { ++ pr_err("wkq %d\n", wkq_err); ++ dput(dentry); ++ kfree(arg); ++ } ++ ++out: ++ dput(dentry); ++} ++ +/* ---------------------------------------------------------------------- */ + +static int reopen_dir(struct file *file) @@ -8641,18 +8724,18 @@ index 0000000..ffee6b4 + return err; +} + -+static int do_open_dir(struct file *file, int flags) ++static int do_open_dir(struct file *file, int flags, struct file *h_file) +{ + int err; + aufs_bindex_t bindex, btail; + struct dentry *dentry, *h_dentry; -+ struct file *h_file; + + FiMustWriteLock(file); ++ AuDebugOn(h_file); + + err = 0; + dentry = file->f_path.dentry; -+ file->f_version = dentry->d_inode->i_version; ++ file->f_version = d_inode(dentry)->i_version; + bindex = au_dbstart(dentry); + au_set_fbstart(file, bindex); + btail = au_dbtaildir(dentry); @@ -8696,7 +8779,11 @@ index 0000000..ffee6b4 + si_read_lock(sb, AuLock_FLUSH); + fidir = au_fidir_alloc(sb); + if (fidir) { -+ err = au_do_open(file, do_open_dir, fidir); ++ struct au_do_open_args args = { ++ .open = do_open_dir, ++ .fidir = fidir ++ }; ++ err = au_do_open(file, &args); + if (unlikely(err)) + kfree(fidir); + } @@ -8772,7 +8859,7 @@ index 0000000..ffee6b4 + + err = 0; + sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + IMustLock(inode); + bend = au_dbend(dentry); + for (bindex = au_dbstart(dentry); !err && bindex <= bend; bindex++) { @@ -8803,8 +8890,8 @@ index 0000000..ffee6b4 + if (unlikely(err)) + goto out; + -+ sb = file->f_path.dentry->d_sb; + inode = file_inode(file); ++ sb = inode->i_sb; + bend = au_fbend_dir(file); + for (bindex = au_fbstart(file); !err && bindex <= bend; bindex++) { + h_file = au_hf_dir(file, bindex); @@ -8826,12 +8913,14 @@ index 0000000..ffee6b4 +{ + int err; + struct dentry *dentry; ++ struct inode *inode; + struct super_block *sb; + struct mutex *mtx; + + err = 0; + dentry = file->f_path.dentry; -+ mtx = &dentry->d_inode->i_mutex; ++ inode = d_inode(dentry); ++ mtx = &inode->i_mutex; + mutex_lock(mtx); + sb = dentry->d_sb; + si_noflush_read_lock(sb); @@ -8841,7 +8930,7 @@ index 0000000..ffee6b4 + di_write_lock_child(dentry); + err = au_do_fsync_dir_no_file(dentry, datasync); + } -+ au_cpup_attr_timesizes(dentry->d_inode); ++ au_cpup_attr_timesizes(inode); + di_write_unlock(dentry); + if (file) + fi_write_unlock(file); @@ -8863,7 +8952,7 @@ index 0000000..ffee6b4 + AuDbg("%pD, ctx{%pf, %llu}\n", file, ctx->actor, ctx->pos); + + dentry = file->f_path.dentry; -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + IMustLock(inode); + + sb = dentry->d_sb; @@ -9019,7 +9108,7 @@ index 0000000..ffee6b4 + struct inode *h_inode; + + h_dentry = au_h_dptr(dentry, arg->bindex); -+ h_inode = h_dentry->d_inode; ++ h_inode = d_inode(h_dentry); + /* todo: i_mode changes anytime? */ + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); + err = au_test_h_perm_sio(h_inode, MAY_EXEC | MAY_READ); @@ -9084,7 +9173,7 @@ index 0000000..ffee6b4 + struct dentry *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); -+ if (h_dentry && h_dentry->d_inode) { ++ if (h_dentry && d_is_positive(h_dentry)) { + arg.bindex = bindex; + err = test_empty(dentry, &arg); + } @@ -9116,7 +9205,7 @@ index 0000000..ffee6b4 + struct dentry *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); -+ if (h_dentry && h_dentry->d_inode) { ++ if (h_dentry && d_is_positive(h_dentry)) { + arg.bindex = bindex; + err = sio_test_empty(dentry, &arg); + } @@ -9143,10 +9232,10 @@ index 0000000..ffee6b4 +}; diff --git a/fs/aufs/dir.h b/fs/aufs/dir.h new file mode 100644 -index 0000000..cefad5a +index 0000000..803a0f1 --- /dev/null +++ b/fs/aufs/dir.h -@@ -0,0 +1,117 @@ +@@ -0,0 +1,118 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -9226,6 +9315,7 @@ index 0000000..cefad5a +void au_add_nlink(struct inode *dir, struct inode *h_dir); +void au_sub_nlink(struct inode *dir, struct inode *h_dir); +loff_t au_dir_size(struct file *file, struct dentry *dentry); ++void au_dir_ts(struct inode *dir, aufs_bindex_t bsrc); +int au_test_empty_lower(struct dentry *dentry); +int au_test_empty(struct dentry *dentry, struct au_nhash *whlist); + @@ -9266,10 +9356,10 @@ index 0000000..cefad5a +#endif /* __AUFS_DIR_H__ */ diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c new file mode 100644 -index 0000000..b1052e9 +index 0000000..1f12838 --- /dev/null +++ b/fs/aufs/dynop.c -@@ -0,0 +1,366 @@ +@@ -0,0 +1,356 @@ +/* + * Copyright (C) 2010-2015 Junjiro R. Okajima + */ @@ -9445,9 +9535,8 @@ index 0000000..b1052e9 + DySetAop(invalidatepage); + DySetAop(releasepage); + DySetAop(freepage); -+ /* these two will be changed according to an aufs mount option */ ++ /* this one will be changed according to an aufs mount option */ + DySetAop(direct_IO); -+ DySetAop(get_xip_mem); + DySetAop(migratepage); + DySetAop(launder_page); + DySetAop(is_partially_uptodate); @@ -9457,7 +9546,6 @@ index 0000000..b1052e9 + DySetAop(swap_deactivate); + + DyDbgSize(cnt, *h_aop); -+ dyaop->da_get_xip_mem = h_aop->get_xip_mem; +} + +/* ---------------------------------------------------------------------- */ @@ -9521,21 +9609,13 @@ index 0000000..b1052e9 + * of the succeeding I/O. The dio mount option enables O_DIRECT and makes + * open(O_DIRECT) always succeed, but the succeeding I/O may return an error. + * See the aufs manual in detail. -+ * -+ * To keep this behaviour, aufs has to set NULL to ->get_xip_mem too, and the -+ * performance of fadvise() and madvise() may be affected. + */ +static void dy_adx(struct au_dyaop *dyaop, int do_dx) +{ -+ if (!do_dx) { ++ if (!do_dx) + dyaop->da_op.direct_IO = NULL; -+ dyaop->da_op.get_xip_mem = NULL; -+ } else { ++ else + dyaop->da_op.direct_IO = aufs_aop.direct_IO; -+ dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem; -+ if (!dyaop->da_get_xip_mem) -+ dyaop->da_op.get_xip_mem = NULL; -+ } +} + +static struct au_dyaop *dy_aget(struct au_branch *br, @@ -9638,10 +9718,10 @@ index 0000000..b1052e9 +} diff --git a/fs/aufs/dynop.h b/fs/aufs/dynop.h new file mode 100644 -index 0000000..d68ec7a +index 0000000..6d739c1 --- /dev/null +++ b/fs/aufs/dynop.h -@@ -0,0 +1,62 @@ +@@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010-2015 Junjiro R. Okajima + */ @@ -9655,7 +9735,8 @@ index 0000000..d68ec7a + +#ifdef __KERNEL__ + -+#include "inode.h" ++#include ++#include + +enum {AuDy_AOP, AuDyLast}; + @@ -9685,8 +9766,6 @@ index 0000000..d68ec7a +struct au_dyaop { + struct au_dykey da_key; + struct address_space_operations da_op; /* not const */ -+ int (*da_get_xip_mem)(struct address_space *, pgoff_t, int, -+ void **, unsigned long *); +}; + +/* ---------------------------------------------------------------------- */ @@ -9706,10 +9785,10 @@ index 0000000..d68ec7a +#endif /* __AUFS_DYNOP_H__ */ diff --git a/fs/aufs/export.c b/fs/aufs/export.c new file mode 100644 -index 0000000..61501e1 +index 0000000..3026f39 --- /dev/null +++ b/fs/aufs/export.c -@@ -0,0 +1,818 @@ +@@ -0,0 +1,819 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -9945,7 +10024,7 @@ index 0000000..61501e1 + hlist_for_each_entry(d, &inode->i_dentry, d_u.d_alias) { + spin_lock(&d->d_lock); + if (!au_test_anon(d) -+ && d->d_parent->d_inode->i_ino == dir_ino) { ++ && d_inode(d->d_parent)->i_ino == dir_ino) { + dentry = dget_dlock(d); + spin_unlock(&d->d_lock); + break; @@ -10104,7 +10183,7 @@ index 0000000..61501e1 + goto out_name; + + /* do not call vfsub_lkup_one() */ -+ dir = parent->d_inode; ++ dir = d_inode(parent); + mutex_lock(&dir->i_mutex); + dentry = vfsub_lookup_one_len(arg.name, parent, arg.namelen); + mutex_unlock(&dir->i_mutex); @@ -10112,7 +10191,7 @@ index 0000000..61501e1 + if (IS_ERR(dentry)) + goto out_name; + AuDebugOn(au_test_anon(dentry)); -+ if (unlikely(!dentry->d_inode)) { ++ if (unlikely(d_really_is_negative(dentry))) { + dput(dentry); + dentry = ERR_PTR(-ENOENT); + } @@ -10253,10 +10332,10 @@ index 0000000..61501e1 + + dentry = ERR_PTR(-ENOENT); + AuDebugOn(au_test_anon(path.dentry)); -+ if (unlikely(!path.dentry->d_inode)) ++ if (unlikely(d_really_is_negative(path.dentry))) + goto out_path; + -+ if (ino != path.dentry->d_inode->i_ino) ++ if (ino != d_inode(path.dentry)->i_ino) + dentry = au_lkup_by_ino(&path, ino, /*nsi_lock*/NULL); + else + dentry = dget(path.dentry); @@ -10337,7 +10416,7 @@ index 0000000..61501e1 + +accept: + if (!au_digen_test(dentry, au_sigen(sb)) -+ && dentry->d_inode->i_generation == fh[Fh_igen]) ++ && d_inode(dentry)->i_generation == fh[Fh_igen]) + goto out_unlock; /* success */ + + dput(dentry); @@ -10421,7 +10500,8 @@ index 0000000..61501e1 + dput(dentry); + if (unlikely(!parent)) + goto out_unlock; -+ dir = parent->d_inode; ++ if (d_really_is_positive(parent)) ++ dir = d_inode(parent); + } + + ii_read_lock_parent(dir); @@ -10530,10 +10610,10 @@ index 0000000..61501e1 +} diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c new file mode 100644 -index 0000000..41c4c4a +index 0000000..91c2ce7 --- /dev/null +++ b/fs/aufs/f_op.c -@@ -0,0 +1,801 @@ +@@ -0,0 +1,725 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -10548,11 +10628,10 @@ index 0000000..41c4c4a +#include +#include "aufs.h" + -+int au_do_open_nondir(struct file *file, int flags) ++int au_do_open_nondir(struct file *file, int flags, struct file *h_file) +{ + int err; + aufs_bindex_t bindex; -+ struct file *h_file; + struct dentry *dentry; + struct au_finfo *finfo; + struct inode *h_inode; @@ -10561,11 +10640,15 @@ index 0000000..41c4c4a + + err = 0; + dentry = file->f_path.dentry; ++ AuDebugOn(IS_ERR_OR_NULL(dentry)); + finfo = au_fi(file); + memset(&finfo->fi_htop, 0, sizeof(finfo->fi_htop)); + atomic_set(&finfo->fi_mmapped, 0); + bindex = au_dbstart(dentry); -+ h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); ++ if (!h_file) ++ h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0); ++ else ++ get_file(h_file); + if (IS_ERR(h_file)) + err = PTR_ERR(h_file); + else { @@ -10591,13 +10674,16 @@ index 0000000..41c4c4a +{ + int err; + struct super_block *sb; ++ struct au_do_open_args args = { ++ .open = au_do_open_nondir ++ }; + + AuDbg("%pD, f_flags 0x%x, f_mode 0x%x\n", + file, vfsub_file_flags(file), file->f_mode); + + sb = file->f_path.dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH); -+ err = au_do_open(file, au_do_open_nondir, /*fidir*/NULL); ++ err = au_do_open(file, &args); + si_read_unlock(sb); + return err; +} @@ -10646,33 +10732,122 @@ index 0000000..41c4c4a + * read functions after [fdi]_rwsem are released, but it should be harmless. + */ + ++/* Callers should call au_read_post() or fput() in the end */ ++struct file *au_read_pre(struct file *file, int keep_fi) ++{ ++ struct file *h_file; ++ int err; ++ ++ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); ++ if (!err) { ++ di_read_unlock(file->f_path.dentry, AuLock_IR); ++ h_file = au_hf_top(file); ++ get_file(h_file); ++ if (!keep_fi) ++ fi_read_unlock(file); ++ } else ++ h_file = ERR_PTR(err); ++ ++ return h_file; ++} ++ ++static void au_read_post(struct inode *inode, struct file *h_file) ++{ ++ /* update without lock, I don't think it a problem */ ++ fsstack_copy_attr_atime(inode, file_inode(h_file)); ++ fput(h_file); ++} ++ ++struct au_write_pre { ++ blkcnt_t blks; ++ aufs_bindex_t bstart; ++}; ++ ++/* ++ * return with iinfo is write-locked ++ * callers should call au_write_post() or iinfo_write_unlock() + fput() in the ++ * end ++ */ ++static struct file *au_write_pre(struct file *file, int do_ready, ++ struct au_write_pre *wpre) ++{ ++ struct file *h_file; ++ struct dentry *dentry; ++ int err; ++ struct au_pin pin; ++ ++ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); ++ h_file = ERR_PTR(err); ++ if (unlikely(err)) ++ goto out; ++ ++ dentry = file->f_path.dentry; ++ if (do_ready) { ++ err = au_ready_to_write(file, -1, &pin); ++ if (unlikely(err)) { ++ h_file = ERR_PTR(err); ++ di_write_unlock(dentry); ++ goto out_fi; ++ } ++ } ++ ++ di_downgrade_lock(dentry, /*flags*/0); ++ if (wpre) ++ wpre->bstart = au_fbstart(file); ++ h_file = au_hf_top(file); ++ get_file(h_file); ++ if (wpre) ++ wpre->blks = file_inode(h_file)->i_blocks; ++ if (do_ready) ++ au_unpin(&pin); ++ di_read_unlock(dentry, /*flags*/0); ++ ++out_fi: ++ fi_write_unlock(file); ++out: ++ return h_file; ++} ++ ++static void au_write_post(struct inode *inode, struct file *h_file, ++ struct au_write_pre *wpre, ssize_t written) ++{ ++ struct inode *h_inode; ++ ++ au_cpup_attr_timesizes(inode); ++ AuDebugOn(au_ibstart(inode) != wpre->bstart); ++ h_inode = file_inode(h_file); ++ inode->i_mode = h_inode->i_mode; ++ ii_write_unlock(inode); ++ fput(h_file); ++ ++ /* AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); */ ++ if (written > 0) ++ au_fhsm_wrote(inode->i_sb, wpre->bstart, ++ /*force*/h_inode->i_blocks > wpre->blks); ++} ++ +static ssize_t aufs_read(struct file *file, char __user *buf, size_t count, + loff_t *ppos) +{ + ssize_t err; -+ struct dentry *dentry; ++ struct inode *inode; + struct file *h_file; + struct super_block *sb; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) -+ goto out; + -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) ++ goto out; + + /* filedata may be obsoleted by concurrent copyup, but no problem */ + err = vfsub_read_u(h_file, buf, count, ppos); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); -+ fput(h_file); ++ au_read_post(inode, h_file); + +out: + si_read_unlock(sb); @@ -10705,53 +10880,24 @@ index 0000000..41c4c4a + size_t count, loff_t *ppos) +{ + ssize_t err; -+ blkcnt_t blks; -+ aufs_bindex_t bstart; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct inode *inode, *h_inode; -+ struct super_block *sb; ++ struct au_write_pre wpre; ++ struct inode *inode; + struct file *h_file; + char __user *buf = (char __user *)ubuf; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ goto out; -+ } -+ -+ bstart = au_fbstart(file); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ h_inode = file_inode(h_file); -+ blks = h_inode->i_blocks; -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ + err = vfsub_write_u(h_file, buf, count, ppos); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); -+ if (err > 0) -+ au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, err); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -10762,8 +10908,6 @@ index 0000000..41c4c4a + ssize_t err; + struct file *file; + ssize_t (*iter)(struct kiocb *, struct iov_iter *); -+ ssize_t (*aio)(struct kiocb *, const struct iovec *, unsigned long, -+ loff_t); + + err = security_file_permission(h_file, rw); + if (unlikely(err)) @@ -10771,14 +10915,10 @@ index 0000000..41c4c4a + + err = -ENOSYS; + iter = NULL; -+ aio = NULL; -+ if (rw == MAY_READ) { ++ if (rw == MAY_READ) + iter = h_file->f_op->read_iter; -+ aio = h_file->f_op->aio_read; -+ } else if (rw == MAY_WRITE) { ++ else if (rw == MAY_WRITE) + iter = h_file->f_op->write_iter; -+ aio = h_file->f_op->aio_write; -+ } + + file = kio->ki_filp; + kio->ki_filp = h_file; @@ -10786,10 +10926,6 @@ index 0000000..41c4c4a + lockdep_off(); + err = iter(kio, iov_iter); + lockdep_on(); -+ } else if (aio) { -+ lockdep_off(); -+ err = aio(kio, iov_iter->iov, iov_iter->nr_segs, kio->ki_pos); -+ lockdep_on(); + } else + /* currently there is no such fs */ + WARN_ON_ONCE(1); @@ -10803,28 +10939,23 @@ index 0000000..41c4c4a +{ + ssize_t err; + struct file *file, *h_file; -+ struct dentry *dentry; ++ struct inode *inode; + struct super_block *sb; + + file = kio->ki_filp; -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) -+ goto out; + -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) ++ goto out; + + err = au_do_iter(h_file, MAY_READ, kio, iov_iter); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); -+ fput(h_file); ++ au_read_post(inode, h_file); + +out: + si_read_unlock(sb); @@ -10834,53 +10965,24 @@ index 0000000..41c4c4a +static ssize_t aufs_write_iter(struct kiocb *kio, struct iov_iter *iov_iter) +{ + ssize_t err; -+ blkcnt_t blks; -+ aufs_bindex_t bstart; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct inode *inode, *h_inode; ++ struct au_write_pre wpre; ++ struct inode *inode; + struct file *file, *h_file; -+ struct super_block *sb; + + file = kio->ki_filp; -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ goto out; -+ } -+ -+ bstart = au_fbstart(file); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ h_inode = file_inode(h_file); -+ blks = h_inode->i_blocks; -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ + err = au_do_iter(h_file, MAY_WRITE, kio, iov_iter); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); -+ if (err > 0) -+ au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, err); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -10891,19 +10993,18 @@ index 0000000..41c4c4a +{ + ssize_t err; + struct file *h_file; -+ struct dentry *dentry; ++ struct inode *inode; + struct super_block *sb; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) ++ ++ h_file = au_read_pre(file, /*keep_fi*/1); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ err = -EINVAL; -+ h_file = au_hf_top(file); -+ get_file(h_file); + if (au_test_loopback_kthread()) { + au_warn_loopback(h_file->f_path.dentry->d_sb); + if (file->f_mapping != h_file->f_mapping) { @@ -10911,15 +11012,12 @@ index 0000000..41c4c4a + smp_mb(); /* unnecessary? */ + } + } -+ di_read_unlock(dentry, AuLock_IR); + fi_read_unlock(file); + + err = vfsub_splice_to(h_file, ppos, pipe, len, flags); + /* todo: necessasry? */ + /* file->f_ra = h_file->f_ra; */ -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(dentry->d_inode, file_inode(h_file)); -+ fput(h_file); ++ au_read_post(inode, h_file); + +out: + si_read_unlock(sb); @@ -10931,52 +11029,23 @@ index 0000000..41c4c4a + size_t len, unsigned int flags) +{ + ssize_t err; -+ blkcnt_t blks; -+ aufs_bindex_t bstart; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct inode *inode, *h_inode; -+ struct super_block *sb; ++ struct au_write_pre wpre; ++ struct inode *inode; + struct file *h_file; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ goto out; -+ } -+ -+ bstart = au_fbstart(file); -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ h_inode = file_inode(h_file); -+ blks = h_inode->i_blocks; -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ + err = vfsub_splice_from(pipe, h_file, ppos, len, flags); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ AuDbg("blks %llu, %llu\n", (u64)blks, (u64)h_inode->i_blocks); -+ if (err > 0) -+ au_fhsm_wrote(sb, bstart, /*force*/h_inode->i_blocks > blks); -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, err); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -10985,46 +11054,25 @@ index 0000000..41c4c4a + loff_t len) +{ + long err; -+ struct au_pin pin; -+ struct dentry *dentry; -+ struct super_block *sb; ++ struct au_write_pre wpre; + struct inode *inode; + struct file *h_file; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; -+ inode = dentry->d_inode; ++ inode = file_inode(file); + au_mtx_and_read_lock(inode); + -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) { -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ goto out; -+ } -+ -+ h_file = au_hf_top(file); -+ get_file(h_file); -+ au_unpin(&pin); -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+ + lockdep_off(); + err = vfs_fallocate(h_file, mode, offset, len); + lockdep_on(); -+ ii_write_lock_child(inode); -+ au_cpup_attr_timesizes(inode); -+ inode->i_mode = file_inode(h_file)->i_mode; -+ ii_write_unlock(inode); -+ fput(h_file); ++ au_write_post(inode, h_file, &wpre, /*written*/1); + +out: -+ si_read_unlock(sb); ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); + return err; +} @@ -11089,44 +11137,27 @@ index 0000000..41c4c4a +static int aufs_mmap(struct file *file, struct vm_area_struct *vma) +{ + int err; -+ aufs_bindex_t bstart; + const unsigned char wlock + = (file->f_mode & FMODE_WRITE) && (vma->vm_flags & VM_SHARED); -+ struct dentry *dentry; + struct super_block *sb; + struct file *h_file; -+ struct au_branch *br; -+ struct au_pin pin; ++ struct inode *inode; + + AuDbgVmRegion(file, vma); + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ inode = file_inode(file); ++ sb = inode->i_sb; + lockdep_off(); + si_read_lock(sb, AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) ++ ++ h_file = au_write_pre(file, wlock, /*wpre*/NULL); ++ lockdep_on(); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ if (wlock) { -+ err = au_ready_to_write(file, -1, &pin); -+ di_write_unlock(dentry); -+ if (unlikely(err)) { -+ fi_write_unlock(file); -+ goto out; -+ } -+ au_unpin(&pin); -+ } else -+ di_write_unlock(dentry); -+ -+ bstart = au_fbstart(file); -+ br = au_sbr(sb, bstart); -+ h_file = au_hf_top(file); -+ get_file(h_file); ++ err = 0; + au_set_mmapped(file); -+ fi_write_unlock(file); -+ lockdep_on(); -+ + au_vm_file_reset(vma, h_file); + /* + * we cannot call security_mmap_file() here since it may acquire @@ -11137,21 +11168,21 @@ index 0000000..41c4c4a + */ + if (!err) + err = h_file->f_op->mmap(h_file, vma); -+ if (unlikely(err)) -+ goto out_reset; -+ -+ au_vm_prfile_set(vma, file); -+ /* update without lock, I don't think it a problem */ -+ fsstack_copy_attr_atime(file_inode(file), file_inode(h_file)); -+ goto out_fput; /* success */ -+ -+out_reset: ++ if (!err) { ++ au_vm_prfile_set(vma, file); ++ fsstack_copy_attr_atime(inode, file_inode(h_file)); ++ goto out_fput; /* success */ ++ } + au_unset_mmapped(file); + au_vm_file_reset(vma, file); ++ +out_fput: -+ fput(h_file); + lockdep_off(); ++ ii_write_unlock(inode); ++ lockdep_on(); ++ fput(h_file); +out: ++ lockdep_off(); + si_read_unlock(sb); + lockdep_on(); + AuTraceErr(err); @@ -11164,45 +11195,29 @@ index 0000000..41c4c4a + int datasync) +{ + int err; -+ struct au_pin pin; -+ struct dentry *dentry; ++ struct au_write_pre wpre; + struct inode *inode; + struct file *h_file; -+ struct super_block *sb; -+ -+ dentry = file->f_path.dentry; -+ inode = dentry->d_inode; -+ sb = dentry->d_sb; -+ mutex_lock(&inode->i_mutex); -+ err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); -+ if (unlikely(err)) -+ goto out; + + err = 0; /* -EBADF; */ /* posix? */ + if (unlikely(!(file->f_mode & FMODE_WRITE))) -+ goto out_si; -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out_si; ++ goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) ++ inode = file_inode(file); ++ au_mtx_and_read_lock(inode); ++ ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out_unlock; -+ au_unpin(&pin); + -+ err = -EINVAL; -+ h_file = au_hf_top(file); + err = vfsub_fsync(h_file, &h_file->f_path, datasync); -+ au_cpup_attr_timesizes(inode); ++ au_write_post(inode, h_file, &wpre, /*written*/0); + +out_unlock: -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+out_si: -+ si_read_unlock(sb); -+out: ++ si_read_unlock(inode->i_sb); + mutex_unlock(&inode->i_mutex); ++out: + return err; +} + @@ -11211,28 +11226,22 @@ index 0000000..41c4c4a +static int aufs_aio_fsync_nondir(struct kiocb *kio, int datasync) +{ + int err; -+ struct au_pin pin; -+ struct dentry *dentry; ++ struct au_write_pre wpre; + struct inode *inode; + struct file *file, *h_file; + -+ file = kio->ki_filp; -+ dentry = file->f_path.dentry; -+ inode = dentry->d_inode; -+ au_mtx_and_read_lock(inode); -+ + err = 0; /* -EBADF; */ /* posix? */ + if (unlikely(!(file->f_mode & FMODE_WRITE))) + goto out; -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); -+ if (unlikely(err)) -+ goto out; + -+ err = au_ready_to_write(file, -1, &pin); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (unlikely(err)) ++ file = kio->ki_filp; ++ inode = file_inode(file); ++ au_mtx_and_read_lock(inode); ++ ++ h_file = au_write_pre(file, /*do_ready*/1, &wpre); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out_unlock; -+ au_unpin(&pin); + + err = -ENOSYS; + h_file = au_hf_top(file); @@ -11250,16 +11259,14 @@ index 0000000..41c4c4a + if (!err) + vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); + /*ignore*/ -+ au_cpup_attr_timesizes(inode); + mutex_unlock(h_mtx); + } ++ au_write_post(inode, h_file, &wpre, /*written*/0); + +out_unlock: -+ di_read_unlock(dentry, AuLock_IR); -+ fi_write_unlock(file); -+out: + si_read_unlock(inode->sb); + mutex_unlock(&inode->i_mutex); ++out: + return err; +} +#endif @@ -11268,22 +11275,19 @@ index 0000000..41c4c4a +{ + int err; + struct file *h_file; -+ struct dentry *dentry; + struct super_block *sb; + -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ sb = file->f_path.dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) ++ ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + -+ h_file = au_hf_top(file); + if (h_file->f_op->fasync) + err = h_file->f_op->fasync(fd, h_file, flag); -+ -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ fput(h_file); /* instead of au_read_post() */ + +out: + si_read_unlock(sb); @@ -11755,10 +11759,10 @@ index 0000000..47106cb +} diff --git a/fs/aufs/file.c b/fs/aufs/file.c new file mode 100644 -index 0000000..cf680cb +index 0000000..8b17fba --- /dev/null +++ b/fs/aufs/file.c -@@ -0,0 +1,816 @@ +@@ -0,0 +1,828 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -11791,20 +11795,17 @@ index 0000000..cf680cb + struct super_block *sb; + struct au_branch *br; + struct path h_path; -+ int err, exec_flag; ++ int err; + + /* a race condition can happen between open and unlink/rmdir */ + h_file = ERR_PTR(-ENOENT); + h_dentry = au_h_dptr(dentry, bindex); -+ if (au_test_nfsd() && !h_dentry) -+ goto out; -+ h_inode = h_dentry->d_inode; -+ if (au_test_nfsd() && !h_inode) ++ if (au_test_nfsd() && (!h_dentry || d_is_negative(h_dentry))) + goto out; ++ h_inode = d_inode(h_dentry); + spin_lock(&h_dentry->d_lock); + err = (!d_unhashed(dentry) && d_unlinked(h_dentry)) -+ || !h_inode -+ /* || !dentry->d_inode->i_nlink */ ++ /* || !d_inode(dentry)->i_nlink */ + ; + spin_unlock(&h_dentry->d_lock); + if (unlikely(err)) @@ -11812,13 +11813,13 @@ index 0000000..cf680cb + + sb = dentry->d_sb; + br = au_sbr(sb, bindex); -+ h_file = ERR_PTR(-EACCES); -+ exec_flag = flags & __FMODE_EXEC; -+ if (exec_flag && (au_br_mnt(br)->mnt_flags & MNT_NOEXEC)) ++ err = au_br_test_oflag(flags, br); ++ h_file = ERR_PTR(err); ++ if (unlikely(err)) + goto out; + + /* drop flags for writing */ -+ if (au_test_ro(sb, bindex, dentry->d_inode)) { ++ if (au_test_ro(sb, bindex, d_inode(dentry))) { + if (force_wr && !(flags & O_WRONLY)) + force_wr = 0; + flags = au_file_roflags(flags); @@ -11840,7 +11841,7 @@ index 0000000..cf680cb + if (IS_ERR(h_file)) + goto out_br; + -+ if (exec_flag) { ++ if (flags & __FMODE_EXEC) { + err = deny_write_access(h_file); + if (unlikely(err)) { + fput(h_file); @@ -11871,7 +11872,7 @@ index 0000000..cf680cb + .pin = &pin, + .flags = AuCpup_DTIME | AuCpup_HOPEN + }; -+ struct inode *inode, *delegated; ++ struct inode *delegated; + struct super_block *sb; + struct au_sbinfo *sbinfo; + struct au_fhsm *fhsm; @@ -11881,8 +11882,7 @@ index 0000000..cf680cb + struct au_hinode *hdir; + + DiMustWriteLock(dentry); -+ inode = dentry->d_inode; -+ IiMustWriteLock(inode); ++ IiMustWriteLock(d_inode(dentry)); + + err = 0; + if (IS_ROOT(dentry)) @@ -11904,7 +11904,7 @@ index 0000000..cf680cb + cmoo = au_br_cmoo(br->br_perm); + if (!cmoo) + goto out; -+ if (!S_ISREG(inode->i_mode)) ++ if (!d_is_reg(dentry)) + cmoo &= AuBrAttr_COO_ALL; + if (!cmoo) + goto out; @@ -11945,7 +11945,7 @@ index 0000000..cf680cb + + h_path.mnt = au_br_mnt(br); + h_path.dentry = au_h_dptr(dentry, cpg.bsrc); -+ hdir = au_hi(parent->d_inode, cpg.bsrc); ++ hdir = au_hi(d_inode(parent), cpg.bsrc); + delegated = NULL; + err = vfsub_unlink(hdir->hi_inode, &h_path, &delegated, /*force*/1); + au_unpin(&pin); @@ -11972,24 +11972,43 @@ index 0000000..cf680cb + return err; +} + -+int au_do_open(struct file *file, int (*open)(struct file *file, int flags), -+ struct au_fidir *fidir) ++int au_do_open(struct file *file, struct au_do_open_args *args) +{ -+ int err; ++ int err, no_lock = args->no_lock; + struct dentry *dentry; + struct au_finfo *finfo; + -+ err = au_finfo_init(file, fidir); ++ if (!no_lock) ++ err = au_finfo_init(file, args->fidir); ++ else { ++ lockdep_off(); ++ err = au_finfo_init(file, args->fidir); ++ lockdep_on(); ++ } + if (unlikely(err)) + goto out; + + dentry = file->f_path.dentry; -+ di_write_lock_child(dentry); -+ err = au_cmoo(dentry); -+ di_downgrade_lock(dentry, AuLock_IR); -+ if (!err) -+ err = open(file, vfsub_file_flags(file)); -+ di_read_unlock(dentry, AuLock_IR); ++ AuDebugOn(IS_ERR_OR_NULL(dentry)); ++ if (!no_lock) { ++ di_write_lock_child(dentry); ++ err = au_cmoo(dentry); ++ di_downgrade_lock(dentry, AuLock_IR); ++ if (!err) ++ err = args->open(file, vfsub_file_flags(file), NULL); ++ di_read_unlock(dentry, AuLock_IR); ++ } else { ++ err = au_cmoo(dentry); ++ if (!err) ++ err = args->open(file, vfsub_file_flags(file), ++ args->h_file); ++ if (!err && au_fbstart(file) != au_dbstart(dentry)) ++ /* ++ * cmoo happens after h_file was opened. ++ * need to refresh file later. ++ */ ++ atomic_dec(&au_fi(file)->fi_generation); ++ } + + finfo = au_fi(file); + if (!err) { @@ -11997,7 +12016,13 @@ index 0000000..cf680cb + au_sphl_add(&finfo->fi_hlist, + &au_sbi(file->f_path.dentry->d_sb)->si_files); + } -+ fi_write_unlock(file); ++ if (!no_lock) ++ fi_write_unlock(file); ++ else { ++ lockdep_off(); ++ fi_write_unlock(file); ++ lockdep_on(); ++ } + if (unlikely(err)) { + finfo->fi_hdir = NULL; + au_finfo_fin(file); @@ -12104,13 +12129,13 @@ index 0000000..cf680cb + }; + + au_update_dbstart(cpg.dentry); -+ inode = cpg.dentry->d_inode; ++ inode = d_inode(cpg.dentry); + h_inode = NULL; + if (au_dbstart(cpg.dentry) <= bcpup + && au_dbend(cpg.dentry) >= bcpup) { + h_dentry = au_h_dptr(cpg.dentry, bcpup); -+ if (h_dentry) -+ h_inode = h_dentry->d_inode; ++ if (h_dentry && d_is_positive(h_dentry)) ++ h_inode = d_inode(h_dentry); + } + hi_wh = au_hi_wh(inode, bcpup); + if (!hi_wh && !h_inode) @@ -12149,7 +12174,7 @@ index 0000000..cf680cb + }; + + sb = cpg.dentry->d_sb; -+ inode = cpg.dentry->d_inode; ++ inode = d_inode(cpg.dentry); + cpg.bsrc = au_fbstart(file); + err = au_test_ro(sb, cpg.bsrc, inode); + if (!err && (au_hf_top(file)->f_mode & FMODE_WRITE)) { @@ -12270,7 +12295,7 @@ index 0000000..cf680cb + err = 0; + finfo = au_fi(file); + sb = cpg.dentry->d_sb; -+ inode = cpg.dentry->d_inode; ++ inode = d_inode(cpg.dentry); + cpg.bdst = au_ibstart(inode); + if (cpg.bdst == finfo->fi_btop || IS_ROOT(cpg.dentry)) + goto out; @@ -12450,7 +12475,7 @@ index 0000000..cf680cb + + err = 0; + dentry = file->f_path.dentry; -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + sigen = au_sigen(dentry->d_sb); + fi_write_lock(file); + figen = au_figen(file); @@ -12498,16 +12523,8 @@ index 0000000..cf680cb +} + +/* it will never be called, but necessary to support O_DIRECT */ -+static ssize_t aufs_direct_IO(int rw, struct kiocb *iocb, -+ struct iov_iter *iter, loff_t offset) -+{ BUG(); return 0; } -+ -+/* -+ * it will never be called, but madvise and fadvise behaves differently -+ * when get_xip_mem is defined -+ */ -+static int aufs_get_xip_mem(struct address_space *mapping, pgoff_t pgoff, -+ int create, void **kmem, unsigned long *pfn) ++static ssize_t aufs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, ++ loff_t offset) +{ BUG(); return 0; } + +/* they will never be called. */ @@ -12555,7 +12572,6 @@ index 0000000..cf680cb +const struct address_space_operations aufs_aop = { + .readpage = aufs_readpage, + .direct_IO = aufs_direct_IO, -+ .get_xip_mem = aufs_get_xip_mem, +#ifdef CONFIG_AUFS_DEBUG + .writepage = aufs_writepage, + /* no writepages, because of writepage */ @@ -12577,10 +12593,10 @@ index 0000000..cf680cb +}; diff --git a/fs/aufs/file.h b/fs/aufs/file.h new file mode 100644 -index 0000000..643c6f4 +index 0000000..488473e --- /dev/null +++ b/fs/aufs/file.h -@@ -0,0 +1,271 @@ +@@ -0,0 +1,278 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -12643,8 +12659,14 @@ index 0000000..643c6f4 +unsigned int au_file_roflags(unsigned int flags); +struct file *au_h_open(struct dentry *dentry, aufs_bindex_t bindex, int flags, + struct file *file, int force_wr); -+int au_do_open(struct file *file, int (*open)(struct file *file, int flags), -+ struct au_fidir *fidir); ++struct au_do_open_args { ++ int no_lock; ++ int (*open)(struct file *file, int flags, ++ struct file *h_file); ++ struct au_fidir *fidir; ++ struct file *h_file; ++}; ++int au_do_open(struct file *file, struct au_do_open_args *args); +int au_reopen_nondir(struct file *file); +struct au_pin; +int au_ready_to_write(struct file *file, loff_t len, struct au_pin *pin); @@ -12673,8 +12695,9 @@ index 0000000..643c6f4 + +/* f_op.c */ +extern const struct file_operations aufs_file_fop; -+int au_do_open_nondir(struct file *file, int flags); ++int au_do_open_nondir(struct file *file, int flags, struct file *h_file); +int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file); ++struct file *au_read_pre(struct file *file, int keep_fi); + +/* finfo.c */ +void au_hfput(struct au_hfile *hf, struct file *file); @@ -12854,10 +12877,10 @@ index 0000000..643c6f4 +#endif /* __AUFS_FILE_H__ */ diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c new file mode 100644 -index 0000000..61e39eb +index 0000000..05732c9 --- /dev/null +++ b/fs/aufs/finfo.c -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -12896,6 +12919,7 @@ index 0000000..61e39eb + au_hfput(hf, file); + if (val) { + FiMustWriteLock(file); ++ AuDebugOn(IS_ERR_OR_NULL(file->f_path.dentry)); + hf->hf_file = val; + hf->hf_br = au_sbr(file->f_path.dentry->d_sb, bindex); + } @@ -13003,10 +13027,10 @@ index 0000000..61e39eb +} diff --git a/fs/aufs/fstype.h b/fs/aufs/fstype.h new file mode 100644 -index 0000000..6893432 +index 0000000..6c3e1de --- /dev/null +++ b/fs/aufs/fstype.h -@@ -0,0 +1,456 @@ +@@ -0,0 +1,387 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -13023,6 +13047,7 @@ index 0000000..6893432 +#include +#include +#include ++#include + +static inline int au_test_aufs(struct super_block *sb) +{ @@ -13105,60 +13130,6 @@ index 0000000..6893432 +#endif +} + -+static inline int au_test_ocfs2(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_OCFS2_FS) || defined(CONFIG_OCFS2_FS_MODULE) -+ return sb->s_magic == OCFS2_SUPER_MAGIC; -+#else -+ return 0; -+#endif -+} -+ -+static inline int au_test_ocfs2_dlmfs(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_OCFS2_FS_O2CB) || defined(CONFIG_OCFS2_FS_O2CB_MODULE) -+ return sb->s_magic == DLMFS_MAGIC; -+#else -+ return 0; -+#endif -+} -+ -+static inline int au_test_coda(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_CODA_FS) || defined(CONFIG_CODA_FS_MODULE) -+ return sb->s_magic == CODA_SUPER_MAGIC; -+#else -+ return 0; -+#endif -+} -+ -+static inline int au_test_v9fs(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_9P_FS) || defined(CONFIG_9P_FS_MODULE) -+ return sb->s_magic == V9FS_MAGIC; -+#else -+ return 0; -+#endif -+} -+ -+static inline int au_test_ext4(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_EXT4_FS) || defined(CONFIG_EXT4_FS_MODULE) -+ return sb->s_magic == EXT4_SUPER_MAGIC; -+#else -+ return 0; -+#endif -+} -+ -+static inline int au_test_sysv(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_SYSV_FS) || defined(CONFIG_SYSV_FS_MODULE) -+ return !strcmp(au_sbtype(sb), "sysv"); -+#else -+ return 0; -+#endif -+} -+ +static inline int au_test_ramfs(struct super_block *sb) +{ + return sb->s_magic == RAMFS_MAGIC; @@ -13213,15 +13184,6 @@ index 0000000..6893432 +#endif +} + -+static inline int au_test_cifs(struct super_block *sb __maybe_unused) -+{ -+#if defined(CONFIG_CIFS_FS) || defined(CONFIGCIFS_FS_MODULE) -+ return sb->s_magic == CIFS_MAGIC_NUMBER; -+#else -+ return 0; -+#endif -+} -+ +static inline int au_test_fat(struct super_block *sb __maybe_unused) +{ +#if defined(CONFIG_FAT_FS) || defined(CONFIG_FAT_FS_MODULE) @@ -13351,10 +13313,7 @@ index 0000000..6893432 +{ + return au_test_nfs(sb) + || au_test_fuse(sb) -+ /* || au_test_ocfs2(sb) */ /* untested */ + /* || au_test_btrfs(sb) */ /* untested */ -+ /* || au_test_coda(sb) */ /* untested */ -+ /* || au_test_v9fs(sb) */ /* untested */ + ; +} + @@ -13367,10 +13326,6 @@ index 0000000..6893432 + || au_test_btrfs(sb) + || au_test_ubifs(sb) + || au_test_hfsplus(sb) /* maintained, but incorrect */ -+ /* || au_test_ext4(sb) */ /* untested */ -+ /* || au_test_ocfs2(sb) */ /* untested */ -+ /* || au_test_ocfs2_dlmfs(sb) */ /* untested */ -+ /* || au_test_sysv(sb) */ /* untested */ + /* || au_test_minix(sb) */ /* untested */ + ; +} @@ -13382,7 +13337,6 @@ index 0000000..6893432 +static inline int au_test_fs_bad_iattr(struct super_block *sb) +{ + return au_test_fs_bad_iattr_size(sb) -+ /* || au_test_cifs(sb) */ /* untested */ + || au_test_fat(sb) + || au_test_msdos(sb) + || au_test_vfat(sb); @@ -13407,19 +13361,9 @@ index 0000000..6893432 + return au_test_nfs(sb) + || au_test_fuse(sb) + || au_test_ubifs(sb) -+ /* || au_test_cifs(sb) */ /* untested */ + ; +} + -+/* -+ * filesystems which requires replacing i_mapping. -+ */ -+static inline int au_test_fs_bad_mapping(struct super_block *sb) -+{ -+ return au_test_fuse(sb) -+ || au_test_ubifs(sb); -+} -+ +/* temporary support for i#1 in cramfs */ +static inline int au_test_fs_unique_ino(struct inode *inode) +{ @@ -13461,11 +13405,22 @@ index 0000000..6893432 + || au_test_romfs(sb); +} + ++/* ++ * test if the @inode is nfs with 'noacl' option ++ * NFS always sets MS_POSIXACL regardless its mount option 'noacl.' ++ */ ++static inline int au_test_nfs_noacl(struct inode *inode) ++{ ++ return au_test_nfs(inode->i_sb) ++ /* && IS_POSIXACL(inode) */ ++ && !nfs_server_capable(inode, NFS_CAP_ACLS); ++} ++ +#endif /* __KERNEL__ */ +#endif /* __AUFS_FSTYPE_H__ */ diff --git a/fs/aufs/hfsnotify.c b/fs/aufs/hfsnotify.c new file mode 100644 -index 0000000..2dd7419 +index 0000000..5c370196 --- /dev/null +++ b/fs/aufs/hfsnotify.c @@ -0,0 +1,275 @@ @@ -13597,7 +13552,7 @@ index 0000000..2dd7419 + test_ret(FS_UNMOUNT); + test_ret(FS_Q_OVERFLOW); + test_ret(FS_IN_IGNORED); -+ test_ret(FS_IN_ISDIR); ++ test_ret(FS_ISDIR); + test_ret(FS_IN_ONESHOT); + test_ret(FS_EVENT_ON_CHILD); + return ""; @@ -13746,7 +13701,7 @@ index 0000000..2dd7419 +}; diff --git a/fs/aufs/hfsplus.c b/fs/aufs/hfsplus.c new file mode 100644 -index 0000000..78ec26f +index 0000000..34c1f1a --- /dev/null +++ b/fs/aufs/hfsplus.c @@ -0,0 +1,43 @@ @@ -13774,11 +13729,11 @@ index 0000000..78ec26f + + h_dentry = au_h_dptr(dentry, bindex); + AuDebugOn(!h_dentry); -+ AuDebugOn(!h_dentry->d_inode); ++ AuDebugOn(d_is_negative(h_dentry)); + + h_file = NULL; + if (au_test_hfsplus(h_dentry->d_sb) -+ && S_ISREG(h_dentry->d_inode->i_mode)) ++ && d_is_reg(h_dentry)) + h_file = au_h_open(dentry, bindex, + O_RDONLY | O_NOATIME | O_LARGEFILE, + /*file*/NULL, force_wr); @@ -13795,10 +13750,10 @@ index 0000000..78ec26f +} diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c new file mode 100644 -index 0000000..a07e4f2 +index 0000000..3943dc4 --- /dev/null +++ b/fs/aufs/hnotify.c -@@ -0,0 +1,701 @@ +@@ -0,0 +1,697 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -13959,10 +13914,10 @@ index 0000000..a07e4f2 + continue; + + au_digen_dec(d); -+ if (d->d_inode) ++ if (d_really_is_positive(d)) + /* todo: reset children xino? + cached children only? */ -+ au_iigen_dec(d->d_inode); ++ au_iigen_dec(d_inode(d)); + } + } + @@ -14040,12 +13995,8 @@ index 0000000..a07e4f2 +static int hn_gen_by_name(struct dentry *dentry, const unsigned int isdir) +{ + int err; -+ struct inode *inode; + -+ inode = dentry->d_inode; -+ if (IS_ROOT(dentry) -+ /* || (inode && inode->i_ino == AUFS_ROOT_INO) */ -+ ) { ++ if (IS_ROOT(dentry)) { + pr_warn("branch root dir was changed\n"); + return 0; + } @@ -14053,11 +14004,11 @@ index 0000000..a07e4f2 + err = 0; + if (!isdir) { + au_digen_dec(dentry); -+ if (inode) -+ au_iigen_dec(inode); ++ if (d_really_is_positive(dentry)) ++ au_iigen_dec(d_inode(dentry)); + } else { + au_fset_si(au_sbi(dentry->d_sb), FAILED_REFRESH_DIR); -+ if (inode) ++ if (d_really_is_positive(dentry)) + err = hn_gen_tree(dentry); + } + @@ -14277,8 +14228,8 @@ index 0000000..a07e4f2 + dentry = lookup_wlock_by_name(a->h_child_name, a->h_child_nlen, + a->dir); + try_iput = 0; -+ if (dentry) -+ inode = dentry->d_inode; ++ if (dentry && d_really_is_positive(dentry)) ++ inode = d_inode(dentry); + if (xino && !inode && h_ino + && (au_ftest_hnjob(a->flags[AuHn_CHILD], XINO0) + || au_ftest_hnjob(a->flags[AuHn_CHILD], TRYXINO0) @@ -14502,10 +14453,10 @@ index 0000000..a07e4f2 +} diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c new file mode 100644 -index 0000000..e33cbec +index 0000000..20f26b2 --- /dev/null +++ b/fs/aufs/i_op.c -@@ -0,0 +1,1286 @@ +@@ -0,0 +1,1434 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -14539,13 +14490,19 @@ index 0000000..e33cbec + * - skip the lower fs test in the case of write to ro branch. + * - nfs dir permission write check is optimized, but a policy for + * link/rename requires a real check. ++ * - nfs always sets MS_POSIXACL regardless its mount option 'noacl.' ++ * in this case, generic_permission() returns -EOPNOTSUPP. + */ + if ((write_mask && !au_br_writable(brperm)) + || (au_test_nfs(h_inode->i_sb) && S_ISDIR(h_inode->i_mode) + && write_mask && !(mask & MAY_READ)) + || !h_inode->i_op->permission) { + /* AuLabel(generic_permission); */ ++ /* AuDbg("get_acl %pf\n", h_inode->i_op->get_acl); */ + err = generic_permission(h_inode, mask); ++ if (err == -EOPNOTSUPP && au_test_nfs_noacl(h_inode)) ++ err = h_inode->i_op->permission(h_inode, mask); ++ AuTraceErr(err); + } else { + /* AuLabel(h_inode->permission); */ + err = h_inode->i_op->permission(h_inode, mask); @@ -14749,6 +14706,149 @@ index 0000000..e33cbec + +/* ---------------------------------------------------------------------- */ + ++struct aopen_node { ++ struct hlist_node hlist; ++ struct file *file, *h_file; ++}; ++ ++static int au_do_aopen(struct inode *inode, struct file *file) ++{ ++ struct au_sphlhead *aopen; ++ struct aopen_node *node; ++ struct au_do_open_args args = { ++ .no_lock = 1, ++ .open = au_do_open_nondir ++ }; ++ ++ aopen = &au_sbi(inode->i_sb)->si_aopen; ++ spin_lock(&aopen->spin); ++ hlist_for_each_entry(node, &aopen->head, hlist) ++ if (node->file == file) { ++ args.h_file = node->h_file; ++ break; ++ } ++ spin_unlock(&aopen->spin); ++ /* AuDebugOn(!args.h_file); */ ++ ++ return au_do_open(file, &args); ++} ++ ++static int aufs_atomic_open(struct inode *dir, struct dentry *dentry, ++ struct file *file, unsigned int open_flag, ++ umode_t create_mode, int *opened) ++{ ++ int err, h_opened = *opened; ++ struct dentry *parent; ++ struct dentry *d; ++ struct au_sphlhead *aopen; ++ struct vfsub_aopen_args args = { ++ .open_flag = open_flag, ++ .create_mode = create_mode, ++ .opened = &h_opened ++ }; ++ struct aopen_node aopen_node = { ++ .file = file ++ }; ++ ++ IMustLock(dir); ++ AuDbg("open_flag 0x%x\n", open_flag); ++ AuDbgDentry(dentry); ++ ++ err = 0; ++ if (!au_di(dentry)) { ++ d = aufs_lookup(dir, dentry, /*flags*/0); ++ if (IS_ERR(d)) { ++ err = PTR_ERR(d); ++ goto out; ++ } else if (d) { ++ /* ++ * obsoleted dentry found. ++ * another error will be returned later. ++ */ ++ d_drop(d); ++ dput(d); ++ AuDbgDentry(d); ++ } ++ AuDbgDentry(dentry); ++ } ++ ++ if (d_is_positive(dentry) ++ || d_unhashed(dentry) ++ || d_unlinked(dentry) ++ || !(open_flag & O_CREAT)) ++ goto out_no_open; ++ ++ err = aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH | AuLock_GEN); ++ if (unlikely(err)) ++ goto out; ++ ++ parent = dentry->d_parent; /* dir is locked */ ++ di_write_lock_parent(parent); ++ err = au_lkup_dentry(dentry, /*bstart*/0, /*type*/0); ++ if (unlikely(err)) ++ goto out_unlock; ++ ++ AuDbgDentry(dentry); ++ if (d_is_positive(dentry)) ++ goto out_unlock; ++ ++ args.file = get_empty_filp(); ++ err = PTR_ERR(args.file); ++ if (IS_ERR(args.file)) ++ goto out_unlock; ++ ++ args.file->f_flags = file->f_flags; ++ err = au_aopen_or_create(dir, dentry, &args); ++ AuTraceErr(err); ++ AuDbgFile(args.file); ++ if (unlikely(err < 0)) { ++ if (h_opened & FILE_OPENED) ++ fput(args.file); ++ else ++ put_filp(args.file); ++ goto out_unlock; ++ } ++ ++ /* some filesystems don't set FILE_CREATED while succeeded? */ ++ *opened |= FILE_CREATED; ++ if (h_opened & FILE_OPENED) ++ aopen_node.h_file = args.file; ++ else { ++ put_filp(args.file); ++ args.file = NULL; ++ } ++ aopen = &au_sbi(dir->i_sb)->si_aopen; ++ au_sphl_add(&aopen_node.hlist, aopen); ++ err = finish_open(file, dentry, au_do_aopen, opened); ++ au_sphl_del(&aopen_node.hlist, aopen); ++ AuTraceErr(err); ++ AuDbgFile(file); ++ if (aopen_node.h_file) ++ fput(aopen_node.h_file); ++ ++out_unlock: ++ di_write_unlock(parent); ++ aufs_read_unlock(dentry, AuLock_DW); ++ AuDbgDentry(dentry); ++ if (unlikely(err)) ++ goto out; ++out_no_open: ++ if (!err && !(*opened & FILE_CREATED)) { ++ AuLabel(out_no_open); ++ dget(dentry); ++ err = finish_no_open(file, dentry); ++ } ++out: ++ AuDbg("%pd%s%s\n", dentry, ++ (*opened & FILE_CREATED) ? " created" : "", ++ (*opened & FILE_OPENED) ? " opened" : ""); ++ AuTraceErr(err); ++ return err; ++} ++ ++ ++/* ---------------------------------------------------------------------- */ ++ +static int au_wr_dir_cpup(struct dentry *dentry, struct dentry *parent, + const unsigned char add_entry, aufs_bindex_t bcpup, + aufs_bindex_t bstart) @@ -14758,7 +14858,7 @@ index 0000000..e33cbec + struct inode *h_dir; + + if (add_entry) -+ IMustLock(parent->d_inode); ++ IMustLock(d_inode(parent)); + else + di_write_lock_parent(parent); + @@ -14773,16 +14873,15 @@ index 0000000..e33cbec + } + if (!err && add_entry && !au_ftest_wrdir(add_entry, TMPFILE)) { + h_parent = au_h_dptr(parent, bcpup); -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); -+ err = au_lkup_neg(dentry, bcpup, -+ au_ftest_wrdir(add_entry, TMP_WHENTRY)); ++ err = au_lkup_neg(dentry, bcpup, /*wh*/0); + /* todo: no unlock here */ + mutex_unlock(&h_dir->i_mutex); + + AuDbg("bcpup %d\n", bcpup); + if (!err) { -+ if (!dentry->d_inode) ++ if (d_really_is_negative(dentry)) + au_set_h_dptr(dentry, bstart, NULL); + au_update_dbrange(dentry, /*do_put_zero*/0); + } @@ -14810,7 +14909,6 @@ index 0000000..e33cbec + aufs_bindex_t bcpup, bstart, src_bstart; + const unsigned char add_entry + = au_ftest_wrdir(args->flags, ADD_ENTRY) -+ | au_ftest_wrdir(args->flags, TMP_WHENTRY) + | au_ftest_wrdir(args->flags, TMPFILE); + struct super_block *sb; + struct dentry *parent; @@ -14834,7 +14932,7 @@ index 0000000..e33cbec + bcpup = err; + } + -+ if (bcpup < 0 || au_test_ro(sb, bcpup, dentry->d_inode)) { ++ if (bcpup < 0 || au_test_ro(sb, bcpup, d_inode(dentry))) { + if (add_entry) + err = AuWbrCopyup(sbinfo, dentry); + else { @@ -14851,7 +14949,7 @@ index 0000000..e33cbec + } + } else { + bcpup = args->force_btgt; -+ AuDebugOn(au_test_ro(sb, bcpup, dentry->d_inode)); ++ AuDebugOn(au_test_ro(sb, bcpup, d_inode(dentry))); + } + + AuDbg("bstart %d, bcpup %d\n", bstart, bcpup); @@ -14862,7 +14960,7 @@ index 0000000..e33cbec + /* copyup the new parent into the branch we process */ + err = au_wr_dir_cpup(dentry, parent, add_entry, bcpup, bstart); + if (err >= 0) { -+ if (!dentry->d_inode) { ++ if (d_really_is_negative(dentry)) { + au_set_h_dptr(dentry, bstart, NULL); + au_set_dbstart(dentry, bcpup); + au_set_dbend(dentry, bcpup); @@ -14897,7 +14995,7 @@ index 0000000..e33cbec + au_hn_imtx_lock_nested(p->hdir, p->lsc_hi); + + err = -EBUSY; -+ if (unlikely(p->hdir->hi_inode != p->h_parent->d_inode)) ++ if (unlikely(p->hdir->hi_inode != d_inode(p->h_parent))) + goto out; + + err = 0; @@ -14925,9 +15023,10 @@ index 0000000..e33cbec + for (i = 0; !err && i < sizeof(h_d)/sizeof(*h_d); i++) { + if (!h_d[i]) + continue; -+ h_i = h_d[i]->d_inode; -+ if (h_i) ++ if (d_is_positive(h_d[i])) { ++ h_i = d_inode(h_d[i]); + err = !h_i->i_nlink; ++ } + } + +out: @@ -15015,7 +15114,7 @@ index 0000000..e33cbec + + h_dir = NULL; + p->h_parent = au_h_dptr(p->parent, p->bindex); -+ p->hdir = au_hi(p->parent->d_inode, p->bindex); ++ p->hdir = au_hi(d_inode(p->parent), p->bindex); + if (p->hdir) + h_dir = p->hdir->hi_inode; + @@ -15102,11 +15201,9 @@ index 0000000..e33cbec +int au_reval_for_attr(struct dentry *dentry, unsigned int sigen) +{ + int err; -+ struct inode *inode; + struct dentry *parent; + + err = 0; -+ inode = dentry->d_inode; + if (au_digen_test(dentry, sigen)) { + parent = dget_parent(dentry); + di_read_lock_parent(parent, AuLock_IR); @@ -15132,11 +15229,11 @@ index 0000000..e33cbec + .flags = 0 + }; + -+ bstart = au_dbstart(dentry); -+ inode = dentry->d_inode; -+ if (S_ISDIR(inode->i_mode)) ++ if (d_is_dir(dentry)) + au_fset_wrdir(wr_dir_args.flags, ISDIR); + /* plink or hi_wh() case */ ++ bstart = au_dbstart(dentry); ++ inode = d_inode(dentry); + ibstart = au_ibstart(inode); + if (bstart != ibstart && !au_test_ro(inode->i_sb, ibstart, inode)) + wr_dir_args.force_btgt = ibstart; @@ -15161,8 +15258,8 @@ index 0000000..e33cbec + goto out_parent; + + a->h_path.dentry = au_h_dptr(dentry, bstart); -+ a->h_inode = a->h_path.dentry->d_inode; + sz = -1; ++ a->h_inode = d_inode(a->h_path.dentry); + if (ia && (ia->ia_valid & ATTR_SIZE)) { + mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); + if (ia->ia_size < i_size_read(a->h_inode)) @@ -15216,7 +15313,7 @@ index 0000000..e33cbec + a->h_path.dentry = hi_wh; /* do not dget here */ + +out_unlock: -+ a->h_inode = a->h_path.dentry->d_inode; ++ a->h_inode = d_inode(a->h_path.dentry); + if (!err) + goto out; /* success */ + au_unpin(&a->pin); @@ -15239,7 +15336,7 @@ index 0000000..e33cbec + struct file *file; + struct au_icpup_args *a; + -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + IMustLock(inode); + + err = -ENOMEM; @@ -15258,7 +15355,7 @@ index 0000000..e33cbec + + if (ia->ia_valid & ATTR_FILE) { + /* currently ftruncate(2) only */ -+ AuDebugOn(!S_ISREG(inode->i_mode)); ++ AuDebugOn(!d_is_reg(dentry)); + file = ia->ia_file; + err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1); + if (unlikely(err)) @@ -15387,7 +15484,7 @@ index 0000000..e33cbec + struct au_icpup_args *a; + struct inode *inode, *h_inode; + -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + IMustLock(inode); + + err = -ENOMEM; @@ -15418,7 +15515,7 @@ index 0000000..e33cbec + break; + case AU_ACL_SET: + err = -EOPNOTSUPP; -+ h_inode = h_path.dentry->d_inode; ++ h_inode = d_inode(h_path.dentry); + if (h_inode->i_op->set_acl) + err = h_inode->i_op->set_acl(h_inode, + arg->u.acl_set.acl, @@ -15521,7 +15618,7 @@ index 0000000..e33cbec + } else + di_read_lock_child(dentry, AuLock_IR); + -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + bindex = au_ibstart(inode); + h_path->mnt = au_sbr_mnt(sb, bindex); + h_sb = h_path->mnt->mnt_sb; @@ -15554,7 +15651,7 @@ index 0000000..e33cbec + struct inode *inode; + struct super_block *sb; + -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + sb = dentry->d_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) @@ -15566,13 +15663,13 @@ index 0000000..e33cbec + /* illegally overlapped or something */ + goto out_fill; /* pretending success */ + -+ positive = !!h_path.dentry->d_inode; ++ positive = d_is_positive(h_path.dentry); + if (positive) + err = vfs_getattr(&h_path, st); + if (!err) { + if (positive) + au_refresh_iattr(inode, st, -+ h_path.dentry->d_inode->i_nlink); ++ d_inode(h_path.dentry)->i_nlink); + goto out_fill; /* success */ + } + AuTraceErr(err); @@ -15597,10 +15694,12 @@ index 0000000..e33cbec + int err; + struct super_block *sb; + struct dentry *h_dentry; ++ struct inode *inode, *h_inode; + + err = -EINVAL; + h_dentry = au_h_dptr(dentry, bindex); -+ if (unlikely(!h_dentry->d_inode->i_op->readlink)) ++ h_inode = d_inode(h_dentry); ++ if (unlikely(!h_inode->i_op->readlink)) + goto out; + + err = security_inode_readlink(h_dentry); @@ -15608,11 +15707,12 @@ index 0000000..e33cbec + goto out; + + sb = dentry->d_sb; -+ if (!au_test_ro(sb, bindex, dentry->d_inode)) { ++ inode = d_inode(dentry); ++ if (!au_test_ro(sb, bindex, inode)) { + vfsub_touch_atime(au_sbr_mnt(sb, bindex), h_dentry); -+ fsstack_copy_attr_atime(dentry->d_inode, h_dentry->d_inode); ++ fsstack_copy_attr_atime(inode, h_inode); + } -+ err = h_dentry->d_inode->i_op->readlink(h_dentry, buf, bufsiz); ++ err = h_inode->i_op->readlink(h_dentry, buf, bufsiz); + +out: + return err; @@ -15768,8 +15868,7 @@ index 0000000..e33cbec +#endif + + .update_time = aufs_update_time, -+ /* no support for atomic_open() */ -+ ++ .atomic_open = aufs_atomic_open, + .tmpfile = aufs_tmpfile +}; + @@ -15794,10 +15893,10 @@ index 0000000..e33cbec +}; diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c new file mode 100644 -index 0000000..a76e11d6 +index 0000000..0c3530e --- /dev/null +++ b/fs/aufs/i_op_add.c -@@ -0,0 +1,878 @@ +@@ -0,0 +1,919 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -15827,7 +15926,7 @@ index 0000000..a76e11d6 + bwh = -1; + sb = dir->i_sb; + if (wh_dentry) { -+ h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locked */ ++ h_dir = d_inode(wh_dentry->d_parent); /* dir inode is locked */ + IMustLock(h_dir); + AuDebugOn(au_h_iptr(dir, bindex) != h_dir); + bwh = au_dbwh(dentry); @@ -15842,10 +15941,9 @@ index 0000000..a76e11d6 + inode = au_new_inode(dentry, /*must_new*/1); + if (!IS_ERR(inode)) { + d_instantiate(dentry, inode); -+ dir = dentry->d_parent->d_inode; /* dir inode is locked */ ++ dir = d_inode(dentry->d_parent); /* dir inode is locked */ + IMustLock(dir); -+ if (au_ibstart(dir) == au_dbstart(dentry)) -+ au_cpup_attr_timesizes(dir); ++ au_dir_ts(dir, bindex); + dir->i_version++; + au_fhsm_wrote(sb, bindex, /*force*/0); + return 0; /* success */ @@ -15877,7 +15975,7 @@ index 0000000..a76e11d6 + err = 0; + if (unlikely(d_unhashed(dentry))) + err = -ENOENT; -+ if (unlikely(dentry->d_inode)) ++ if (unlikely(d_really_is_positive(dentry))) + err = -EEXIST; + return err; +} @@ -15899,15 +15997,17 @@ index 0000000..a76e11d6 + goto out; + + h_dentry = au_h_dptr(dentry, bindex); -+ h_inode = h_dentry->d_inode; -+ if (!dentry->d_inode) { ++ if (d_really_is_negative(dentry)) { + err = -EEXIST; -+ if (unlikely(h_inode)) ++ if (unlikely(d_is_positive(h_dentry))) + goto out; + } else { + /* rename(2) case */ + err = -EIO; -+ if (unlikely(!h_inode || !h_inode->i_nlink)) ++ if (unlikely(d_is_negative(h_dentry))) ++ goto out; ++ h_inode = d_inode(h_dentry); ++ if (unlikely(!h_inode->i_nlink)) + goto out; + + h_mode = h_inode->i_mode; @@ -15988,6 +16088,11 @@ index 0000000..a76e11d6 + if (bcpup != au_dbwh(dentry)) + goto out; /* success */ + ++ /* ++ * ENAMETOOLONG here means that if we allowed create such name, then it ++ * would not be able to removed in the future. So we don't allow such ++ * name here and we don't handle ENAMETOOLONG differently here. ++ */ + wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, br); + +out_unpin: @@ -16004,8 +16109,10 @@ index 0000000..a76e11d6 + int type; + union { + struct { -+ umode_t mode; -+ bool want_excl; ++ umode_t mode; ++ bool want_excl; ++ bool try_aopen; ++ struct vfsub_aopen_args *aopen; + } c; + struct { + const char *symname; @@ -16023,8 +16130,12 @@ index 0000000..a76e11d6 + int err, rerr; + aufs_bindex_t bstart; + unsigned char created; ++ const unsigned char try_aopen ++ = (arg->type == Creat && arg->u.c.try_aopen); + struct dentry *wh_dentry, *parent; + struct inode *h_dir; ++ struct super_block *sb; ++ struct au_branch *br; + /* to reuduce stack size */ + struct { + struct au_dtime dt; @@ -16044,13 +16155,16 @@ index 0000000..a76e11d6 + a->wr_dir_args.flags = AuWrDir_ADD_ENTRY; + + parent = dentry->d_parent; /* dir inode is locked */ -+ err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); -+ if (unlikely(err)) -+ goto out_free; ++ if (!try_aopen) { ++ err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN); ++ if (unlikely(err)) ++ goto out_free; ++ } + err = au_d_may_add(dentry); + if (unlikely(err)) + goto out_unlock; -+ di_write_lock_parent(parent); ++ if (!try_aopen) ++ di_write_lock_parent(parent); + wh_dentry = lock_hdir_lkup_wh(dentry, &a->dt, /*src_dentry*/NULL, + &a->pin, &a->wr_dir_args); + err = PTR_ERR(wh_dentry); @@ -16058,13 +16172,20 @@ index 0000000..a76e11d6 + goto out_parent; + + bstart = au_dbstart(dentry); ++ sb = dentry->d_sb; ++ br = au_sbr(sb, bstart); + a->h_path.dentry = au_h_dptr(dentry, bstart); -+ a->h_path.mnt = au_sbr_mnt(dentry->d_sb, bstart); ++ a->h_path.mnt = au_br_mnt(br); + h_dir = au_pinned_h_dir(&a->pin); + switch (arg->type) { + case Creat: -+ err = vfsub_create(h_dir, &a->h_path, arg->u.c.mode, -+ arg->u.c.want_excl); ++ err = 0; ++ if (!try_aopen || !h_dir->i_op->atomic_open) ++ err = vfsub_create(h_dir, &a->h_path, arg->u.c.mode, ++ arg->u.c.want_excl); ++ else ++ err = vfsub_atomic_open(h_dir, a->h_path.dentry, ++ arg->u.c.aopen, br); + break; + case Symlink: + err = vfsub_symlink(h_dir, &a->h_path, arg->u.s.symname); @@ -16081,7 +16202,7 @@ index 0000000..a76e11d6 + err = epilog(dir, bstart, wh_dentry, dentry); + + /* revert */ -+ if (unlikely(created && err && a->h_path.dentry->d_inode)) { ++ if (unlikely(created && err && d_is_positive(a->h_path.dentry))) { + /* no delegation since it is just created */ + rerr = vfsub_unlink(h_dir, &a->h_path, /*delegated*/NULL, + /*force*/0); @@ -16093,17 +16214,22 @@ index 0000000..a76e11d6 + au_dtime_revert(&a->dt); + } + ++ if (!err && try_aopen && !h_dir->i_op->atomic_open) ++ *arg->u.c.aopen->opened |= FILE_CREATED; ++ + au_unpin(&a->pin); + dput(wh_dentry); + +out_parent: -+ di_write_unlock(parent); ++ if (!try_aopen) ++ di_write_unlock(parent); +out_unlock: + if (unlikely(err)) { + au_update_dbstart(dentry); + d_drop(dentry); + } -+ aufs_read_unlock(dentry, AuLock_DW); ++ if (!try_aopen) ++ aufs_read_unlock(dentry, AuLock_DW); +out_free: + kfree(a); +out: @@ -16145,6 +16271,21 @@ index 0000000..a76e11d6 + return add_simple(dir, dentry, &arg); +} + ++int au_aopen_or_create(struct inode *dir, struct dentry *dentry, ++ struct vfsub_aopen_args *aopen_args) ++{ ++ struct simple_arg arg = { ++ .type = Creat, ++ .u.c = { ++ .mode = aopen_args->create_mode, ++ .want_excl = aopen_args->open_flag & O_EXCL, ++ .try_aopen = true, ++ .aopen = aopen_args ++ } ++ }; ++ return add_simple(dir, dentry, &arg); ++} ++ +int aufs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) +{ + int err; @@ -16174,7 +16315,7 @@ index 0000000..a76e11d6 + parent = d_find_any_alias(dir); + AuDebugOn(!parent); + di_write_lock_parent(parent); -+ if (unlikely(parent->d_inode != dir)) ++ if (unlikely(d_inode(parent) != dir)) + goto out_parent; + + err = au_digen_test(parent, au_sigen(sb)); @@ -16200,7 +16341,7 @@ index 0000000..a76e11d6 + goto out_parent; + + h_parent = au_h_dptr(parent, bindex); -+ err = inode_permission(h_parent->d_inode, MAY_WRITE | MAY_EXEC); ++ err = inode_permission(d_inode(h_parent), MAY_WRITE | MAY_EXEC); + if (unlikely(err)) + goto out_mnt; + @@ -16317,7 +16458,7 @@ index 0000000..a76e11d6 + plink = 0; + h_inode = NULL; + sb = src_dentry->d_sb; -+ inode = src_dentry->d_inode; ++ inode = d_inode(src_dentry); + if (au_ibstart(inode) <= a->bdst) + h_inode = au_h_iptr(inode, a->bdst); + if (!h_inode || !h_inode->i_nlink) { @@ -16331,7 +16472,7 @@ index 0000000..a76e11d6 + au_set_h_dptr(dentry, a->bdst, NULL); + AuDbg("temporary d_inode...\n"); + spin_lock(&dentry->d_lock); -+ dentry->d_inode = src_dentry->d_inode; /* tmp */ ++ dentry->d_inode = d_inode(src_dentry); /* tmp */ + spin_unlock(&dentry->d_lock); + h_file = au_h_open_pre(dentry, a->bsrc, /*force_wr*/0); + if (IS_ERR(h_file)) @@ -16370,7 +16511,7 @@ index 0000000..a76e11d6 + if (IS_ERR(h_src_dentry)) + goto out; + -+ if (unlikely(!h_src_dentry->d_inode)) { ++ if (unlikely(d_is_negative(h_src_dentry))) { + dput(h_src_dentry); + h_src_dentry = NULL; + } @@ -16416,7 +16557,7 @@ index 0000000..a76e11d6 + }; + + IMustLock(dir); -+ inode = src_dentry->d_inode; ++ inode = d_inode(src_dentry); + IMustLock(inode); + + err = -ENOMEM; @@ -16502,7 +16643,7 @@ index 0000000..a76e11d6 + if (!err) { + h_src_dentry = au_h_dptr(src_dentry, a->bdst); + err = -ENOENT; -+ if (h_src_dentry && h_src_dentry->d_inode) { ++ if (h_src_dentry && d_is_positive(h_src_dentry)) { + delegated = NULL; + err = vfsub_link(h_src_dentry, + au_pinned_h_dir(&a->pin), @@ -16527,9 +16668,8 @@ index 0000000..a76e11d6 + goto out_revert; + } + ++ au_dir_ts(dir, a->bdst); + dir->i_version++; -+ if (au_ibstart(dir) == au_dbstart(dentry)) -+ au_cpup_attr_timesizes(dir); + inc_nlink(inode); + inode->i_ctime = dir->i_ctime; + d_instantiate(dentry, au_igrab(inode)); @@ -16619,7 +16759,7 @@ index 0000000..a76e11d6 + + /* make the dir opaque */ + diropq = 0; -+ h_mtx = &h_path.dentry->d_inode->i_mutex; ++ h_mtx = &d_inode(h_path.dentry)->i_mutex; + if (wh_dentry + || au_opt_test(au_mntflags(sb), ALWAYS_DIROPQ)) { + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); @@ -16678,10 +16818,10 @@ index 0000000..a76e11d6 +} diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c new file mode 100644 -index 0000000..fcf377f +index 0000000..3cd4c7b --- /dev/null +++ b/fs/aufs/i_op_del.c -@@ -0,0 +1,494 @@ +@@ -0,0 +1,497 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -16712,7 +16852,7 @@ index 0000000..fcf377f + bstart = au_dbstart(dentry); + if (*bcpup < 0) { + *bcpup = bstart; -+ if (au_test_ro(sb, bstart, dentry->d_inode)) { ++ if (au_test_ro(sb, bstart, d_inode(dentry))) { + err = AuWbrCopyup(au_sbi(sb), dentry); + *bcpup = err; + if (unlikely(err < 0)) @@ -16720,7 +16860,7 @@ index 0000000..fcf377f + } + } else + AuDebugOn(bstart < *bcpup -+ || au_test_ro(sb, *bcpup, dentry->d_inode)); ++ || au_test_ro(sb, *bcpup, d_inode(dentry))); + AuDbg("bcpup %d, bstart %d\n", *bcpup, bstart); + + if (*bcpup != bstart) { @@ -16764,10 +16904,12 @@ index 0000000..fcf377f + struct inode *h_inode; + + h_dentry = au_h_dptr(dentry, bindex); -+ h_inode = h_dentry->d_inode; -+ if (dentry->d_inode) { ++ if (d_really_is_positive(dentry)) { + err = -ENOENT; -+ if (unlikely(!h_inode || !h_inode->i_nlink)) ++ if (unlikely(d_is_negative(h_dentry))) ++ goto out; ++ h_inode = d_inode(h_dentry); ++ if (unlikely(!h_inode->i_nlink)) + goto out; + + h_mode = h_inode->i_mode; @@ -16782,7 +16924,7 @@ index 0000000..fcf377f + } else { + /* rename(2) case */ + err = -EIO; -+ if (unlikely(h_inode)) ++ if (unlikely(d_is_positive(h_dentry))) + goto out; + } + @@ -16798,7 +16940,7 @@ index 0000000..fcf377f + */ + err = -EACCES; + if (unlikely(!au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1) -+ && au_test_h_perm(h_parent->d_inode, ++ && au_test_h_perm(d_inode(h_parent), + MAY_EXEC | MAY_WRITE))) + goto out; + @@ -16888,6 +17030,7 @@ index 0000000..fcf377f + int rmdir_later, err, dirwh; + struct dentry *h_dentry; + struct super_block *sb; ++ struct inode *inode; + + sb = dentry->d_sb; + SiMustAnyLock(sb); @@ -16897,7 +17040,8 @@ index 0000000..fcf377f + goto out; + + /* stop monitoring */ -+ au_hn_free(au_hi(dentry->d_inode, bindex)); ++ inode = d_inode(dentry); ++ au_hn_free(au_hi(inode, bindex)); + + if (!au_test_fs_remote(h_dentry->d_sb)) { + dirwh = au_sbi(sb)->si_dirwh; @@ -16930,12 +17074,11 @@ index 0000000..fcf377f +{ + struct inode *inode; + -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + d_drop(dentry); + inode->i_ctime = dir->i_ctime; + -+ if (au_ibstart(dir) == bindex) -+ au_cpup_attr_timesizes(dir); ++ au_dir_ts(dir, bindex); + dir->i_version++; +} + @@ -16991,10 +17134,10 @@ index 0000000..fcf377f + err = au_d_hashed_positive(dentry); + if (unlikely(err)) + goto out_unlock; -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + IMustLock(inode); + err = -EISDIR; -+ if (unlikely(S_ISDIR(inode->i_mode))) ++ if (unlikely(d_is_dir(dentry))) + goto out_unlock; /* possible? */ + + bstart = au_dbstart(dentry); @@ -17022,7 +17165,7 @@ index 0000000..fcf377f + } + } else { + /* dir inode is locked */ -+ h_dir = wh_dentry->d_parent->d_inode; ++ h_dir = d_inode(wh_dentry->d_parent); + IMustLock(h_dir); + err = 0; + } @@ -17035,7 +17178,7 @@ index 0000000..fcf377f + if (bindex == bstart) { + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); + /*ignore*/ -+ inode->i_ctime = a->h_path.dentry->d_inode->i_ctime; ++ inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; + } else + /* todo: this timestamp may be reverted later */ + inode->i_ctime = h_dir->i_ctime; @@ -17092,10 +17235,10 @@ index 0000000..fcf377f + err = au_alive_dir(dentry); + if (unlikely(err)) + goto out_unlock; -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + IMustLock(inode); + err = -ENOTDIR; -+ if (unlikely(!S_ISDIR(inode->i_mode))) ++ if (unlikely(!d_is_dir(dentry))) + goto out_unlock; /* possible? */ + + err = -ENOMEM; @@ -17132,7 +17275,7 @@ index 0000000..fcf377f + au_hn_free(au_hi(inode, bstart)); + + /* dir inode is locked */ -+ IMustLock(wh_dentry->d_parent->d_inode); ++ IMustLock(d_inode(wh_dentry->d_parent)); + err = 0; + } + @@ -17178,10 +17321,10 @@ index 0000000..fcf377f +} diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c new file mode 100644 -index 0000000..cbe78c8 +index 0000000..1323012 --- /dev/null +++ b/fs/aufs/i_op_ren.c -@@ -0,0 +1,1021 @@ +@@ -0,0 +1,1004 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -17203,7 +17346,6 @@ index 0000000..cbe78c8 +#define AuRen_MNT_WRITE (1 << 4) +#define AuRen_DT_DSTDIR (1 << 5) +#define AuRen_DIROPQ (1 << 6) -+#define AuRen_CPUP (1 << 7) +#define au_ftest_ren(flags, name) ((flags) & AuRen_##name) +#define au_fset_ren(flags, name) \ + do { (flags) |= AuRen_##name; } while (0) @@ -17314,20 +17456,6 @@ index 0000000..cbe78c8 + RevertFailure("rename %pd", a->src_dentry); +} + -+static void au_ren_rev_cpup(int err, struct au_ren_args *a) -+{ -+ int rerr; -+ -+ a->h_path.dentry = a->dst_h_dentry; -+ /* no delegation since it is just created */ -+ rerr = vfsub_unlink(a->dst_h_dir, &a->h_path, /*delegated*/NULL, -+ /*force*/0); -+ au_set_h_dptr(a->src_dentry, a->btgt, NULL); -+ au_set_dbstart(a->src_dentry, a->src_bstart); -+ if (rerr) -+ RevertFailure("unlink %pd", a->dst_h_dentry); -+} -+ +static void au_ren_rev_whtmp(int err, struct au_ren_args *a) +{ + int rerr; @@ -17340,7 +17468,7 @@ index 0000000..cbe78c8 + RevertFailure("lkup one %pd", a->dst_dentry); + return; + } -+ if (a->h_path.dentry->d_inode) { ++ if (d_is_positive(a->h_path.dentry)) { + d_drop(a->h_path.dentry); + dput(a->h_path.dentry); + return; @@ -17466,7 +17594,7 @@ index 0000000..cbe78c8 + + /* prepare workqueue args for asynchronous rmdir */ + h_d = a->dst_h_dentry; -+ if (au_ftest_ren(a->flags, ISDIR) && h_d->d_inode) { ++ if (au_ftest_ren(a->flags, ISDIR) && d_is_positive(h_d)) { + err = -ENOMEM; + a->thargs = au_whtmp_rmdir_alloc(a->src_dentry->d_sb, GFP_NOFS); + if (unlikely(!a->thargs)) @@ -17492,7 +17620,7 @@ index 0000000..cbe78c8 + err = PTR_ERR(h_d); + if (IS_ERR(h_d)) + goto out_whsrc; -+ if (!h_d->d_inode) ++ if (d_is_negative(h_d)) + dput(h_d); + else + a->dst_wh_dentry = h_d; @@ -17512,7 +17640,7 @@ index 0000000..cbe78c8 + a->dst_h_dentry = au_h_dptr(d, a->btgt); + } + -+ BUG_ON(a->dst_h_dentry->d_inode && a->src_bstart != a->btgt); ++ BUG_ON(d_is_positive(a->dst_h_dentry) && a->src_bstart != a->btgt); + + /* rename by vfs_rename or cpup */ + d = a->dst_dentry; @@ -17539,7 +17667,7 @@ index 0000000..cbe78c8 + AuDebugOn(au_dbstart(a->src_dentry) != a->btgt); + a->h_path.dentry = au_h_dptr(a->src_dentry, a->btgt); + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); /*ignore*/ -+ a->src_inode->i_ctime = a->h_path.dentry->d_inode->i_ctime; ++ a->src_inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; + + /* remove whiteout for dentry */ + if (a->dst_wh_dentry) { @@ -17562,10 +17690,7 @@ index 0000000..cbe78c8 + if (au_ftest_ren(a->flags, DIROPQ)) + au_ren_rev_diropq(err, a); +out_rename: -+ if (!au_ftest_ren(a->flags, CPUP)) -+ au_ren_rev_rename(err, a); -+ else -+ au_ren_rev_cpup(err, a); ++ au_ren_rev_rename(err, a); + dput(a->h_dst); +out_whtmp: + if (a->thargs) @@ -17715,20 +17840,18 @@ index 0000000..cbe78c8 + goto out; + + err = -EIO; -+ h_inode = a->dst_h_dentry->d_inode; + isdir = !!au_ftest_ren(a->flags, ISDIR); -+ if (!a->dst_dentry->d_inode) { -+ if (unlikely(h_inode)) -+ goto out; -+ err = au_may_add(a->dst_dentry, a->btgt, a->dst_h_parent, -+ isdir); ++ if (d_really_is_negative(a->dst_dentry)) { ++ if (d_is_negative(a->dst_h_dentry)) ++ err = au_may_add(a->dst_dentry, a->btgt, ++ a->dst_h_parent, isdir); + } else { -+ if (unlikely(!h_inode || !h_inode->i_nlink)) -+ goto out; -+ err = au_may_del(a->dst_dentry, a->btgt, a->dst_h_parent, -+ isdir); -+ if (unlikely(err)) ++ if (unlikely(d_is_negative(a->dst_h_dentry))) + goto out; ++ h_inode = d_inode(a->dst_h_dentry); ++ if (h_inode->i_nlink) ++ err = au_may_del(a->dst_dentry, a->btgt, ++ a->dst_h_parent, isdir); + } + +out: @@ -17789,16 +17912,16 @@ index 0000000..cbe78c8 + a->h_trap = vfsub_lock_rename(a->src_h_parent, a->src_hdir, + a->dst_h_parent, a->dst_hdir); + udba = au_opt_udba(a->src_dentry->d_sb); -+ if (unlikely(a->src_hdir->hi_inode != a->src_h_parent->d_inode -+ || a->dst_hdir->hi_inode != a->dst_h_parent->d_inode)) ++ if (unlikely(a->src_hdir->hi_inode != d_inode(a->src_h_parent) ++ || a->dst_hdir->hi_inode != d_inode(a->dst_h_parent))) + err = au_busy_or_stale(); + if (!err && au_dbstart(a->src_dentry) == a->btgt) + err = au_h_verify(a->src_h_dentry, udba, -+ a->src_h_parent->d_inode, a->src_h_parent, ++ d_inode(a->src_h_parent), a->src_h_parent, + a->br); + if (!err && au_dbstart(a->dst_dentry) == a->btgt) + err = au_h_verify(a->dst_h_dentry, udba, -+ a->dst_h_parent->d_inode, a->dst_h_parent, ++ d_inode(a->dst_h_parent), a->dst_h_parent, + a->br); + if (!err) + goto out; /* success */ @@ -17824,8 +17947,7 @@ index 0000000..cbe78c8 + au_cpup_attr_nlink(dir, /*force*/1); + } + -+ if (au_ibstart(dir) == a->btgt) -+ au_cpup_attr_timesizes(dir); ++ au_dir_ts(dir, a->btgt); + + if (au_ftest_ren(a->flags, ISSAMEDIR)) + return; @@ -17834,8 +17956,7 @@ index 0000000..cbe78c8 + dir->i_version++; + if (au_ftest_ren(a->flags, ISDIR)) + au_cpup_attr_nlink(dir, /*force*/1); -+ if (au_ibstart(dir) == a->btgt) -+ au_cpup_attr_timesizes(dir); ++ au_dir_ts(dir, a->btgt); +} + +static void au_ren_refresh(struct au_ren_args *a) @@ -17907,7 +18028,7 @@ index 0000000..cbe78c8 + struct au_branch *br; + + parent = dentry->d_parent; -+ IMustLock(parent->d_inode); /* dir is locked */ ++ IMustLock(d_inode(parent)); /* dir is locked */ + + bdiropq = au_dbdiropq(parent); + bwh = au_dbwh(dentry); @@ -17959,7 +18080,7 @@ index 0000000..cbe78c8 + + a->h_path.dentry = a->src_h_dentry; + au_dtime_store(a->src_dt + AuCHILD, a->src_dentry, &a->h_path); -+ if (a->dst_h_dentry->d_inode) { ++ if (d_is_positive(a->dst_h_dentry)) { + au_fset_ren(a->flags, DT_DSTDIR); + a->h_path.dentry = a->dst_h_dentry; + au_dtime_store(a->dst_dt + AuCHILD, a->dst_dentry, &a->h_path); @@ -17977,14 +18098,14 @@ index 0000000..cbe78c8 + + if (au_ftest_ren(a->flags, ISDIR) && err != -EIO) { + h_d = a->src_dt[AuCHILD].dt_h_path.dentry; -+ h_mtx = &h_d->d_inode->i_mutex; ++ h_mtx = &d_inode(h_d)->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + au_dtime_revert(a->src_dt + AuCHILD); + mutex_unlock(h_mtx); + + if (au_ftest_ren(a->flags, DT_DSTDIR)) { + h_d = a->dst_dt[AuCHILD].dt_h_path.dentry; -+ h_mtx = &h_d->d_inode->i_mutex; ++ h_mtx = &d_inode(h_d)->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD); + au_dtime_revert(a->dst_dt + AuCHILD); + mutex_unlock(h_mtx); @@ -18013,11 +18134,15 @@ index 0000000..cbe78c8 + + a->src_dir = _src_dir; + a->src_dentry = _src_dentry; -+ a->src_inode = a->src_dentry->d_inode; ++ a->src_inode = NULL; ++ if (d_really_is_positive(a->src_dentry)) ++ a->src_inode = d_inode(a->src_dentry); + a->src_parent = a->src_dentry->d_parent; /* dir inode is locked */ + a->dst_dir = _dst_dir; + a->dst_dentry = _dst_dentry; -+ a->dst_inode = a->dst_dentry->d_inode; ++ a->dst_inode = NULL; ++ if (d_really_is_positive(a->dst_dentry)) ++ a->dst_inode = d_inode(a->dst_dentry); + a->dst_parent = a->dst_dentry->d_parent; /* dir inode is locked */ + if (a->dst_inode) { + IMustLock(a->dst_inode); @@ -18026,9 +18151,10 @@ index 0000000..cbe78c8 + + err = -ENOTDIR; + flags = AuLock_FLUSH | AuLock_NOPLM | AuLock_GEN; -+ if (S_ISDIR(a->src_inode->i_mode)) { ++ if (d_is_dir(a->src_dentry)) { + au_fset_ren(a->flags, ISDIR); -+ if (unlikely(a->dst_inode && !S_ISDIR(a->dst_inode->i_mode))) ++ if (unlikely(d_really_is_positive(a->dst_dentry) ++ && !d_is_dir(a->dst_dentry))) + goto out_free; + err = aufs_read_and_write_lock2(a->dst_dentry, a->src_dentry, + AuLock_DIR | flags); @@ -18064,7 +18190,7 @@ index 0000000..cbe78c8 + * there may exist a problem somewhere else. + */ + err = -EINVAL; -+ if (unlikely(a->dst_parent->d_inode == a->src_dentry->d_inode)) ++ if (unlikely(d_inode(a->dst_parent) == d_inode(a->src_dentry))) + goto out_unlock; + + au_fset_ren(a->flags, ISSAMEDIR); /* temporary */ @@ -18475,10 +18601,10 @@ index 0000000..b8efd45 +} diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c new file mode 100644 -index 0000000..f58367d +index 0000000..559da33 --- /dev/null +++ b/fs/aufs/inode.c -@@ -0,0 +1,483 @@ +@@ -0,0 +1,487 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -18602,18 +18728,19 @@ index 0000000..f58367d + flags = au_hi_flags(inode, isdir); + bend = au_dbend(dentry); + for (bindex = au_dbstart(dentry); bindex <= bend; bindex++) { -+ struct inode *h_i; ++ struct inode *h_i, *h_inode; + struct dentry *h_d; + + h_d = au_h_dptr(dentry, bindex); -+ if (!h_d || !h_d->d_inode) ++ if (!h_d || d_is_negative(h_d)) + continue; + -+ AuDebugOn(mode != (h_d->d_inode->i_mode & S_IFMT)); ++ h_inode = d_inode(h_d); ++ AuDebugOn(mode != (h_inode->i_mode & S_IFMT)); + if (iinfo->ii_bstart <= bindex && bindex <= iinfo->ii_bend) { + h_i = au_h_iptr(inode, bindex); + if (h_i) { -+ if (h_i == h_d->d_inode) ++ if (h_i == h_inode) + continue; + err = -EIO; + break; @@ -18623,7 +18750,7 @@ index 0000000..f58367d + iinfo->ii_bstart = bindex; + if (iinfo->ii_bend < bindex) + iinfo->ii_bend = bindex; -+ au_set_h_iptr(inode, bindex, au_igrab(h_d->d_inode), flags); ++ au_set_h_iptr(inode, bindex, au_igrab(h_inode), flags); + update = 1; + } + au_update_ibrange(inode, /*do_put_zero*/0); @@ -18654,7 +18781,8 @@ index 0000000..f58367d + err = 0; + isdir = 0; + bstart = au_dbstart(dentry); -+ h_inode = au_h_dptr(dentry, bstart)->d_inode; ++ h_dentry = au_h_dptr(dentry, bstart); ++ h_inode = d_inode(h_dentry); + mode = h_inode->i_mode; + switch (mode & S_IFMT) { + case S_IFREG: @@ -18703,7 +18831,7 @@ index 0000000..f58367d + h_dentry = au_h_dptr(dentry, bindex); + if (h_dentry) + au_set_h_iptr(inode, bindex, -+ au_igrab(h_dentry->d_inode), flags); ++ au_igrab(d_inode(h_dentry)), flags); + } + au_cpup_attr_all(inode, /*force*/1); + /* @@ -18728,6 +18856,7 @@ index 0000000..f58367d + struct au_iigen iigen; + aufs_bindex_t bindex, bend; + struct inode *h_inode, *h_dinode; ++ struct dentry *h_dentry; + + /* + * before this function, if aufs got any iinfo lock, it must be only @@ -18740,7 +18869,8 @@ index 0000000..f58367d + + err = 1; + ii_write_lock_new_child(inode); -+ h_dinode = au_h_dptr(dentry, au_dbstart(dentry))->d_inode; ++ h_dentry = au_h_dptr(dentry, au_dbstart(dentry)); ++ h_dinode = d_inode(h_dentry); + bend = au_ibend(inode); + for (bindex = au_ibstart(inode); bindex <= bend; bindex++) { + h_inode = au_h_iptr(inode, bindex); @@ -18813,7 +18943,7 @@ index 0000000..f58367d + sb = dentry->d_sb; + bstart = au_dbstart(dentry); + h_dentry = au_h_dptr(dentry, bstart); -+ h_inode = h_dentry->d_inode; ++ h_inode = d_inode(h_dentry); + h_ino = h_inode->i_ino; + + /* @@ -18821,7 +18951,7 @@ index 0000000..f58367d + * parents. + */ + mtx = NULL; -+ if (!S_ISDIR(h_inode->i_mode)) ++ if (!d_is_dir(h_dentry)) + mtx = &au_sbr(sb, bstart)->br_xino.xi_nondir_mtx; + +new_ino: @@ -18849,10 +18979,10 @@ index 0000000..f58367d + AuDbg("%lx, new %d\n", inode->i_state, !!(inode->i_state & I_NEW)); + if (inode->i_state & I_NEW) { + /* verbose coding for lock class name */ -+ if (unlikely(S_ISLNK(h_inode->i_mode))) ++ if (unlikely(d_is_symlink(h_dentry))) + au_rw_class(&au_ii(inode)->ii_rwsem, + au_lc_key + AuLcSymlink_IIINFO); -+ else if (unlikely(S_ISDIR(h_inode->i_mode))) ++ else if (unlikely(d_is_dir(h_dentry))) + au_rw_class(&au_ii(inode)->ii_rwsem, + au_lc_key + AuLcDir_IIINFO); + else /* likely */ @@ -18897,7 +19027,7 @@ index 0000000..f58367d + mutex_lock(mtx); + } + -+ if (unlikely(au_test_fs_unique_ino(h_dentry->d_inode))) ++ if (unlikely(au_test_fs_unique_ino(h_inode))) + AuWarn1("Warning: Un-notified UDBA or repeatedly renamed dir," + " b%d, %s, %pd, hi%lu, i%lu.\n", + bstart, au_sbtype(h_dentry->d_sb), dentry, @@ -18964,10 +19094,10 @@ index 0000000..f58367d +} diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h new file mode 100644 -index 0000000..7552346 +index 0000000..003534a --- /dev/null +++ b/fs/aufs/inode.h -@@ -0,0 +1,654 @@ +@@ -0,0 +1,660 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -19112,9 +19242,8 @@ index 0000000..7552346 + +/* au_wr_dir flags */ +#define AuWrDir_ADD_ENTRY 1 -+#define AuWrDir_TMP_WHENTRY (1 << 1) -+#define AuWrDir_ISDIR (1 << 2) -+#define AuWrDir_TMPFILE (1 << 3) ++#define AuWrDir_ISDIR (1 << 1) ++#define AuWrDir_TMPFILE (1 << 2) +#define au_ftest_wrdir(flags, name) ((flags) & AuWrDir_##name) +#define au_fset_wrdir(flags, name) \ + do { (flags) |= AuWrDir_##name; } while (0) @@ -19168,6 +19297,9 @@ index 0000000..7552346 +int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname); +int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, + bool want_excl); ++struct vfsub_aopen_args; ++int au_aopen_or_create(struct inode *dir, struct dentry *dentry, ++ struct vfsub_aopen_args *args); +int aufs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode); +int aufs_link(struct dentry *src_dentry, struct inode *dir, + struct dentry *dentry); @@ -19220,6 +19352,7 @@ index 0000000..7552346 +#ifdef CONFIG_PROC_FS +/* plink.c */ +int au_plink_maint(struct super_block *sb, int flags); ++struct au_sbinfo; +void au_plink_maint_leave(struct au_sbinfo *sbinfo); +int au_plink_maint_enter(struct super_block *sb); +#ifdef CONFIG_AUFS_DEBUG @@ -19251,7 +19384,8 @@ index 0000000..7552346 + +#ifdef CONFIG_AUFS_XATTR +/* xattr.c */ -+int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags); ++int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags, ++ unsigned int verbose); +ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size); +ssize_t aufs_getxattr(struct dentry *dentry, const char *name, void *value, + size_t size); @@ -19262,7 +19396,7 @@ index 0000000..7552346 +/* void au_xattr_init(struct super_block *sb); */ +#else +AuStubInt0(au_cpup_xattr, struct dentry *h_dst, struct dentry *h_src, -+ int ignore_flags); ++ int ignore_flags, unsigned int verbose); +/* AuStubVoid(au_xattr_init, struct super_block *sb); */ +#endif + @@ -19512,6 +19646,7 @@ index 0000000..7552346 + } +} + ++#if 0 /* reserved */ +static inline void au_pin_set_parent(struct au_pin *pin, struct dentry *parent) +{ + if (pin) { @@ -19519,6 +19654,7 @@ index 0000000..7552346 + pin->parent = dget(parent); + } +} ++#endif + +/* ---------------------------------------------------------------------- */ + @@ -20019,10 +20155,10 @@ index 0000000..6d9864d +#endif /* __AUFS_LOOP_H__ */ diff --git a/fs/aufs/magic.mk b/fs/aufs/magic.mk new file mode 100644 -index 0000000..3e6387b +index 0000000..4f83bdf --- /dev/null +++ b/fs/aufs/magic.mk -@@ -0,0 +1,54 @@ +@@ -0,0 +1,30 @@ + +# defined in ${srctree}/fs/fuse/inode.c +# tristate @@ -20030,24 +20166,6 @@ index 0000000..3e6387b +ccflags-y += -DFUSE_SUPER_MAGIC=0x65735546 +endif + -+# defined in ${srctree}/fs/ocfs2/ocfs2_fs.h -+# tristate -+ifdef CONFIG_OCFS2_FS -+ccflags-y += -DOCFS2_SUPER_MAGIC=0x7461636f -+endif -+ -+# defined in ${srctree}/fs/ocfs2/dlm/userdlm.h -+# tristate -+ifdef CONFIG_OCFS2_FS_O2CB -+ccflags-y += -DDLMFS_MAGIC=0x76a9f425 -+endif -+ -+# defined in ${srctree}/fs/cifs/cifsfs.c -+# tristate -+ifdef CONFIG_CIFS_FS -+ccflags-y += -DCIFS_MAGIC_NUMBER=0xFF534D42 -+endif -+ +# defined in ${srctree}/fs/xfs/xfs_sb.h +# tristate +ifdef CONFIG_XFS_FS @@ -20060,12 +20178,6 @@ index 0000000..3e6387b +ccflags-y += -DCONFIGFS_MAGIC=0x62656570 +endif + -+# defined in ${srctree}/fs/9p/v9fs.h -+# tristate -+ifdef CONFIG_9P_FS -+ccflags-y += -DV9FS_MAGIC=0x01021997 -+endif -+ +# defined in ${srctree}/fs/ubifs/ubifs.h +# tristate +ifdef CONFIG_UBIFS_FS @@ -20378,7 +20490,7 @@ index 0000000..adee827 +#endif /* __AUFS_MODULE_H__ */ diff --git a/fs/aufs/mvdown.c b/fs/aufs/mvdown.c new file mode 100644 -index 0000000..ca4e078 +index 0000000..bec20d3 --- /dev/null +++ b/fs/aufs/mvdown.c @@ -0,0 +1,681 @@ @@ -20521,7 +20633,7 @@ index 0000000..ca4e078 + AuPin_MNT_WRITE | AuPin_DI_LOCKED); + err = au_do_pin(&a->mvd_pin_src); + AuTraceErr(err); -+ a->mvd_h_src_dir = a->mvd_h_src_parent->d_inode; ++ a->mvd_h_src_dir = d_inode(a->mvd_h_src_parent); + if (unlikely(err)) { + AU_MVD_PR(dmsg, "pin_src failed\n"); + goto out_dst; @@ -20535,7 +20647,7 @@ index 0000000..ca4e078 + au_opt_udba(a->sb), + AuPin_MNT_WRITE | AuPin_DI_LOCKED); + AuTraceErr(err); -+ a->mvd_h_src_dir = a->mvd_h_src_parent->d_inode; ++ a->mvd_h_src_dir = d_inode(a->mvd_h_src_parent); + if (unlikely(err)) { + AU_MVD_PR(dmsg, "pin_src failed\n"); + au_pin_hdir_lock(&a->mvd_pin_dst); @@ -20629,10 +20741,10 @@ index 0000000..ca4e078 + } + + err = 0; -+ if (h_path.dentry->d_inode) { ++ if (d_is_positive(h_path.dentry)) { + h_path.mnt = au_br_mnt(br); + delegated = NULL; -+ err = vfsub_unlink(a->mvd_h_dst_parent->d_inode, &h_path, ++ err = vfsub_unlink(d_inode(a->mvd_h_dst_parent), &h_path, + &delegated, /*force*/0); + if (unlikely(err == -EWOULDBLOCK)) { + pr_warn("cannot retry for NFSv4 delegation" @@ -21014,13 +21126,13 @@ index 0000000..ca4e078 + args->mvdown.flags &= ~(AUFS_MVDOWN_ROLOWER_R | AUFS_MVDOWN_ROUPPER_R); + args->mvdown.au_errno = 0; + args->dentry = dentry; -+ args->inode = dentry->d_inode; ++ args->inode = d_inode(dentry); + args->sb = dentry->d_sb; + + err = -ENOENT; + dmsg = !!(args->mvdown.flags & AUFS_MVDOWN_DMSG); + args->parent = dget_parent(dentry); -+ args->dir = args->parent->d_inode; ++ args->dir = d_inode(args->parent); + mutex_lock_nested(&args->dir->i_mutex, I_MUTEX_PARENT); + dput(args->parent); + if (unlikely(args->parent != dentry->d_parent)) { @@ -21065,10 +21177,10 @@ index 0000000..ca4e078 +} diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c new file mode 100644 -index 0000000..78bb06c +index 0000000..90098fe --- /dev/null +++ b/fs/aufs/opts.c -@@ -0,0 +1,1837 @@ +@@ -0,0 +1,1822 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -21086,11 +21198,11 @@ index 0000000..78bb06c + +enum { + Opt_br, -+ Opt_add, Opt_del, Opt_mod, Opt_reorder, Opt_append, Opt_prepend, -+ Opt_idel, Opt_imod, Opt_ireorder, -+ Opt_dirwh, Opt_rdcache, Opt_rdblk, Opt_rdhash, Opt_rendir, ++ Opt_add, Opt_del, Opt_mod, Opt_append, Opt_prepend, ++ Opt_idel, Opt_imod, ++ Opt_dirwh, Opt_rdcache, Opt_rdblk, Opt_rdhash, + Opt_rdblk_def, Opt_rdhash_def, -+ Opt_xino, Opt_zxino, Opt_noxino, ++ Opt_xino, Opt_noxino, + Opt_trunc_xino, Opt_trunc_xino_v, Opt_notrunc_xino, + Opt_trunc_xino_path, Opt_itrunc_xino, + Opt_trunc_xib, Opt_notrunc_xib, @@ -21098,13 +21210,10 @@ index 0000000..78bb06c + Opt_plink, Opt_noplink, Opt_list_plink, + Opt_udba, + Opt_dio, Opt_nodio, -+ /* Opt_lock, Opt_unlock, */ -+ Opt_cmd, Opt_cmd_args, + Opt_diropq_a, Opt_diropq_w, + Opt_warn_perm, Opt_nowarn_perm, + Opt_wbr_copyup, Opt_wbr_create, + Opt_fhsm_sec, -+ Opt_refrof, Opt_norefrof, + Opt_verbose, Opt_noverbose, + Opt_sum, Opt_nosum, Opt_wsum, + Opt_dirperm1, Opt_nodirperm1, @@ -21188,11 +21297,6 @@ index 0000000..78bb06c + {Opt_dirperm1, "dirperm1"}, + {Opt_nodirperm1, "nodirperm1"}, + -+ {Opt_rendir, "rendir=%d"}, -+ -+ {Opt_refrof, "refrof"}, -+ {Opt_norefrof, "norefrof"}, -+ + {Opt_verbose, "verbose"}, + {Opt_verbose, "v"}, + {Opt_noverbose, "noverbose"}, @@ -21262,14 +21366,19 @@ index 0000000..78bb06c + int v; + + v = *val; ++ if (!v) ++ goto out; + p = tbl; -+ while (p->token) { -+ if ((v & p->token) == p->token) { ++ while (p->pattern) { ++ if (p->token ++ && (v & p->token) == p->token) { + *val &= ~p->token; + return p->pattern; + } + p++; + } ++ ++out: + return NULL; +} + @@ -21288,13 +21397,17 @@ index 0000000..78bb06c + {AuBrAttr_COO_ALL, AUFS_BRATTR_COO_ALL}, + /* 'unpin' attrib is meaningless since linux-3.18-rc1 */ + {AuBrAttr_UNPIN, AUFS_BRATTR_UNPIN}, ++#ifdef CONFIG_AUFS_FHSM + {AuBrAttr_FHSM, AUFS_BRATTR_FHSM}, ++#endif ++#ifdef CONFIG_AUFS_XATTR + {AuBrAttr_ICEX, AUFS_BRATTR_ICEX}, + {AuBrAttr_ICEX_SEC, AUFS_BRATTR_ICEX_SEC}, + {AuBrAttr_ICEX_SYS, AUFS_BRATTR_ICEX_SYS}, + {AuBrAttr_ICEX_TR, AUFS_BRATTR_ICEX_TR}, + {AuBrAttr_ICEX_USR, AUFS_BRATTR_ICEX_USR}, + {AuBrAttr_ICEX_OTH, AUFS_BRATTR_ICEX_OTH}, ++#endif + + /* ro/rr branch */ + {AuBrRAttr_WH, AUFS_BRRATTR_WH}, @@ -21697,7 +21810,6 @@ index 0000000..78bb06c + u.xino_itrunc = &opt->xino_itrunc; + AuDbg("trunc_xino %d\n", u.xino_itrunc->bindex); + break; -+ + case Opt_noxino: + AuLabel(noxino); + break; @@ -21750,12 +21862,6 @@ index 0000000..78bb06c + case Opt_nowarn_perm: + AuLabel(nowarn_perm); + break; -+ case Opt_refrof: -+ AuLabel(refrof); -+ break; -+ case Opt_norefrof: -+ AuLabel(norefrof); -+ break; + case Opt_verbose: + AuLabel(verbose); + break; @@ -22242,8 +22348,6 @@ index 0000000..78bb06c + case Opt_diropq_w: + case Opt_warn_perm: + case Opt_nowarn_perm: -+ case Opt_refrof: -+ case Opt_norefrof: + case Opt_verbose: + case Opt_noverbose: + case Opt_sum: @@ -22433,13 +22537,6 @@ index 0000000..78bb06c + au_opt_clr(sbinfo->si_mntflags, WARN_PERM); + break; + -+ case Opt_refrof: -+ au_opt_set(sbinfo->si_mntflags, REFROF); -+ break; -+ case Opt_norefrof: -+ au_opt_clr(sbinfo->si_mntflags, REFROF); -+ break; -+ + case Opt_verbose: + au_opt_set(sbinfo->si_mntflags, VERBOSE); + break; @@ -22672,7 +22769,7 @@ index 0000000..78bb06c + err = 0; + fhsm = 0; + root = sb->s_root; -+ dir = root->d_inode; ++ dir = d_inode(root); + do_plink = !!au_opt_test(sbinfo->si_mntflags, PLINK); + bend = au_sbend(sb); + for (bindex = 0; !err && bindex <= bend; bindex++) { @@ -22845,7 +22942,7 @@ index 0000000..78bb06c + /* go on even if err */ + } + if (au_opt_test(tmp, UDBA_HNOTIFY)) { -+ dir = sb->s_root->d_inode; ++ dir = d_inode(sb->s_root); + au_hn_reset(dir, au_hi_flags(dir, /*isdir*/1) & ~AuHi_XINO); + } + @@ -22863,7 +22960,7 @@ index 0000000..78bb06c + + SiMustWriteLock(sb); + -+ dir = sb->s_root->d_inode; ++ dir = d_inode(sb->s_root); + sbinfo = au_sbi(sb); + err = 0; + opt_xino = NULL; @@ -22908,10 +23005,10 @@ index 0000000..78bb06c +} diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h new file mode 100644 -index 0000000..929ebc3 +index 0000000..da552ff --- /dev/null +++ b/fs/aufs/opts.h -@@ -0,0 +1,200 @@ +@@ -0,0 +1,197 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -22926,7 +23023,6 @@ index 0000000..929ebc3 +#ifdef __KERNEL__ + +#include -+#include "branch.h" + +struct file; +struct super_block; @@ -22944,7 +23040,6 @@ index 0000000..929ebc3 +#define AuOpt_PLINK (1 << 6) /* pseudo-link */ +#define AuOpt_DIRPERM1 (1 << 7) /* ignore the lower dir's perm + bits */ -+#define AuOpt_REFROF (1 << 8) /* unimplemented */ +#define AuOpt_ALWAYS_DIROPQ (1 << 9) /* policy to creating diropq */ +#define AuOpt_SUM (1 << 10) /* summation for statfs(2) */ +#define AuOpt_SUM_W (1 << 11) /* unimplemented */ @@ -23094,6 +23189,7 @@ index 0000000..929ebc3 + +/* ---------------------------------------------------------------------- */ + ++/* opts.c */ +void au_optstr_br_perm(au_br_perm_str_t *str, int perm); +const char *au_optstr_udba(int udba); +const char *au_optstr_wbr_copyup(int wbr_copyup); @@ -23108,16 +23204,14 @@ index 0000000..929ebc3 + +unsigned int au_opt_udba(struct super_block *sb); + -+/* ---------------------------------------------------------------------- */ -+ +#endif /* __KERNEL__ */ +#endif /* __AUFS_OPTS_H__ */ diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c new file mode 100644 -index 0000000..3e4fe87 +index 0000000..af2246c --- /dev/null +++ b/fs/aufs/plink.c -@@ -0,0 +1,519 @@ +@@ -0,0 +1,515 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -23309,7 +23403,7 @@ index 0000000..3e4fe87 + struct dentry *h_dentry; + struct mutex *h_mtx; + -+ h_mtx = &h_parent->d_inode->i_mutex; ++ h_mtx = &d_inode(h_parent)->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD2); + h_dentry = vfsub_lkup_one(tgtname, h_parent); + mutex_unlock(h_mtx); @@ -23327,7 +23421,6 @@ index 0000000..3e4fe87 +{ + struct dentry *h_dentry, *h_parent; + struct au_branch *br; -+ struct inode *h_dir; + int wkq_err; + char a[PLINK_NAME_LEN]; + struct qstr tgtname = QSTR_INIT(a, 0); @@ -23336,7 +23429,6 @@ index 0000000..3e4fe87 + + br = au_sbr(inode->i_sb, bindex); + h_parent = br->br_wbr->wbr_plink; -+ h_dir = h_parent->d_inode; + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { @@ -23366,7 +23458,7 @@ index 0000000..3e4fe87 + }; + struct inode *h_dir, *delegated; + -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_CHILD2); +again: + h_path.dentry = vfsub_lkup_one(tgt, h_parent); @@ -23377,8 +23469,8 @@ index 0000000..3e4fe87 + err = 0; + /* wh.plink dir is not monitored */ + /* todo: is it really safe? */ -+ if (h_path.dentry->d_inode -+ && h_path.dentry->d_inode != h_dentry->d_inode) { ++ if (d_is_positive(h_path.dentry) ++ && d_inode(h_path.dentry) != d_inode(h_dentry)) { + delegated = NULL; + err = vfsub_unlink(h_dir, &h_path, &delegated, /*force*/0); + if (unlikely(err == -EWOULDBLOCK)) { @@ -23391,7 +23483,7 @@ index 0000000..3e4fe87 + if (!err) + goto again; + } -+ if (!err && !h_path.dentry->d_inode) { ++ if (!err && d_is_negative(h_path.dentry)) { + delegated = NULL; + err = vfsub_link(h_dentry, h_dir, &h_path, &delegated); + if (unlikely(err == -EWOULDBLOCK)) { @@ -23427,13 +23519,11 @@ index 0000000..3e4fe87 + int err, wkq_err; + struct au_wbr *wbr; + struct dentry *h_parent; -+ struct inode *h_dir; + char a[PLINK_NAME_LEN]; + struct qstr tgtname = QSTR_INIT(a, 0); + + wbr = au_sbr(inode->i_sb, bindex)->br_wbr; + h_parent = wbr->wbr_plink; -+ h_dir = h_parent->d_inode; + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + /* always superio. */ @@ -23639,10 +23729,10 @@ index 0000000..3e4fe87 +} diff --git a/fs/aufs/poll.c b/fs/aufs/poll.c new file mode 100644 -index 0000000..9a1fbbd +index 0000000..c324fc7 --- /dev/null +++ b/fs/aufs/poll.c -@@ -0,0 +1,42 @@ +@@ -0,0 +1,39 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -23659,26 +23749,23 @@ index 0000000..9a1fbbd + unsigned int mask; + int err; + struct file *h_file; -+ struct dentry *dentry; + struct super_block *sb; + + /* We should pretend an error happened. */ + mask = POLLERR /* | POLLIN | POLLOUT */; -+ dentry = file->f_path.dentry; -+ sb = dentry->d_sb; ++ sb = file->f_path.dentry->d_sb; + si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); -+ err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); -+ if (unlikely(err)) ++ ++ h_file = au_read_pre(file, /*keep_fi*/0); ++ err = PTR_ERR(h_file); ++ if (IS_ERR(h_file)) + goto out; + + /* it is not an error if h_file has no operation */ + mask = DEFAULT_POLLMASK; -+ h_file = au_hf_top(file); + if (h_file->f_op->poll) + mask = h_file->f_op->poll(h_file, wait); -+ -+ di_read_unlock(dentry, AuLock_IR); -+ fi_read_unlock(file); ++ fput(h_file); /* instead of au_read_post() */ + +out: + si_read_unlock(sb); @@ -23941,7 +24028,7 @@ index 0000000..ead2a00 +} diff --git a/fs/aufs/rdu.c b/fs/aufs/rdu.c new file mode 100644 -index 0000000..6a34e48 +index 0000000..f11d9bb --- /dev/null +++ b/fs/aufs/rdu.c @@ -0,0 +1,375 @@ @@ -24091,7 +24178,7 @@ index 0000000..6a34e48 + goto out; + + dentry = file->f_path.dentry; -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); +#if 1 + mutex_lock(&inode->i_mutex); +#else @@ -24506,10 +24593,10 @@ index 0000000..171ee0c +#endif /* __AUFS_RWSEM_H__ */ diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c new file mode 100644 -index 0000000..34ef9fb +index 0000000..5793673 --- /dev/null +++ b/fs/aufs/sbinfo.c -@@ -0,0 +1,340 @@ +@@ -0,0 +1,343 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -24607,6 +24694,8 @@ index 0000000..34ef9fb + sbinfo->si_xino_brid = -1; + /* leave si_xib_last_pindex and si_xib_next_bit */ + ++ au_sphl_init(&sbinfo->si_aopen); ++ + sbinfo->si_rdcache = msecs_to_jiffies(AUFS_RDCACHE_DEF * MSEC_PER_SEC); + sbinfo->si_rdblk = AUFS_RDBLK_DEF; + sbinfo->si_rdhash = AUFS_RDHASH_DEF; @@ -24623,7 +24712,6 @@ index 0000000..34ef9fb + sbinfo->si_sb = sb; + sb->s_fs_info = sbinfo; + si_pid_set(sb); -+ au_debug_sbinfo_init(sbinfo); + return 0; /* success */ + +out_br: @@ -24661,13 +24749,15 @@ index 0000000..34ef9fb +unsigned int au_sigen_inc(struct super_block *sb) +{ + unsigned int gen; ++ struct inode *inode; + + SiMustWriteLock(sb); + + gen = ++au_sbi(sb)->si_generation; + au_update_digen(sb->s_root); -+ au_update_iigen(sb->s_root->d_inode, /*half*/0); -+ sb->s_root->d_inode->i_version++; ++ inode = d_inode(sb->s_root); ++ au_update_iigen(inode, /*half*/0); ++ inode->i_version++; + return gen; +} + @@ -24956,10 +25046,10 @@ index 0000000..a66d39e +#endif /* __AUFS_SPL_H__ */ diff --git a/fs/aufs/super.c b/fs/aufs/super.c new file mode 100644 -index 0000000..9acda0e +index 0000000..ee5780d --- /dev/null +++ b/fs/aufs/super.c -@@ -0,0 +1,996 @@ +@@ -0,0 +1,991 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -24969,11 +25059,9 @@ index 0000000..9acda0e + */ + +#include -+#include +#include +#include +#include -+#include +#include "aufs.h" + +/* @@ -25209,7 +25297,6 @@ index 0000000..9acda0e + AuBool(PLINK, plink); + AuBool(DIO, dio); + AuBool(DIRPERM1, dirperm1); -+ /* AuBool(REFROF, refrof); */ + + v = sbinfo->si_wbr_create; + if (v != AuWbrCreate_Def) @@ -25524,7 +25611,7 @@ index 0000000..9acda0e + di_read_lock_parent(parent, AuLock_IR); + err = au_refresh_dentry(dentry, parent); + if (!err && dir_flags) -+ au_hn_reset(dentry->d_inode, dir_flags); ++ au_hn_reset(d_inode(dentry), dir_flags); + di_read_unlock(parent, AuLock_IR); + di_write_unlock(dentry); + @@ -25537,14 +25624,12 @@ index 0000000..9acda0e +{ + int err; + struct dentry *parent; -+ struct inode *inode; + + err = 0; + parent = dget_parent(dentry); + if (!au_digen_test(parent, sigen) && au_digen_test(dentry, sigen)) { -+ inode = dentry->d_inode; -+ if (inode) { -+ if (!S_ISDIR(inode->i_mode)) ++ if (d_really_is_positive(dentry)) { ++ if (!d_is_dir(dentry)) + err = au_do_refresh(dentry, /*dir_flags*/0, + parent); + else { @@ -25571,7 +25656,7 @@ index 0000000..9acda0e + struct dentry **dentries, *d; + struct au_sbinfo *sbinfo; + struct dentry *root = sb->s_root; -+ const unsigned int dir_flags = au_hi_flags(root->d_inode, /*isdir*/1); ++ const unsigned int dir_flags = au_hi_flags(d_inode(root), /*isdir*/1); + + err = au_dpages_init(&dpages, GFP_NOFS); + if (unlikely(err)) @@ -25652,7 +25737,7 @@ index 0000000..9acda0e + + root = sb->s_root; + DiMustNoWaiters(root); -+ inode = root->d_inode; ++ inode = d_inode(root); + IiMustNoWaiters(inode); + + udba = au_opt_udba(sb); @@ -25732,7 +25817,7 @@ index 0000000..9acda0e + goto out_opts; + + sbinfo = au_sbi(sb); -+ inode = root->d_inode; ++ inode = d_inode(root); + mutex_lock(&inode->i_mutex); + err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) @@ -25858,7 +25943,7 @@ index 0000000..9acda0e + goto out_info; + } + root = sb->s_root; -+ inode = root->d_inode; ++ inode = d_inode(root); + + /* + * actually we can parse options regardless aufs lock here. @@ -25958,10 +26043,10 @@ index 0000000..9acda0e +}; diff --git a/fs/aufs/super.h b/fs/aufs/super.h new file mode 100644 -index 0000000..0514a13 +index 0000000..f37d89d --- /dev/null +++ b/fs/aufs/super.h -@@ -0,0 +1,628 @@ +@@ -0,0 +1,622 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -25976,14 +26061,11 @@ index 0000000..0514a13 +#ifdef __KERNEL__ + +#include ++#include +#include "rwsem.h" +#include "spl.h" +#include "wkq.h" + -+typedef ssize_t (*au_readf_t)(struct file *, char __user *, size_t, loff_t *); -+typedef ssize_t (*au_writef_t)(struct file *, const char __user *, size_t, -+ loff_t *); -+ +/* policies to select one among multiple writable branches */ +struct au_wbr_copyup_operations { + int (*copyup)(struct dentry *dentry); @@ -26068,7 +26150,7 @@ index 0000000..0514a13 + /* branch management */ + unsigned int si_generation; + -+ /* see above flags */ ++ /* see AuSi_ flags */ + unsigned char au_si_status; + + aufs_bindex_t si_bend; @@ -26098,8 +26180,8 @@ index 0000000..0514a13 + unsigned int si_mntflags; + + /* external inode number (bitmap and translation table) */ -+ au_readf_t si_xread; -+ au_writef_t si_xwrite; ++ vfs_readf_t si_xread; ++ vfs_writef_t si_xwrite; + struct file *si_xib; + struct mutex si_xib_mtx; /* protect xib members */ + unsigned long *si_xib_buf; @@ -26117,6 +26199,9 @@ index 0000000..0514a13 + atomic_t si_xigen_next; +#endif + ++ /* dirty trick to suppoer atomic_open */ ++ struct au_sphlhead si_aopen; ++ + /* vdir parameters */ + unsigned long si_rdcache; /* max cache time in jiffies */ + unsigned int si_rdblk; /* deblk size */ @@ -26130,12 +26215,6 @@ index 0000000..0514a13 + */ + unsigned int si_dirwh; + -+ /* -+ * rename(2) a directory with all children. -+ */ -+ /* reserved for future use */ -+ /* int si_rendir; */ -+ + /* pseudo_link list */ + struct au_sphlhead si_plink[AuPlink_NHASH]; + wait_queue_head_t si_plink_wq; @@ -26490,7 +26569,7 @@ index 0000000..0514a13 + return locked; +} + -+#if 0 /* unused */ ++#if 0 /* reserved */ +static inline int si_read_trylock(struct super_block *sb, int flags) +{ + if (au_ftest_lock(flags, FLUSH)) @@ -26505,7 +26584,7 @@ index 0000000..0514a13 + __si_read_unlock(sb); +} + -+#if 0 /* unused */ ++#if 0 /* reserved */ +static inline int si_write_trylock(struct super_block *sb, int flags) +{ + if (au_ftest_lock(flags, FLUSH)) @@ -26520,7 +26599,7 @@ index 0000000..0514a13 + __si_write_unlock(sb); +} + -+#if 0 /* unused */ ++#if 0 /* reserved */ +static inline void si_downgrade_lock(struct super_block *sb) +{ + __si_downgrade_lock(sb); @@ -27125,7 +27204,7 @@ index 0000000..75cc82a +} diff --git a/fs/aufs/sysrq.c b/fs/aufs/sysrq.c new file mode 100644 -index 0000000..e9fd963 +index 0000000..dcfa824 --- /dev/null +++ b/fs/aufs/sysrq.c @@ -0,0 +1,144 @@ @@ -27166,7 +27245,7 @@ index 0000000..e9fd963 + pr("root dentry\n"); + au_dpri_dentry(sb->s_root); + pr("root inode\n"); -+ au_dpri_inode(sb->s_root->d_inode); ++ au_dpri_inode(d_inode(sb->s_root)); +#endif + +#if 0 @@ -27275,10 +27354,10 @@ index 0000000..e9fd963 +} diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c new file mode 100644 -index 0000000..c61a77f +index 0000000..c3f6a74 --- /dev/null +++ b/fs/aufs/vdir.c -@@ -0,0 +1,876 @@ +@@ -0,0 +1,875 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -27736,7 +27815,6 @@ index 0000000..c61a77f + || au_nhash_test_known_wh(&arg->whlist, name, nlen)) + goto out; /* already exists or whiteouted */ + -+ sb = arg->file->f_path.dentry->d_sb; + arg->err = au_ino(sb, arg->bindex, h_ino, d_type, &ino); + if (!arg->err) { + if (unlikely(nlen > AUFS_MAX_NAMELEN)) @@ -28157,10 +28235,10 @@ index 0000000..c61a77f +} diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c new file mode 100644 -index 0000000..b233552 +index 0000000..da0df5a --- /dev/null +++ b/fs/aufs/vfsub.c -@@ -0,0 +1,783 @@ +@@ -0,0 +1,835 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -28169,7 +28247,6 @@ index 0000000..b233552 + * sub-routines for VFS + */ + -+#include +#include +#include +#include @@ -28205,7 +28282,7 @@ index 0000000..b233552 + current_cred()); + if (!IS_ERR_OR_NULL(file) + && (file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) -+ i_readcount_inc(path->dentry->d_inode); ++ i_readcount_inc(d_inode(path->dentry)); + + return file; +} @@ -28227,12 +28304,63 @@ index 0000000..b233552 + return file; +} + ++/* ++ * Ideally this function should call VFS:do_last() in order to keep all its ++ * checkings. But it is very hard for aufs to regenerate several VFS internal ++ * structure such as nameidata. This is a second (or third) best approach. ++ * cf. linux/fs/namei.c:do_last(), lookup_open() and atomic_open(). ++ */ ++int vfsub_atomic_open(struct inode *dir, struct dentry *dentry, ++ struct vfsub_aopen_args *args, struct au_branch *br) ++{ ++ int err; ++ struct file *file = args->file; ++ /* copied from linux/fs/namei.c:atomic_open() */ ++ struct dentry *const DENTRY_NOT_SET = (void *)-1UL; ++ ++ IMustLock(dir); ++ AuDebugOn(!dir->i_op->atomic_open); ++ ++ err = au_br_test_oflag(args->open_flag, br); ++ if (unlikely(err)) ++ goto out; ++ ++ args->file->f_path.dentry = DENTRY_NOT_SET; ++ args->file->f_path.mnt = au_br_mnt(br); ++ err = dir->i_op->atomic_open(dir, dentry, file, args->open_flag, ++ args->create_mode, args->opened); ++ if (err >= 0) { ++ /* some filesystems don't set FILE_CREATED while succeeded? */ ++ if (*args->opened & FILE_CREATED) ++ fsnotify_create(dir, dentry); ++ } else ++ goto out; ++ ++ ++ if (!err) { ++ /* todo: call VFS:may_open() here */ ++ err = open_check_o_direct(file); ++ /* todo: ima_file_check() too? */ ++ if (!err && (args->open_flag & __FMODE_EXEC)) ++ err = deny_write_access(file); ++ if (unlikely(err)) ++ /* note that the file is created and still opened */ ++ goto out; ++ } ++ ++ atomic_inc(&br->br_count); ++ fsnotify_open(file); ++ ++out: ++ return err; ++} ++ +int vfsub_kern_path(const char *name, unsigned int flags, struct path *path) +{ + int err; + + err = kern_path(name, flags, path); -+ if (!err && path->dentry->d_inode) ++ if (!err && d_is_positive(path->dentry)) + vfsub_update_h_iattr(path, /*did*/NULL); /*ignore*/ + return err; +} @@ -28245,12 +28373,12 @@ index 0000000..b233552 + }; + + /* VFS checks it too, but by WARN_ON_ONCE() */ -+ IMustLock(parent->d_inode); ++ IMustLock(d_inode(parent)); + + path.dentry = lookup_one_len(name, parent, len); + if (IS_ERR(path.dentry)) + goto out; -+ if (path.dentry->d_inode) ++ if (d_is_positive(path.dentry)) + vfsub_update_h_iattr(&path, /*did*/NULL); /*ignore*/ + +out: @@ -28411,7 +28539,7 @@ index 0000000..b233552 + + IMustLock(dir); + -+ err = au_test_nlink(src_dentry->d_inode); ++ err = au_test_nlink(d_inode(src_dentry)); + if (unlikely(err)) + return err; + @@ -28709,7 +28837,7 @@ index 0000000..b233552 + goto out; + } + -+ h_inode = h_path->dentry->d_inode; ++ h_inode = d_inode(h_path->dentry); + h_sb = h_inode->i_sb; + lockdep_off(); + sb_start_write(h_sb); @@ -28818,7 +28946,7 @@ index 0000000..b233552 + struct notify_change_args *a = args; + struct inode *h_inode; + -+ h_inode = a->path->dentry->d_inode; ++ h_inode = d_inode(a->path->dentry); + IMustLock(h_inode); + + *a->errp = -EPERM; @@ -28894,9 +29022,11 @@ index 0000000..b233552 + + if (!stop_sillyrename) + dget(d); -+ h_inode = d->d_inode; -+ if (h_inode) ++ h_inode = NULL; ++ if (d_is_positive(d)) { ++ h_inode = d_inode(d); + ihold(h_inode); ++ } + + lockdep_off(); + *a->errp = vfs_unlink(a->dir, d, a->delegated_inode); @@ -28946,10 +29076,10 @@ index 0000000..b233552 +} diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h new file mode 100644 -index 0000000..6493d90 +index 0000000..778ea20 --- /dev/null +++ b/fs/aufs/vfsub.h -@@ -0,0 +1,288 @@ +@@ -0,0 +1,273 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -28964,7 +29094,6 @@ index 0000000..6493d90 +#ifdef __KERNEL__ + +#include -+#include +#include +#include +#include "debug.h" @@ -28973,6 +29102,7 @@ index 0000000..6493d90 +/* todo: BAD approach!! */ +extern void __mnt_drop_write(struct vfsmount *); +extern spinlock_t inode_sb_list_lock; ++extern int open_check_o_direct(struct file *f); + +/* ---------------------------------------------------------------------- */ + @@ -29021,6 +29151,15 @@ index 0000000..6493d90 +int vfsub_update_h_iattr(struct path *h_path, int *did); +struct file *vfsub_dentry_open(struct path *path, int flags); +struct file *vfsub_filp_open(const char *path, int oflags, int mode); ++struct vfsub_aopen_args { ++ struct file *file; ++ unsigned int open_flag; ++ umode_t create_mode; ++ int *opened; ++}; ++struct au_branch; ++int vfsub_atomic_open(struct inode *dir, struct dentry *dentry, ++ struct vfsub_aopen_args *args, struct au_branch *br); +int vfsub_kern_path(const char *name, unsigned int flags, struct path *path); + +struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, @@ -29059,12 +29198,14 @@ index 0000000..6493d90 + lockdep_on(); +} + ++#if 0 /* reserved */ +static inline void vfsub_mnt_drop_write_file(struct file *file) +{ + lockdep_off(); + mnt_drop_write_file(file); + lockdep_on(); +} ++#endif + +/* ---------------------------------------------------------------------- */ + @@ -29116,11 +29257,13 @@ index 0000000..6493d90 + return flags; +} + ++#if 0 /* reserved */ +static inline void vfsub_file_accessed(struct file *h_file) +{ + file_accessed(h_file); + vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL); /*ignore*/ +} ++#endif + +static inline void vfsub_touch_atime(struct vfsmount *h_mnt, + struct dentry *h_dentry) @@ -29136,7 +29279,7 @@ index 0000000..6493d90 +static inline int vfsub_update_time(struct inode *h_inode, struct timespec *ts, + int flags) +{ -+ return update_time(h_inode, ts, flags); ++ return generic_update_time(h_inode, ts, flags); + /* no vfsub_update_h_iattr() since we don't have struct path */ +} + @@ -29174,34 +29317,6 @@ index 0000000..6493d90 + +/* ---------------------------------------------------------------------- */ + -+/* dirty workaround for strict type of fmode_t */ -+union vfsub_fmu { -+ fmode_t fm; -+ unsigned int ui; -+}; -+ -+static inline unsigned int vfsub_fmode_to_uint(fmode_t fm) -+{ -+ union vfsub_fmu u = { -+ .fm = fm -+ }; -+ -+ BUILD_BUG_ON(sizeof(u.fm) != sizeof(u.ui)); -+ -+ return u.ui; -+} -+ -+static inline fmode_t vfsub_uint_to_fmode(unsigned int ui) -+{ -+ union vfsub_fmu u = { -+ .ui = ui -+ }; -+ -+ return u.fm; -+} -+ -+/* ---------------------------------------------------------------------- */ -+ +int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode); +int vfsub_sio_rmdir(struct inode *dir, struct path *path); +int vfsub_sio_notify_change(struct path *path, struct iattr *ia, @@ -29240,7 +29355,7 @@ index 0000000..6493d90 +#endif /* __AUFS_VFSUB_H__ */ diff --git a/fs/aufs/wbr_policy.c b/fs/aufs/wbr_policy.c new file mode 100644 -index 0000000..7ce1cf1 +index 0000000..53a01fb --- /dev/null +++ b/fs/aufs/wbr_policy.c @@ -0,0 +1,752 @@ @@ -29263,13 +29378,13 @@ index 0000000..7ce1cf1 + struct iattr ia; + struct inode *h_isrc; + -+ h_isrc = h_src->d_inode; ++ h_isrc = d_inode(h_src); + ia.ia_valid = ATTR_FORCE | ATTR_MODE | ATTR_UID | ATTR_GID; + ia.ia_mode = h_isrc->i_mode; + ia.ia_uid = h_isrc->i_uid; + ia.ia_gid = h_isrc->i_gid; + sbits = !!(ia.ia_mode & (S_ISUID | S_ISGID)); -+ au_cpup_attr_flags(h_path->dentry->d_inode, h_isrc->i_flags); ++ au_cpup_attr_flags(d_inode(h_path->dentry), h_isrc->i_flags); + /* no delegation since it is just created */ + err = vfsub_sio_notify_change(h_path, &ia, /*delegated*/NULL); + @@ -29324,7 +29439,7 @@ index 0000000..7ce1cf1 + goto out; + + err = 0; -+ if (h_path.dentry->d_inode) { ++ if (d_is_positive(h_path.dentry)) { + h_path.mnt = au_br_mnt(br); + err = au_wh_unlink_dentry(au_h_iptr(dir, bdst), &h_path, + dentry); @@ -29349,8 +29464,8 @@ index 0000000..7ce1cf1 + bstart = au_dbstart(dentry); + /* dentry is di-locked */ + parent = dget_parent(dentry); -+ dir = parent->d_inode; -+ h_dir = h_parent->d_inode; ++ dir = d_inode(parent); ++ h_dir = d_inode(h_parent); + AuDebugOn(h_dir != au_h_iptr(dir, bdst)); + IMustLock(h_dir); + @@ -29372,7 +29487,7 @@ index 0000000..7ce1cf1 + au_fset_cpdown(*flags, WHED); + if (!au_ftest_cpdown(*flags, PARENT_OPQ) && bopq <= bdst) + au_fset_cpdown(*flags, PARENT_OPQ); -+ h_inode = h_path.dentry->d_inode; ++ h_inode = d_inode(h_path.dentry); + mutex_lock_nested(&h_inode->i_mutex, AuLsc_I_CHILD); + if (au_ftest_cpdown(*flags, WHED)) { + err = au_cpdown_dir_opq(dentry, bdst, flags); @@ -29393,7 +29508,7 @@ index 0000000..7ce1cf1 + goto out_opq; + } + -+ inode = dentry->d_inode; ++ inode = d_inode(dentry); + if (au_ibend(inode) < bdst) + au_set_ibend(inode, bdst); + au_set_h_iptr(inode, bdst, au_igrab(h_inode), @@ -29512,7 +29627,7 @@ index 0000000..7ce1cf1 + parent = dget_parent(dentry); + for (bindex = au_dbstart(parent); bindex < bstart; bindex++) { + h_parent = au_h_dptr(parent, bindex); -+ if (!h_parent || !h_parent->d_inode) ++ if (!h_parent || d_is_negative(h_parent)) + continue; + + if (!au_br_rdonly(au_sbr(sb, bindex))) { @@ -29664,7 +29779,7 @@ index 0000000..7ce1cf1 + for (; bindex <= bend; bindex++) { + if (parent) { + h_parent = au_h_dptr(parent, bindex); -+ if (!h_parent || !h_parent->d_inode) ++ if (!h_parent || d_is_negative(h_parent)) + continue; + } + br = au_sbr(sb, bindex); @@ -29812,7 +29927,7 @@ index 0000000..7ce1cf1 + + for (bindex = bstart; bindex <= bend; bindex++) { + h_parent = au_h_dptr(parent, bindex); -+ if (!h_parent || !h_parent->d_inode) ++ if (!h_parent || d_is_negative(h_parent)) + continue; + + br = au_sbr(sb, bindex); @@ -29891,7 +30006,7 @@ index 0000000..7ce1cf1 + bstart = au_dbstart(parent); + for (bindex = au_dbstart(dentry); bindex >= bstart; bindex--) { + h_parent = au_h_dptr(parent, bindex); -+ if (!h_parent || !h_parent->d_inode) ++ if (!h_parent || d_is_negative(h_parent)) + continue; + + if (!au_br_rdonly(au_sbr(sb, bindex))) { @@ -29998,10 +30113,10 @@ index 0000000..7ce1cf1 +}; diff --git a/fs/aufs/whout.c b/fs/aufs/whout.c new file mode 100644 -index 0000000..21a264f +index 0000000..a7f160e --- /dev/null +++ b/fs/aufs/whout.c -@@ -0,0 +1,1048 @@ +@@ -0,0 +1,1050 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -30064,20 +30179,23 @@ index 0000000..21a264f + else + wh_dentry = au_sio_lkup_one(wh_name, h_parent); + err = PTR_ERR(wh_dentry); -+ if (IS_ERR(wh_dentry)) ++ if (IS_ERR(wh_dentry)) { ++ if (err == -ENAMETOOLONG) ++ err = 0; + goto out; ++ } + + err = 0; -+ if (!wh_dentry->d_inode) ++ if (d_is_negative(wh_dentry)) + goto out_wh; /* success */ + + err = 1; -+ if (S_ISREG(wh_dentry->d_inode->i_mode)) ++ if (d_is_reg(wh_dentry)) + goto out_wh; /* success */ + + err = -EIO; + AuIOErr("%pd Invalid whiteout entry type 0%o.\n", -+ wh_dentry, wh_dentry->d_inode->i_mode); ++ wh_dentry, d_inode(wh_dentry)->i_mode); + +out_wh: + dput(wh_dentry); @@ -30093,7 +30211,7 @@ index 0000000..21a264f + int err; + struct inode *h_dir; + -+ h_dir = h_dentry->d_inode; ++ h_dir = d_inode(h_dentry); + err = au_wh_test(h_dentry, &diropq_name, + au_test_h_perm_sio(h_dir, MAY_EXEC)); + return err; @@ -30139,7 +30257,7 @@ index 0000000..21a264f + for (i = 0; i < 3; i++) { + sprintf(p, "%.*x", AUFS_WH_TMP_LEN, cnt++); + dentry = au_sio_lkup_one(&qs, h_parent); -+ if (IS_ERR(dentry) || !dentry->d_inode) ++ if (IS_ERR(dentry) || d_is_negative(dentry)) + goto out_name; + dput(dentry); + } @@ -30169,7 +30287,7 @@ index 0000000..21a264f + struct dentry *h_parent; + + h_parent = h_dentry->d_parent; /* dir inode is locked */ -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + IMustLock(h_dir); + + h_path.dentry = au_whtmp_lkup(h_parent, br, &h_dentry->d_name); @@ -30208,7 +30326,7 @@ index 0000000..21a264f + * this may be a violation of unix fs semantics. + */ + force = (h_dir->i_mode & S_ISVTX) -+ && !uid_eq(current_fsuid(), h_path->dentry->d_inode->i_uid); ++ && !uid_eq(current_fsuid(), d_inode(h_path->dentry)->i_uid); + delegated = NULL; + err = vfsub_unlink(h_dir, h_path, &delegated, force); + if (unlikely(err == -EWOULDBLOCK)) { @@ -30244,9 +30362,8 @@ index 0000000..21a264f + if (IS_ERR(h_path.dentry)) + err = PTR_ERR(h_path.dentry); + else { -+ if (h_path.dentry->d_inode -+ && S_ISREG(h_path.dentry->d_inode->i_mode)) -+ err = do_unlink_wh(h_parent->d_inode, &h_path); ++ if (d_is_reg(h_path.dentry)) ++ err = do_unlink_wh(d_inode(h_parent), &h_path); + dput(h_path.dentry); + } + @@ -30264,7 +30381,7 @@ index 0000000..21a264f + int err; + struct inode *delegated; + -+ if (!whpath->dentry->d_inode) ++ if (d_is_negative(whpath->dentry)) + return; + + if (isdir) @@ -30285,7 +30402,7 @@ index 0000000..21a264f + +static int test_linkable(struct dentry *h_root) +{ -+ struct inode *h_dir = h_root->d_inode; ++ struct inode *h_dir = d_inode(h_root); + + if (h_dir->i_op->link) + return 0; @@ -30301,13 +30418,13 @@ index 0000000..21a264f + int err; + + err = -EEXIST; -+ if (!path->dentry->d_inode) { ++ if (d_is_negative(path->dentry)) { + int mode = S_IRWXU; + + if (au_test_nfs(path->dentry->d_sb)) + mode |= S_IXUGO; + err = vfsub_mkdir(h_dir, path, mode); -+ } else if (S_ISDIR(path->dentry->d_inode->i_mode)) ++ } else if (d_is_dir(path->dentry)) + err = 0; + else + pr_err("unknown %pd exists\n", path->dentry); @@ -30344,7 +30461,7 @@ index 0000000..21a264f + int err; + struct inode *h_dir; + -+ h_dir = h_root->d_inode; ++ h_dir = d_inode(h_root); + h_path->dentry = base[AuBrWh_BASE].dentry; + au_wh_clean(h_dir, h_path, /*isdir*/0); + h_path->dentry = base[AuBrWh_PLINK].dentry; @@ -30398,11 +30515,11 @@ index 0000000..21a264f + * todo: should this create be done in /sbin/mount.aufs helper? + */ + err = -EEXIST; -+ h_dir = h_root->d_inode; -+ if (!base[AuBrWh_BASE].dentry->d_inode) { ++ h_dir = d_inode(h_root); ++ if (d_is_negative(base[AuBrWh_BASE].dentry)) { + h_path->dentry = base[AuBrWh_BASE].dentry; + err = vfsub_create(h_dir, h_path, WH_MASK, /*want_excl*/true); -+ } else if (S_ISREG(base[AuBrWh_BASE].dentry->d_inode->i_mode)) ++ } else if (d_is_reg(base[AuBrWh_BASE].dentry)) + err = 0; + else + pr_err("unknown %pd2 exists\n", base[AuBrWh_BASE].dentry); @@ -30490,7 +30607,7 @@ index 0000000..21a264f + + err = 0; + if (!au_br_writable(br->br_perm)) { -+ h_dir = h_root->d_inode; ++ h_dir = d_inode(h_root); + au_wh_init_ro(h_dir, base, &path); + } else if (!au_br_wh_linkable(br->br_perm)) { + err = au_wh_init_rw_nolink(h_root, wbr, do_plink, base, &path); @@ -30550,7 +30667,7 @@ index 0000000..21a264f + goto out; + + di_read_lock_parent(a->sb->s_root, AuLock_IR); -+ dir = a->sb->s_root->d_inode; ++ dir = d_inode(a->sb->s_root); + hdir = au_hi(dir, bindex); + h_root = au_h_dptr(a->sb->s_root, bindex); + AuDebugOn(h_root != au_br_dentry(a->br)); @@ -30646,7 +30763,7 @@ index 0000000..21a264f + struct inode *h_dir, *delegated; + + h_parent = wh->d_parent; /* dir inode is locked */ -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + IMustLock(h_dir); + + br = au_sbr(sb, bindex); @@ -30709,7 +30826,7 @@ index 0000000..21a264f + .dentry = opq_dentry, + .mnt = au_br_mnt(br) + }; -+ err = do_unlink_wh(au_h_iptr(dentry->d_inode, bindex), &tmp); ++ err = do_unlink_wh(au_h_iptr(d_inode(dentry), bindex), &tmp); + if (!err) + au_set_dbdiropq(dentry, -1); + } @@ -30739,7 +30856,7 @@ index 0000000..21a264f + struct dentry *diropq, *h_dentry; + + h_dentry = au_h_dptr(dentry, bindex); -+ if (!au_test_h_perm_sio(h_dentry->d_inode, MAY_EXEC | MAY_WRITE)) ++ if (!au_test_h_perm_sio(d_inode(h_dentry), MAY_EXEC | MAY_WRITE)) + diropq = do_diropq(dentry, bindex, flags); + else { + int wkq_err; @@ -30794,7 +30911,7 @@ index 0000000..21a264f + + sb = dentry->d_sb; + wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, au_sbr(sb, bindex)); -+ if (!IS_ERR(wh_dentry) && !wh_dentry->d_inode) { ++ if (!IS_ERR(wh_dentry) && d_is_negative(wh_dentry)) { + err = link_or_create_wh(sb, bindex, wh_dentry); + if (!err) { + au_set_dbwh(dentry, bindex); @@ -30929,11 +31046,11 @@ index 0000000..21a264f + struct inode *wh_inode, *h_dir; + struct au_branch *br; + -+ h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locked */ ++ h_dir = d_inode(wh_dentry->d_parent); /* dir inode is locked */ + IMustLock(h_dir); + + br = au_sbr(dir->i_sb, bindex); -+ wh_inode = wh_dentry->d_inode; ++ wh_inode = d_inode(wh_dentry); + mutex_lock_nested(&wh_inode->i_mutex, AuLsc_I_CHILD); + + /* @@ -31005,7 +31122,7 @@ index 0000000..21a264f + err = -EIO; + ii_write_lock_parent(a->dir); + h_parent = dget_parent(a->wh_dentry); -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + hdir = au_hi(a->dir, bindex); + err = vfsub_mnt_want_write(au_br_mnt(a->br)); + if (unlikely(err)) @@ -31052,7 +31169,7 @@ index 0000000..21a264f +} diff --git a/fs/aufs/whout.h b/fs/aufs/whout.h new file mode 100644 -index 0000000..14155f5 +index 0000000..b39acea --- /dev/null +++ b/fs/aufs/whout.h @@ -0,0 +1,72 @@ @@ -31073,9 +31190,9 @@ index 0000000..14155f5 + +/* whout.c */ +int au_wh_name_alloc(struct qstr *wh, const struct qstr *name); -+struct au_branch; +int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio); +int au_diropq_test(struct dentry *h_dentry); ++struct au_branch; +struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br, + struct qstr *prefix); +int au_whtmp_ren(struct dentry *h_dentry, struct au_branch *br); @@ -31420,10 +31537,10 @@ index 0000000..8f01343 +#endif /* __AUFS_WKQ_H__ */ diff --git a/fs/aufs/xattr.c b/fs/aufs/xattr.c new file mode 100644 -index 0000000..78b34d9 +index 0000000..c1695b3 --- /dev/null +++ b/fs/aufs/xattr.c -@@ -0,0 +1,321 @@ +@@ -0,0 +1,331 @@ +/* + * Copyright (C) 2014-2015 Junjiro R. Okajima + */ @@ -31475,7 +31592,8 @@ index 0000000..78b34d9 +static const int au_xattr_out_of_list = AuBrAttr_ICEX_OTH << 1; + +static int au_do_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, -+ char *name, char **buf, unsigned int ignore_flags) ++ char *name, char **buf, unsigned int ignore_flags, ++ unsigned int verbose) +{ + int err; + ssize_t ssz; @@ -31484,21 +31602,28 @@ index 0000000..78b34d9 + ssz = vfs_getxattr_alloc(h_src, name, buf, 0, GFP_NOFS); + err = ssz; + if (unlikely(err <= 0)) { -+ AuTraceErr(err); + if (err == -ENODATA + || (err == -EOPNOTSUPP -+ && (ignore_flags & au_xattr_out_of_list))) ++ && ((ignore_flags & au_xattr_out_of_list) ++ || (au_test_nfs_noacl(d_inode(h_src)) ++ && (!strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) ++ || !strcmp(name, ++ XATTR_NAME_POSIX_ACL_DEFAULT)))) ++ )) + err = 0; ++ if (err && (verbose || au_debug_test())) ++ pr_err("%s, err %d\n", name, err); + goto out; + } + + /* unlock it temporary */ -+ h_idst = h_dst->d_inode; ++ h_idst = d_inode(h_dst); + mutex_unlock(&h_idst->i_mutex); + err = vfsub_setxattr(h_dst, name, *buf, ssz, /*flags*/0); + mutex_lock_nested(&h_idst->i_mutex, AuLsc_I_CHILD2); + if (unlikely(err)) { -+ AuDbg("%s, err %d\n", name, err); ++ if (verbose || au_debug_test()) ++ pr_err("%s, err %d\n", name, err); + err = au_xattr_ignore(err, name, ignore_flags); + } + @@ -31506,7 +31631,8 @@ index 0000000..78b34d9 + return err; +} + -+int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags) ++int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags, ++ unsigned int verbose) +{ + int err, unlocked, acl_access, acl_default; + ssize_t ssz; @@ -31514,9 +31640,9 @@ index 0000000..78b34d9 + char *value, *p, *o, *e; + + /* try stopping to update the source inode while we are referencing */ -+ /* there should not be the parent-child relation ship between them */ -+ h_isrc = h_src->d_inode; -+ h_idst = h_dst->d_inode; ++ /* there should not be the parent-child relationship between them */ ++ h_isrc = d_inode(h_src); ++ h_idst = d_inode(h_dst); + mutex_unlock(&h_idst->i_mutex); + mutex_lock_nested(&h_isrc->i_mutex, AuLsc_I_CHILD); + mutex_lock_nested(&h_idst->i_mutex, AuLsc_I_CHILD2); @@ -31561,7 +31687,8 @@ index 0000000..78b34d9 + acl_default |= !strncmp(p, XATTR_NAME_POSIX_ACL_DEFAULT, + sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) + - 1); -+ err = au_do_cpup_xattr(h_dst, h_src, p, &value, ignore_flags); ++ err = au_do_cpup_xattr(h_dst, h_src, p, &value, ignore_flags, ++ verbose); + p += strlen(p) + 1; + } + AuTraceErr(err); @@ -31569,13 +31696,13 @@ index 0000000..78b34d9 + if (!err && !acl_access) { + err = au_do_cpup_xattr(h_dst, h_src, + XATTR_NAME_POSIX_ACL_ACCESS, &value, -+ ignore_flags); ++ ignore_flags, verbose); + AuTraceErr(err); + } + if (!err && !acl_default) { + err = au_do_cpup_xattr(h_dst, h_src, + XATTR_NAME_POSIX_ACL_DEFAULT, &value, -+ ignore_flags); ++ ignore_flags, verbose); + AuTraceErr(err); + } + @@ -31747,10 +31874,10 @@ index 0000000..78b34d9 +#endif diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c new file mode 100644 -index 0000000..c053d55 +index 0000000..8a2ddac --- /dev/null +++ b/fs/aufs/xino.c -@@ -0,0 +1,1305 @@ +@@ -0,0 +1,1284 @@ +/* + * Copyright (C) 2005-2015 Junjiro R. Okajima + */ @@ -31764,7 +31891,7 @@ index 0000000..c053d55 +#include "aufs.h" + +/* todo: unnecessary to support mmap_sem since kernel-space? */ -+ssize_t xino_fread(au_readf_t func, struct file *file, void *kbuf, size_t size, ++ssize_t xino_fread(vfs_readf_t func, struct file *file, void *kbuf, size_t size, + loff_t *pos) +{ + ssize_t err; @@ -31793,7 +31920,7 @@ index 0000000..c053d55 + +/* ---------------------------------------------------------------------- */ + -+static ssize_t do_xino_fwrite(au_writef_t func, struct file *file, void *kbuf, ++static ssize_t do_xino_fwrite(vfs_writef_t func, struct file *file, void *kbuf, + size_t size, loff_t *pos) +{ + ssize_t err; @@ -31822,7 +31949,7 @@ index 0000000..c053d55 + +struct do_xino_fwrite_args { + ssize_t *errp; -+ au_writef_t func; ++ vfs_writef_t func; + struct file *file; + void *buf; + size_t size; @@ -31835,8 +31962,8 @@ index 0000000..c053d55 + *a->errp = do_xino_fwrite(a->func, a->file, a->buf, a->size, a->pos); +} + -+ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size, -+ loff_t *pos) ++ssize_t xino_fwrite(vfs_writef_t func, struct file *file, void *buf, ++ size_t size, loff_t *pos) +{ + ssize_t err; + @@ -31884,7 +32011,7 @@ index 0000000..c053d55 + + base = base_file->f_path.dentry; + parent = base->d_parent; /* dir inode is locked */ -+ dir = parent->d_inode; ++ dir = d_inode(parent); + IMustLock(dir); + + file = ERR_PTR(-EINVAL); @@ -31962,11 +32089,11 @@ index 0000000..c053d55 + if (brid >= 0) + bindex = au_br_index(sb, brid); + if (bindex >= 0) { -+ ldir->hdir = au_hi(sb->s_root->d_inode, bindex); ++ ldir->hdir = au_hi(d_inode(sb->s_root), bindex); + au_hn_imtx_lock_nested(ldir->hdir, AuLsc_I_PARENT); + } else { + ldir->parent = dget_parent(xino->f_path.dentry); -+ ldir->mtx = &ldir->parent->d_inode->i_mutex; ++ ldir->mtx = &d_inode(ldir->parent)->i_mutex; + mutex_lock_nested(ldir->mtx, AuLsc_I_PARENT); + } +} @@ -32077,7 +32204,7 @@ index 0000000..c053d55 + + err = 0; + sb = args->sb; -+ dir = sb->s_root->d_inode; ++ dir = d_inode(sb->s_root); + br = args->br; + + si_noflush_write_lock(sb); @@ -32154,7 +32281,7 @@ index 0000000..c053d55 + +/* ---------------------------------------------------------------------- */ + -+static int au_xino_do_write(au_writef_t write, struct file *file, ++static int au_xino_do_write(vfs_writef_t write, struct file *file, + ino_t h_ino, ino_t ino) +{ + loff_t pos; @@ -32314,7 +32441,7 @@ index 0000000..c053d55 + struct au_hinode *hi; + struct inode *h_inode; + struct au_branch *br; -+ au_writef_t xwrite; ++ vfs_writef_t xwrite; + + sb = inode->i_sb; + mnt_flags = au_mntflags(sb); @@ -32469,7 +32596,7 @@ index 0000000..c053d55 +{ + struct file *file; + struct dentry *h_parent, *d; -+ struct inode *h_dir; ++ struct inode *h_dir, *inode; + int err; + + /* @@ -32487,12 +32614,16 @@ index 0000000..c053d55 + } + + /* keep file count */ ++ err = 0; ++ inode = file_inode(file); + h_parent = dget_parent(file->f_path.dentry); -+ h_dir = h_parent->d_inode; ++ h_dir = d_inode(h_parent); + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); + /* mnt_want_write() is unnecessary here */ + /* no delegation since it is just created */ -+ err = vfsub_unlink(h_dir, &file->f_path, /*delegated*/NULL, /*force*/0); ++ if (inode->i_nlink) ++ err = vfsub_unlink(h_dir, &file->f_path, /*delegated*/NULL, ++ /*force*/0); + mutex_unlock(&h_dir->i_mutex); + dput(h_parent); + if (unlikely(err)) { @@ -32612,7 +32743,7 @@ index 0000000..c053d55 + unsigned long pindex; + loff_t pos, pend; + struct au_sbinfo *sbinfo; -+ au_readf_t func; ++ vfs_readf_t func; + ino_t *ino; + unsigned long *p; + @@ -32730,31 +32861,6 @@ index 0000000..c053d55 +/* + * xino mount option handlers + */ -+static au_readf_t find_readf(struct file *h_file) -+{ -+ const struct file_operations *fop = h_file->f_op; -+ -+ if (fop->read) -+ return fop->read; -+ if (fop->aio_read) -+ return do_sync_read; -+ if (fop->read_iter) -+ return new_sync_read; -+ return ERR_PTR(-ENOSYS); -+} -+ -+static au_writef_t find_writef(struct file *h_file) -+{ -+ const struct file_operations *fop = h_file->f_op; -+ -+ if (fop->write) -+ return fop->write; -+ if (fop->aio_write) -+ return do_sync_write; -+ if (fop->write_iter) -+ return new_sync_write; -+ return ERR_PTR(-ENOSYS); -+} + +/* xino bitmap */ +static void xino_clear_xib(struct super_block *sb) @@ -32790,8 +32896,8 @@ index 0000000..c053d55 + if (sbinfo->si_xib) + fput(sbinfo->si_xib); + sbinfo->si_xib = file; -+ sbinfo->si_xread = find_readf(file); -+ sbinfo->si_xwrite = find_writef(file); ++ sbinfo->si_xread = vfs_readf(file); ++ sbinfo->si_xwrite = vfs_writef(file); + + err = -ENOMEM; + if (!sbinfo->si_xib_buf) @@ -32852,7 +32958,7 @@ index 0000000..c053d55 + } *fpair, *p; + struct au_branch *br; + struct inode *inode; -+ au_writef_t writef; ++ vfs_writef_t writef; + + SiMustWriteLock(sb); + @@ -32862,7 +32968,7 @@ index 0000000..c053d55 + if (unlikely(!fpair)) + goto out; + -+ inode = sb->s_root->d_inode; ++ inode = d_inode(sb->s_root); + ino = AUFS_ROOT_INO; + writef = au_sbi(sb)->si_xwrite; + for (bindex = 0, p = fpair; bindex <= bend; bindex++, p++) { @@ -32952,7 +33058,7 @@ index 0000000..c053d55 + } + + au_opt_set(sbinfo->si_mntflags, XINO); -+ dir = parent->d_inode; ++ dir = d_inode(parent); + mutex_lock_nested(&dir->i_mutex, AuLsc_I_PARENT); + /* mnt_want_write() is unnecessary here */ + err = au_xino_set_xib(sb, xino->file); @@ -33057,7 +33163,7 @@ index 0000000..c053d55 + return err; +} diff --git a/fs/buffer.c b/fs/buffer.c -index 20805db..363569f 100644 +index c7a5602..8c50a22 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2450,7 +2450,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, @@ -33070,10 +33176,10 @@ index 20805db..363569f 100644 ret = __block_page_mkwrite(vma, vmf, get_block); sb_end_pagefault(sb); diff --git a/fs/dcache.c b/fs/dcache.c -index e368d4f..eaed72c 100644 +index 37b5afd..bc261e2 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -1019,7 +1019,7 @@ enum d_walk_ret { +@@ -1164,7 +1164,7 @@ enum d_walk_ret { * * The @enter() and @finish() callbacks are called with d_lock held. */ @@ -33082,24 +33188,11 @@ index e368d4f..eaed72c 100644 enum d_walk_ret (*enter)(void *, struct dentry *), void (*finish)(void *)) { -diff --git a/fs/inode.c b/fs/inode.c -index aa149e7..98d87de 100644 ---- a/fs/inode.c -+++ b/fs/inode.c -@@ -1499,7 +1499,7 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, - * This does the actual work of updating an inodes time or version. Must have - * had called mnt_want_write() before calling this. - */ --static int update_time(struct inode *inode, struct timespec *time, int flags) -+int update_time(struct inode *inode, struct timespec *time, int flags) - { - if (inode->i_op->update_time) - return inode->i_op->update_time(inode, time, flags); diff --git a/fs/proc/base.c b/fs/proc/base.c -index 3f3d7ae..426bcc7 100644 +index 093ca14..fc1ac03 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -1735,7 +1735,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path) +@@ -1744,7 +1744,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path) down_read(&mm->mmap_sem); vma = find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { @@ -33125,10 +33218,10 @@ index d4a3574..1397181 100644 ino = inode->i_ino; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index 246eae8..dfd0875 100644 +index 6dee68d..9afa35d 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c -@@ -276,7 +276,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) +@@ -279,7 +279,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) const char *name = NULL; if (file) { @@ -33140,17 +33233,17 @@ index 246eae8..dfd0875 100644 dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; -@@ -1475,7 +1478,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) +@@ -1479,7 +1482,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; - struct file *file = vma->vm_file; + struct file *file = vma_pr_or_file(vma); struct mm_struct *mm = vma->vm_mm; - struct mm_walk walk = {}; - struct mempolicy *pol; + struct mm_walk walk = { + .hugetlb_entry = gather_hugetlb_stats, diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c -index 599ec2e..de6cd6e 100644 +index 599ec2e..1740207 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -160,7 +160,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, @@ -33160,16 +33253,49 @@ index 599ec2e..de6cd6e 100644 - struct inode *inode = file_inode(vma->vm_file); + struct inode *inode; + -+ file = vma_pr_or_file(file); ++ file = vma_pr_or_file(vma); + inode = file_inode(file); dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; +diff --git a/fs/read_write.c b/fs/read_write.c +index 819ef3f..fd0414e 100644 +--- a/fs/read_write.c ++++ b/fs/read_write.c +@@ -494,6 +494,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count, + } + EXPORT_SYMBOL(__vfs_write); + ++vfs_readf_t vfs_readf(struct file *file) ++{ ++ const struct file_operations *fop = file->f_op; ++ ++ if (fop->read) ++ return fop->read; ++ if (fop->read_iter) ++ return new_sync_read; ++ return ERR_PTR(-ENOSYS); ++} ++ ++vfs_writef_t vfs_writef(struct file *file) ++{ ++ const struct file_operations *fop = file->f_op; ++ ++ if (fop->write) ++ return fop->write; ++ if (fop->write_iter) ++ return new_sync_write; ++ return ERR_PTR(-ENOSYS); ++} ++ + ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) + { + mm_segment_t old_fs; diff --git a/fs/splice.c b/fs/splice.c -index 75c6058..619359a 100644 +index bfe62ae..fa5eee5 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -1114,8 +1114,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); +@@ -1101,8 +1101,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); /* * Attempt to initiate a splice from pipe to file. */ @@ -33180,7 +33306,7 @@ index 75c6058..619359a 100644 { ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); -@@ -1131,9 +1131,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, +@@ -1118,9 +1118,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, /* * Attempt to initiate a splice from a file to a pipe. */ @@ -33193,27 +33319,43 @@ index 75c6058..619359a 100644 { ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); +diff --git a/include/linux/file.h b/include/linux/file.h +index f87d308..9a290b3 100644 +--- a/include/linux/file.h ++++ b/include/linux/file.h +@@ -19,6 +19,7 @@ struct dentry; + struct path; + extern struct file *alloc_file(struct path *, fmode_t mode, + const struct file_operations *fop); ++extern struct file *get_empty_filp(void); + + static inline void fput_light(struct file *file, int fput_needed) + { diff --git a/include/linux/fs.h b/include/linux/fs.h -index 42efe13..f634198 100644 +index 35ec87e..3229f97 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -2690,6 +2690,7 @@ extern int inode_change_ok(const struct inode *, struct iattr *); - extern int inode_newsize_ok(const struct inode *, loff_t offset); - extern void setattr_copy(struct inode *inode, const struct iattr *attr); +@@ -1649,6 +1649,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, + struct iovec *fast_pointer, + struct iovec **ret_pointer); -+extern int update_time(struct inode *, struct timespec *, int); - extern int file_update_time(struct file *file); - - extern int generic_show_options(struct seq_file *m, struct dentry *root); ++typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *); ++typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t, ++ loff_t *); ++vfs_readf_t vfs_readf(struct file *file); ++vfs_writef_t vfs_writef(struct file *file); ++ + extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *); + extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *); + extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); diff --git a/include/linux/mm.h b/include/linux/mm.h -index dd5ea30..445d798 100644 +index 0755b9f..2ee5500 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -1224,6 +1224,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, +@@ -1172,6 +1172,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, } #endif -+#ifdef CONFIG_MMU +extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); +extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], + int); @@ -33226,23 +33368,24 @@ index dd5ea30..445d798 100644 + __LINE__) +#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__) +#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__) -+#else ++ ++#ifndef CONFIG_MMU +extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int); +extern void vmr_do_fput(struct vm_region *, const char[], int); + +#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \ + __LINE__) +#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) -+#endif /* CONFIG_MMU */ ++#endif /* !CONFIG_MMU */ + extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, int write); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index 6d34aa2..f13dd51 100644 +index 8d37e26..ce89d4c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h -@@ -233,6 +233,7 @@ struct vm_region { +@@ -241,6 +241,7 @@ struct vm_region { unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ struct file *vm_file; /* the backing file or NULL */ @@ -33250,7 +33393,7 @@ index 6d34aa2..f13dd51 100644 int vm_usage; /* region usage count (access under nommu_region_sem) */ bool vm_icache_flushed : 1; /* true if the icache has been flushed for -@@ -301,6 +302,7 @@ struct vm_area_struct { +@@ -305,6 +306,7 @@ struct vm_area_struct { unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */ struct file * vm_file; /* File we map to (can be NULL). */ @@ -33274,10 +33417,10 @@ index da2751d..2e0fca6 100644 + unsigned int flags); #endif diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild -index 00b10002..f4a389c 100644 +index 1a0006a..ddad01a 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild -@@ -57,6 +57,7 @@ header-y += atmsvc.h +@@ -59,6 +59,7 @@ header-y += atmsvc.h header-y += atm_tcp.h header-y += atm_zatm.h header-y += audit.h @@ -33287,7 +33430,7 @@ index 00b10002..f4a389c 100644 header-y += auxvec.h diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h new file mode 100644 -index 0000000..d6abed8 +index 0000000..a06c985 --- /dev/null +++ b/include/uapi/linux/aufs_type.h @@ -0,0 +1,406 @@ @@ -33319,7 +33462,7 @@ index 0000000..d6abed8 + +#include + -+#define AUFS_VERSION "3.19" ++#define AUFS_VERSION "4.x-rcN" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') @@ -33474,10 +33617,10 @@ index 0000000..d6abed8 + "+" AUFS_BRATTR_COO_REG \ + "+" AUFS_BRATTR_FHSM \ + "+" AUFS_BRATTR_UNPIN \ -+ "+" AUFS_BRATTR_ICEX_SEC \ -+ "+" AUFS_BRATTR_ICEX_SYS \ -+ "+" AUFS_BRATTR_ICEX_USR \ -+ "+" AUFS_BRATTR_ICEX_OTH \ ++ "+" AUFS_BRATTR_ICEX_SEC \ ++ "+" AUFS_BRATTR_ICEX_SYS \ ++ "+" AUFS_BRATTR_ICEX_USR \ ++ "+" AUFS_BRATTR_ICEX_OTH \ + "+" AUFS_BRWATTR_NLWH) + +typedef struct { @@ -33698,10 +33841,10 @@ index 0000000..d6abed8 + +#endif /* __AUFS_TYPE_H__ */ diff --git a/kernel/fork.c b/kernel/fork.c -index 4dc2dda..5984c61 100644 +index 03c1eaa..7e215ba 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -430,7 +430,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) +@@ -456,7 +456,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; @@ -33711,23 +33854,23 @@ index 4dc2dda..5984c61 100644 atomic_dec(&inode->i_writecount); i_mmap_lock_write(mapping); diff --git a/mm/Makefile b/mm/Makefile -index 4bf586e..59bd276 100644 +index 98c4eae..3f0c9b9 100644 --- a/mm/Makefile +++ b/mm/Makefile -@@ -18,7 +18,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ +@@ -21,7 +21,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ mm_init.o mmu_context.o percpu.o slab_common.o \ compaction.o vmacache.o \ interval_tree.o list_lru.o workingset.o \ -- iov_iter.o debug.o $(mmu-y) -+ iov_iter.o prfile.o debug.o $(mmu-y) +- debug.o $(mmu-y) ++ prfile.o debug.o $(mmu-y) obj-y += init-mm.o diff --git a/mm/filemap.c b/mm/filemap.c -index 673e458..a623932 100644 +index 6bf5e42..a863d0f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -2063,7 +2063,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) +@@ -2062,7 +2062,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) int ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); @@ -33736,46 +33879,11 @@ index 673e458..a623932 100644 lock_page(page); if (page->mapping != inode->i_mapping) { unlock_page(page); -diff --git a/mm/fremap.c b/mm/fremap.c -index 2805d71..1b011b0 100644 ---- a/mm/fremap.c -+++ b/mm/fremap.c -@@ -224,16 +224,28 @@ get_write_lock: - */ - if (mapping_cap_account_dirty(mapping)) { - unsigned long addr; -- struct file *file = get_file(vma->vm_file); -+ struct file *file = vma->vm_file, -+ *prfile = vma->vm_prfile; -+ - /* mmap_region may free vma; grab the info now */ - vm_flags = vma->vm_flags; - -+ vma_get_file(vma); - addr = mmap_region(file, start, size, vm_flags, pgoff); -- fput(file); -+ vma_fput(vma); - if (IS_ERR_VALUE(addr)) { - err = addr; - } else { - BUG_ON(addr != start); -+ if (prfile) { -+ struct vm_area_struct *new_vma; -+ -+ new_vma = find_vma(mm, addr); -+ if (!new_vma->vm_prfile) -+ new_vma->vm_prfile = prfile; -+ if (new_vma != vma) -+ get_file(prfile); -+ } - err = 0; - } - goto out_freed; diff --git a/mm/madvise.c b/mm/madvise.c -index a271adc..29a932f 100644 +index d551475..1ebf71b 100644 --- a/mm/madvise.c +++ b/mm/madvise.c -@@ -324,12 +324,12 @@ static long madvise_remove(struct vm_area_struct *vma, +@@ -320,12 +320,12 @@ static long madvise_remove(struct vm_area_struct *vma, * vma's reference to the file) can go away as soon as we drop * mmap_sem. */ @@ -33791,23 +33899,23 @@ index a271adc..29a932f 100644 return error; } diff --git a/mm/memory.c b/mm/memory.c -index 2c3536c..444bb1d 100644 +index 22e037e..62096a2 100644 --- a/mm/memory.c +++ b/mm/memory.c -@@ -2157,7 +2157,7 @@ reuse: - - /* file_update_time outside page_lock */ - if (vma->vm_file) -- file_update_time(vma->vm_file); -+ vma_file_update_time(vma); +@@ -2034,7 +2034,7 @@ static inline int wp_page_reuse(struct mm_struct *mm, } - put_page(dirty_page); - if (page_mkwrite) { + + if (!page_mkwrite) +- file_update_time(vma->vm_file); ++ vma_file_update_time(vma); + } + + return VM_FAULT_WRITE; diff --git a/mm/mmap.c b/mm/mmap.c -index 7f684d5..ffa1b91 100644 +index bb50cac..1ab5e596 100644 --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -277,7 +277,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) +@@ -274,7 +274,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -33816,7 +33924,7 @@ index 7f684d5..ffa1b91 100644 mpol_put(vma_policy(vma)); kmem_cache_free(vm_area_cachep, vma); return next; -@@ -897,7 +897,7 @@ again: remove_next = 1 + (end > next->vm_end); +@@ -886,7 +886,7 @@ again: remove_next = 1 + (end > next->vm_end); if (remove_next) { if (file) { uprobe_munmap(next, next->vm_start, next->vm_end); @@ -33825,7 +33933,7 @@ index 7f684d5..ffa1b91 100644 } if (next->anon_vma) anon_vma_merge(vma, next); -@@ -1682,8 +1682,8 @@ out: +@@ -1671,8 +1671,8 @@ out: return addr; unmap_and_free_vma: @@ -33835,7 +33943,7 @@ index 7f684d5..ffa1b91 100644 /* Undo any partial mapping done by a device driver. */ unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); -@@ -2484,7 +2484,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2473,7 +2473,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, goto out_free_mpol; if (new->vm_file) @@ -33844,7 +33952,7 @@ index 7f684d5..ffa1b91 100644 if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); -@@ -2503,7 +2503,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, +@@ -2492,7 +2492,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, if (new->vm_ops && new->vm_ops->close) new->vm_ops->close(new); if (new->vm_file) @@ -33853,7 +33961,28 @@ index 7f684d5..ffa1b91 100644 unlink_anon_vmas(new); out_free_mpol: mpol_put(vma_policy(new)); -@@ -2895,7 +2895,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -2635,7 +2635,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, + struct vm_area_struct *vma; + unsigned long populate = 0; + unsigned long ret = -EINVAL; +- struct file *file; + + pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. " + "See Documentation/vm/remap_file_pages.txt.\n", +@@ -2679,10 +2678,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, + munlock_vma_pages_range(vma, start, start + size); + } + +- file = get_file(vma->vm_file); ++ vma_get_file(vma); + ret = do_mmap_pgoff(vma->vm_file, start, size, + prot, flags, pgoff, &populate); +- fput(file); ++ vma_fput(vma); + out: + up_write(&mm->mmap_sem); + if (populate) +@@ -2949,7 +2948,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) @@ -33863,30 +33992,27 @@ index 7f684d5..ffa1b91 100644 new_vma->vm_ops->open(new_vma); vma_link(mm, new_vma, prev, rb_link, rb_parent); diff --git a/mm/msync.c b/mm/msync.c -index 992a167..ce1915b 100644 +index bb04d53..5c24c54 100644 --- a/mm/msync.c +++ b/mm/msync.c -@@ -84,13 +84,13 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) +@@ -84,10 +84,10 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) start = vma->vm_end; if ((flags & MS_SYNC) && file && (vma->vm_flags & VM_SHARED)) { - get_file(file); + vma_get_file(vma); up_read(&mm->mmap_sem); - if (vma->vm_flags & VM_NONLINEAR) - error = vfs_fsync(file, 1); - else - error = vfs_fsync_range(file, fstart, fend, 1); + error = vfs_fsync_range(file, fstart, fend, 1); - fput(file); + vma_fput(vma); if (error || start >= end) goto out; down_read(&mm->mmap_sem); diff --git a/mm/nommu.c b/mm/nommu.c -index 28bd8c4..3c0ace2 100644 +index e544508..dd6f74a 100644 --- a/mm/nommu.c +++ b/mm/nommu.c -@@ -659,7 +659,7 @@ static void __put_nommu_region(struct vm_region *region) +@@ -693,7 +693,7 @@ static void __put_nommu_region(struct vm_region *region) up_write(&nommu_region_sem); if (region->vm_file) @@ -33895,7 +34021,7 @@ index 28bd8c4..3c0ace2 100644 /* IO memory and memory shared directly out of the pagecache * from ramfs/tmpfs mustn't be released here */ -@@ -824,7 +824,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) +@@ -858,7 +858,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -33904,7 +34030,7 @@ index 28bd8c4..3c0ace2 100644 put_nommu_region(vma->vm_region); kmem_cache_free(vm_area_cachep, vma); } -@@ -1375,7 +1375,7 @@ unsigned long do_mmap_pgoff(struct file *file, +@@ -1398,7 +1398,7 @@ unsigned long do_mmap_pgoff(struct file *file, goto error_just_free; } } @@ -33913,7 +34039,7 @@ index 28bd8c4..3c0ace2 100644 kmem_cache_free(vm_region_jar, region); region = pregion; result = start; -@@ -1451,10 +1451,10 @@ error_just_free: +@@ -1474,10 +1474,10 @@ error_just_free: up_write(&nommu_region_sem); error: if (region->vm_file) @@ -33928,7 +34054,7 @@ index 28bd8c4..3c0ace2 100644 return ret; diff --git a/mm/prfile.c b/mm/prfile.c new file mode 100644 -index 0000000..fc708d2 +index 0000000..6aa5ab5 --- /dev/null +++ b/mm/prfile.c @@ -0,0 +1,86 @@ @@ -33954,11 +34080,10 @@ index 0000000..fc708d2 +#ifdef PRFILE_TRACE + if (pr) + pr_info("%s:%d: %s, %p\n", func, line, func2, -+ f ? (char *)f->f_dentry->d_name.name : "(null)"); ++ f ? (char *)f->f_path.dentry->d_name.name : "(null)"); +#endif +} + -+#ifdef CONFIG_MMU +void vma_do_file_update_time(struct vm_area_struct *vma, const char func[], + int line) +{ @@ -33998,7 +34123,8 @@ index 0000000..fc708d2 + if (f && pr) + fput(pr); +} -+#else ++ ++#ifndef CONFIG_MMU +struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[], + int line) +{ @@ -34017,4 +34143,4 @@ index 0000000..fc708d2 + if (f && pr) + fput(pr); +} -+#endif /* CONFIG_MMU */ ++#endif /* !CONFIG_MMU */ diff --git a/kernel/kernel/files/patches/mageia/fs-btrfs-fix-BUG_ON-in-btrfs_orphan_add-when-delete-unu.patch b/kernel/kernel/files/patches/mageia/fs-btrfs-fix-BUG_ON-in-btrfs_orphan_add-when-delete-unu.patch deleted file mode 100644 index 31d25c9c..00000000 --- a/kernel/kernel/files/patches/mageia/fs-btrfs-fix-BUG_ON-in-btrfs_orphan_add-when-delete-unu.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 3d84be799194147e04c0e3129ed44a948773b80a Mon Sep 17 00:00:00 2001 -From: Forrest Liu -Date: Wed, 11 Feb 2015 14:23:47 +0800 -Subject: [PATCH] Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused - block group - -Removing large amount of block group in a transaction may encounters -BUG_ON() in btrfs_orphan_add(). That is because btrfs_orphan_reserve_metadata() -will grab metadata reservation from transaction handle, and -btrfs_delete_unused_bgs() didn't reserve metadata for trnasaction handle when -delete unused block group. - -The problem can be reproduce by following script - - mntpath=/btrfs - loopdev=/dev/loop0 - filepath=/home/forrest/image - - umount $mntpath - losetup -d $loopdev - truncate --size 1000g $filepath - losetup $loopdev $filepath - mkfs.btrfs -f $loopdev - mount $loopdev $mntpath - - for j in `seq 1 1 1000`; do - fallocate -l 1g $mntpath/$j - done - # wait cleaner thread remove unused block group - sleep 300 - -The call trace that results from the BUG_ON() is: - -[ 613.093084] ------------[ cut here ]------------ -[ 613.097928] kernel BUG at fs/btrfs/inode.c:3142! -[ 613.105855] invalid opcode: 0000 [#1] SMP -[ 613.112702] Modules linked in: coretemp(E) crc32_pclmul(E) ghash_clmulni_intel(E) aesni_intel(E) snd_ens1371(E) snd_ac97_codec(E) aes_x86_64(E) lrw(E) gf128mul(E) glue_helper(E) ppdev(E) ac97_bus(E) ablk_helper(E) gameport(E) cryptd(E) snd_rawmidi(E) snd_seq_device(E) snd_pcm(E) vmw_balloon(E) snd_timer(E) snd(E) soundcore(E) serio_raw(E) vmwgfx(E) ttm(E) drm_kms_helper(E) drm(E) vmw_vmci(E) parport_pc(E) shpchp(E) i2c_piix4(E) mac_hid(E) lp(E) parport(E) btrfs(E) xor(E) raid6_pq(E) hid_generic(E) usbhid(E) hid(E) psmouse(E) ahci(E) libahci(E) e1000(E) mptspi(E) mptscsih(E) mptbase(E) floppy(E) vmw_pvscsi(E) vmxnet3(E) -[ 613.144196] CPU: 0 PID: 1480 Comm: btrfs-cleaner Tainted: G E 3.19.0-rc7-custom #2 -[ 613.148501] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 -[ 613.152694] task: ffff880035cdb1a0 ti: ffff880039cf4000 task.ti: ffff880039cf4000 -[ 613.154969] RIP: 0010:[] [] btrfs_orphan_add+0x1d2/0x1e0 [btrfs] -[ 613.157780] RSP: 0018:ffff880039cf7c48 EFLAGS: 00010286 -[ 613.159560] RAX: 00000000ffffffe4 RBX: ffff88003bd981a0 RCX: ffff88003c9e4000 -[ 613.161904] RDX: 0000000000002244 RSI: 0000000000040000 RDI: ffff88003c9e4138 -[ 613.164264] RBP: ffff880039cf7c88 R08: 000060ffc0000850 R09: 0000000000000000 -[ 613.166507] R10: ffff88003bc4b7a0 R11: ffffea0000eb6740 R12: ffff88003c9c0000 -[ 613.168681] R13: ffff88003c102160 R14: ffff88003c9c0458 R15: 0000000000000001 -[ 613.170932] FS: 0000000000000000(0000) GS:ffff88003f600000(0000) knlGS:0000000000000000 -[ 613.173316] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 -[ 613.175227] CR2: 00007f6343537000 CR3: 0000000036329000 CR4: 00000000000407f0 -[ 613.177554] Stack: -[ 613.178712] ffff880039cf7c88 ffffffffa0182a54 ffff88003c9e4b04 ffff88003c9c7800 -[ 613.181297] ffff88003bc4b7a0 ffff88003bd981a0 ffff88003c8db200 ffff88003c2fcc60 -[ 613.183782] ffff880039cf7d18 ffffffffa012da97 ffff88003bc4b7a4 ffff88003bc4b7a0 -[ 613.186171] Call Trace: -[ 613.187493] [] ? lookup_free_space_inode+0x44/0x100 [btrfs] -[ 613.189801] [] btrfs_remove_block_group+0x137/0x740 [btrfs] -[ 613.192126] [] btrfs_remove_chunk+0x672/0x780 [btrfs] -[ 613.194267] [] btrfs_delete_unused_bgs+0x25f/0x280 [btrfs] -[ 613.196567] [] cleaner_kthread+0x12c/0x190 [btrfs] -[ 613.198687] [] ? check_leaf+0x350/0x350 [btrfs] -[ 613.200758] [] kthread+0xd2/0xf0 -[ 613.202616] [] ? kthread_create_on_node+0x180/0x180 -[ 613.204738] [] ret_from_fork+0x7c/0xb0 -[ 613.206652] [] ? kthread_create_on_node+0x180/0x180 -[ 613.208741] Code: ff ff 0f 1f 80 00 00 00 00 89 45 c8 3e 80 63 80 fd 48 89 df e8 d0 23 fe ff 8b 45 c8 e9 14 ff ff ff b8 f4 ff ff ff e9 12 ff ff ff <0f> 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48 -[ 613.216562] RIP [] btrfs_orphan_add+0x1d2/0x1e0 [btrfs] -[ 613.218828] RSP -[ 613.220382] ---[ end trace 71073106deb8a457 ]--- - -This patch replace btrfs_join_transaction() with btrfs_start_transaction() in -btrfs_delete_unused_bgs() to revent BUG_ON() in btrfs_orphan_add() - -Signed-off-by: Forrest Liu -Signed-off-by: Chris Mason ---- - fs/btrfs/extent-tree.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c -index 0f67370..28ce5c8 100644 ---- a/fs/btrfs/extent-tree.c -+++ b/fs/btrfs/extent-tree.c -@@ -9555,7 +9555,8 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) - * Want to do this before we do anything else so we can recover - * properly if we fail to join the transaction. - */ -- trans = btrfs_join_transaction(root); -+ /* 1 for btrfs_orphan_reserve_metadata() */ -+ trans = btrfs_start_transaction(root, 1); - if (IS_ERR(trans)) { - btrfs_set_block_group_rw(root, block_group); - ret = PTR_ERR(trans); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/fs-btrfs-unlock-i_mutex-after-attempting-to-delete-subvolume-during-send.patch b/kernel/kernel/files/patches/mageia/fs-btrfs-unlock-i_mutex-after-attempting-to-delete-subvolume-during-send.patch deleted file mode 100644 index 92cb2cd6..00000000 --- a/kernel/kernel/files/patches/mageia/fs-btrfs-unlock-i_mutex-after-attempting-to-delete-subvolume-during-send.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 909e26dce3f7600f5e293ac0522c28790a0c8c9c Mon Sep 17 00:00:00 2001 -From: Omar Sandoval -Date: Fri, 10 Apr 2015 14:20:40 -0700 -Subject: btrfs: unlock i_mutex after attempting to delete subvolume during send - -From: Omar Sandoval - -commit 909e26dce3f7600f5e293ac0522c28790a0c8c9c upstream. - -Whenever the check for a send in progress introduced in commit -521e0546c970 (btrfs: protect snapshots from deleting during send) is -hit, we return without unlocking inode->i_mutex. This is easy to see -with lockdep enabled: - -[ +0.000059] ================================================ -[ +0.000028] [ BUG: lock held when returning to user space! ] -[ +0.000029] 4.0.0-rc5-00096-g3c435c1 #93 Not tainted -[ +0.000026] ------------------------------------------------ -[ +0.000029] btrfs/211 is leaving the kernel with locks still held! -[ +0.000029] 1 lock held by btrfs/211: -[ +0.000023] #0: (&type->i_mutex_dir_key){+.+.+.}, at: [] btrfs_ioctl_snap_destroy+0x2df/0x7a0 - -Make sure we unlock it in the error path. - -Reviewed-by: Filipe Manana -Reviewed-by: David Sterba -Signed-off-by: Omar Sandoval -Signed-off-by: Chris Mason -Signed-off-by: Greg Kroah-Hartman - ---- - fs/btrfs/ioctl.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/fs/btrfs/ioctl.c -+++ b/fs/btrfs/ioctl.c -@@ -2403,7 +2403,7 @@ static noinline int btrfs_ioctl_snap_des - "Attempt to delete subvolume %llu during send", - dest->root_key.objectid); - err = -EPERM; -- goto out_dput; -+ goto out_unlock_inode; - } - - d_invalidate(dentry); -@@ -2498,6 +2498,7 @@ out_up_write: - root_flags & ~BTRFS_ROOT_SUBVOL_DEAD); - spin_unlock(&dest->root_item_lock); - } -+out_unlock_inode: - mutex_unlock(&inode->i_mutex); - if (!err) { - shrink_dcache_sb(root->fs_info->sb); diff --git a/kernel/kernel/files/patches/mageia/fs-efivarfs-Ensure-VariableName-is-NUL-terminated.patch b/kernel/kernel/files/patches/mageia/fs-efivarfs-Ensure-VariableName-is-NUL-terminated.patch deleted file mode 100644 index 5de75876..00000000 --- a/kernel/kernel/files/patches/mageia/fs-efivarfs-Ensure-VariableName-is-NUL-terminated.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: Ross Lagerwall -Subject: [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated -Date: Thu, 2 Apr 2015 08:39:00 +0100 - -Some buggy firmware implementations update VariableNameSize on success -such that it does not include the final NUL character which results in -garbage in the efivarfs name entries. Use kzalloc on the efivar_entry -(as is done in efivars.c) to ensure that the name is always -NUL-terminated. - -The buggy firmware is: -BIOS Information - Vendor: Intel Corp. - Version: S1200RP.86B.02.02.0005.102320140911 - Release Date: 10/23/2014 - BIOS Revision: 4.6 -System Information - Manufacturer: Intel Corporation - Product Name: S1200RP_SE - -Signed-off-by: Ross Lagerwall ---- - fs/efivarfs/super.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c -index ddbce42..acf9a67 100644 ---- a/fs/efivarfs/super.c -+++ b/fs/efivarfs/super.c -@@ -121,7 +121,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor, - int len, i; - int err = -ENOMEM; - -- entry = kmalloc(sizeof(*entry), GFP_KERNEL); -+ entry = kzalloc(sizeof(*entry), GFP_KERNEL); - if (!entry) - return err; - --- -2.1.0 - diff --git a/kernel/kernel/files/patches/mageia/fs-ext4-fix-data-corruption-caused-by-unwritten-and-del.patch b/kernel/kernel/files/patches/mageia/fs-ext4-fix-data-corruption-caused-by-unwritten-and-del.patch deleted file mode 100644 index 5281eaec..00000000 --- a/kernel/kernel/files/patches/mageia/fs-ext4-fix-data-corruption-caused-by-unwritten-and-del.patch +++ /dev/null @@ -1,93 +0,0 @@ -From d2dc317d564a46dfc683978a2e5a4f91434e9711 Mon Sep 17 00:00:00 2001 -From: Lukas Czerner -Date: Sat, 2 May 2015 21:36:55 -0400 -Subject: [PATCH] ext4: fix data corruption caused by unwritten and delayed - extents - -Currently it is possible to lose whole file system block worth of data -when we hit the specific interaction with unwritten and delayed extents -in status extent tree. - -The problem is that when we insert delayed extent into extent status -tree the only way to get rid of it is when we write out delayed buffer. -However there is a limitation in the extent status tree implementation -so that when inserting unwritten extent should there be even a single -delayed block the whole unwritten extent would be marked as delayed. - -At this point, there is no way to get rid of the delayed extents, -because there are no delayed buffers to write out. So when a we write -into said unwritten extent we will convert it to written, but it still -remains delayed. - -When we try to write into that block later ext4_da_map_blocks() will set -the buffer new and delayed and map it to invalid block which causes -the rest of the block to be zeroed loosing already written data. - -For now we can fix this by simply not allowing to set delayed status on -written extent in the extent status tree. Also add WARN_ON() to make -sure that we notice if this happens in the future. - -This problem can be easily reproduced by running the following xfs_io. - -xfs_io -f -c "pwrite -S 0xaa 4096 2048" \ - -c "falloc 0 131072" \ - -c "pwrite -S 0xbb 65536 2048" \ - -c "fsync" /mnt/test/fff - -echo 3 > /proc/sys/vm/drop_caches -xfs_io -c "pwrite -S 0xdd 67584 2048" /mnt/test/fff - -This can be theoretically also reproduced by at random by running fsx, -but it's not very reliable, though on machines with bigger page size -(like ppc) this can be seen more often (especially xfstest generic/127) - -Signed-off-by: Lukas Czerner -Signed-off-by: Theodore Ts'o -Cc: stable@vger.kernel.org ---- - fs/ext4/extents_status.c | 8 ++++++++ - fs/ext4/inode.c | 2 ++ - 2 files changed, 10 insertions(+) - -diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c -index d33d5a6..26724ae 100644 ---- a/fs/ext4/extents_status.c -+++ b/fs/ext4/extents_status.c -@@ -703,6 +703,14 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, - - BUG_ON(end < lblk); - -+ if ((status & EXTENT_STATUS_DELAYED) && -+ (status & EXTENT_STATUS_WRITTEN)) { -+ ext4_warning(inode->i_sb, "Inserting extent [%u/%u] as " -+ " delayed and written which can potentially " -+ " cause data loss.\n", lblk, len); -+ WARN_ON(1); -+ } -+ - newes.es_lblk = lblk; - newes.es_len = len; - ext4_es_store_pblock_status(&newes, pblk, status); -diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index f6b35d8..4415cea 100644 ---- a/fs/ext4/inode.c -+++ b/fs/ext4/inode.c -@@ -532,6 +532,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, - status = map->m_flags & EXT4_MAP_UNWRITTEN ? - EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN; - if (!(flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) && -+ !(status & EXTENT_STATUS_WRITTEN) && - ext4_find_delalloc_range(inode, map->m_lblk, - map->m_lblk + map->m_len - 1)) - status |= EXTENT_STATUS_DELAYED; -@@ -636,6 +637,7 @@ found: - status = map->m_flags & EXT4_MAP_UNWRITTEN ? - EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN; - if (!(flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) && -+ !(status & EXTENT_STATUS_WRITTEN) && - ext4_find_delalloc_range(inode, map->m_lblk, - map->m_lblk + map->m_len - 1)) - status |= EXTENT_STATUS_DELAYED; --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/fs-ext4-move-check-under-lock-scope-to-close-a-race.patch b/kernel/kernel/files/patches/mageia/fs-ext4-move-check-under-lock-scope-to-close-a-race.patch deleted file mode 100644 index fdcda8b2..00000000 --- a/kernel/kernel/files/patches/mageia/fs-ext4-move-check-under-lock-scope-to-close-a-race.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 280227a75b56ab5d35854f3a77ef74a7ad56a203 Mon Sep 17 00:00:00 2001 -From: Davide Italiano -Date: Sat, 2 May 2015 23:21:15 -0400 -Subject: ext4: move check under lock scope to close a race. - -From: Davide Italiano - -commit 280227a75b56ab5d35854f3a77ef74a7ad56a203 upstream. - -fallocate() checks that the file is extent-based and returns -EOPNOTSUPP in case is not. Other tasks can convert from and to -indirect and extent so it's safe to check only after grabbing -the inode mutex. - -Signed-off-by: Davide Italiano -Signed-off-by: Theodore Ts'o -Signed-off-by: Greg Kroah-Hartman - ---- - fs/ext4/extents.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - ---- a/fs/ext4/extents.c -+++ b/fs/ext4/extents.c -@@ -4934,13 +4934,6 @@ long ext4_fallocate(struct file *file, i - if (ret) - return ret; - -- /* -- * currently supporting (pre)allocate mode for extent-based -- * files _only_ -- */ -- if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) -- return -EOPNOTSUPP; -- - if (mode & FALLOC_FL_COLLAPSE_RANGE) - return ext4_collapse_range(inode, offset, len); - -@@ -4962,6 +4955,14 @@ long ext4_fallocate(struct file *file, i - - mutex_lock(&inode->i_mutex); - -+ /* -+ * We only support preallocation for extent-based files only -+ */ -+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) { -+ ret = -EOPNOTSUPP; -+ goto out; -+ } -+ - if (!(mode & FALLOC_FL_KEEP_SIZE) && - offset + len > i_size_read(inode)) { - new_size = offset + len; diff --git a/kernel/kernel/files/patches/mageia/fs-mnt-Fail-collect_mounts-when-applied-to-unmounted-mo.patch b/kernel/kernel/files/patches/mageia/fs-mnt-Fail-collect_mounts-when-applied-to-unmounted-mo.patch deleted file mode 100644 index b2f9ee94..00000000 --- a/kernel/kernel/files/patches/mageia/fs-mnt-Fail-collect_mounts-when-applied-to-unmounted-mo.patch +++ /dev/null @@ -1,49 +0,0 @@ -From cd4a40174b71acd021877341684d8bb1dc8ea4ae Mon Sep 17 00:00:00 2001 -From: "Eric W. Biederman" -Date: Wed, 7 Jan 2015 14:28:26 -0600 -Subject: [PATCH] mnt: Fail collect_mounts when applied to unmounted mounts - -The only users of collect_mounts are in audit_tree.c - -In audit_trim_trees and audit_add_tree_rule the path passed into -collect_mounts is generated from kern_path passed an audit_tree -pathname which is guaranteed to be an absolute path. In those cases -collect_mounts is obviously intended to work on mounted paths and -if a race results in paths that are unmounted when collect_mounts -it is reasonable to fail early. - -The paths passed into audit_tag_tree don't have the absolute path -check. But are used to play with fsnotify and otherwise interact with -the audit_trees, so again operating only on mounted paths appears -reasonable. - -Avoid having to worry about what happens when we try and audit -unmounted filesystems by restricting collect_mounts to mounts -that appear in the mount tree. - -Signed-off-by: "Eric W. Biederman" ---- - fs/namespace.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/fs/namespace.c b/fs/namespace.c -index 2b12b7a..acc5583 100644 ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -1669,8 +1669,11 @@ struct vfsmount *collect_mounts(struct path *path) - { - struct mount *tree; - namespace_lock(); -- tree = copy_tree(real_mount(path->mnt), path->dentry, -- CL_COPY_ALL | CL_PRIVATE); -+ if (!check_mnt(real_mount(path->mnt))) -+ tree = ERR_PTR(-EINVAL); -+ else -+ tree = copy_tree(real_mount(path->mnt), path->dentry, -+ CL_COPY_ALL | CL_PRIVATE); - namespace_unlock(); - if (IS_ERR(tree)) - return ERR_CAST(tree); --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/fs-mnt-Fix-fs_fully_visible-to-verify-the-root-director.patch b/kernel/kernel/files/patches/mageia/fs-mnt-Fix-fs_fully_visible-to-verify-the-root-director.patch deleted file mode 100644 index 0a8a5e8f..00000000 --- a/kernel/kernel/files/patches/mageia/fs-mnt-Fix-fs_fully_visible-to-verify-the-root-director.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 7e96c1b0e0f495c5a7450dc4aa7c9a24ba4305bd Mon Sep 17 00:00:00 2001 -From: "Eric W. Biederman" -Date: Fri, 8 May 2015 16:36:50 -0500 -Subject: [PATCH] mnt: Fix fs_fully_visible to verify the root directory is - visible - -This fixes a dumb bug in fs_fully_visible that allows proc or sys to -be mounted if there is a bind mount of part of /proc/ or /sys/ visible. - -Cc: stable@vger.kernel.org -Reported-by: Eric Windisch -Signed-off-by: "Eric W. Biederman" ---- - fs/namespace.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/fs/namespace.c b/fs/namespace.c -index 1f4f9da..1b9e111 100644 ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -3179,6 +3179,12 @@ bool fs_fully_visible(struct file_system_type *type) - if (mnt->mnt.mnt_sb->s_type != type) - continue; - -+ /* This mount is not fully visible if it's root directory -+ * is not the root directory of the filesystem. -+ */ -+ if (mnt->mnt.mnt_root != mnt->mnt.mnt_sb->s_root) -+ continue; -+ - /* This mount is not fully visible if there are any child mounts - * that cover anything except for empty directories. - */ --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/fs-path_openat-fix-double-fput.patch b/kernel/kernel/files/patches/mageia/fs-path_openat-fix-double-fput.patch deleted file mode 100644 index 6a4d81ed..00000000 --- a/kernel/kernel/files/patches/mageia/fs-path_openat-fix-double-fput.patch +++ /dev/null @@ -1,36 +0,0 @@ -From f15133df088ecadd141ea1907f2c96df67c729f0 Mon Sep 17 00:00:00 2001 -From: Al Viro -Date: Fri, 8 May 2015 22:53:15 -0400 -Subject: [PATCH] path_openat(): fix double fput() - -path_openat() jumps to the wrong place after do_tmpfile() - it has -already done path_cleanup() (as part of path_lookupat() called by -do_tmpfile()), so doing that again can lead to double fput(). - -Cc: stable@vger.kernel.org # v3.11+ -Signed-off-by: Al Viro ---- - fs/namei.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/fs/namei.c b/fs/namei.c -index f67cf6c..fe30d3b 100644 ---- a/fs/namei.c -+++ b/fs/namei.c -@@ -3209,7 +3209,7 @@ static struct file *path_openat(int dfd, - - if (unlikely(file->f_flags & __O_TMPFILE)) { - error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened); -- goto out; -+ goto out2; - } - - error = path_init(dfd, pathname->name, flags, nd); -@@ -3239,6 +3239,7 @@ static struct file *path_openat(int dfd, - } - out: - path_cleanup(nd); -+out2: - if (!(opened & FILE_OPENED)) { - BUG_ON(!error); - put_filp(file); diff --git a/kernel/kernel/files/patches/mageia/fs-splice-sendfile-at-once-fails-for-big-files.patch b/kernel/kernel/files/patches/mageia/fs-splice-sendfile-at-once-fails-for-big-files.patch deleted file mode 100644 index 369de1d1..00000000 --- a/kernel/kernel/files/patches/mageia/fs-splice-sendfile-at-once-fails-for-big-files.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 0ff28d9f4674d781e492bcff6f32f0fe48cf0fed Mon Sep 17 00:00:00 2001 -From: Christophe Leroy -Date: Wed, 6 May 2015 17:26:47 +0200 -Subject: [PATCH] splice: sendfile() at once fails for big files - -Using sendfile with below small program to get MD5 sums of some files, -it appear that big files (over 64kbytes with 4k pages system) get a -wrong MD5 sum while small files get the correct sum. -This program uses sendfile() to send a file to an AF_ALG socket -for hashing. - -/* md5sum2.c */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - int sk = socket(AF_ALG, SOCK_SEQPACKET, 0); - struct stat st; - struct sockaddr_alg sa = { - .salg_family = AF_ALG, - .salg_type = "hash", - .salg_name = "md5", - }; - int n; - - bind(sk, (struct sockaddr*)&sa, sizeof(sa)); - - for (n = 1; n < argc; n++) { - int size; - int offset = 0; - char buf[4096]; - int fd; - int sko; - int i; - - fd = open(argv[n], O_RDONLY); - sko = accept(sk, NULL, 0); - fstat(fd, &st); - size = st.st_size; - sendfile(sko, fd, &offset, size); - size = read(sko, buf, sizeof(buf)); - for (i = 0; i < size; i++) - printf("%2.2x", buf[i]); - printf(" %s\n", argv[n]); - close(fd); - close(sko); - } - exit(0); -} - -Test below is done using official linux patch files. First result is -with a software based md5sum. Second result is with the program above. - -root@vgoip:~# ls -l patch-3.6.* --rw-r--r-- 1 root root 64011 Aug 24 12:01 patch-3.6.2.gz --rw-r--r-- 1 root root 94131 Aug 24 12:01 patch-3.6.3.gz - -root@vgoip:~# md5sum patch-3.6.* -b3ffb9848196846f31b2ff133d2d6443 patch-3.6.2.gz -c5e8f687878457db77cb7158c38a7e43 patch-3.6.3.gz - -root@vgoip:~# ./md5sum2 patch-3.6.* -b3ffb9848196846f31b2ff133d2d6443 patch-3.6.2.gz -5fd77b24e68bb24dcc72d6e57c64790e patch-3.6.3.gz - -After investivation, it appears that sendfile() sends the files by blocks -of 64kbytes (16 times PAGE_SIZE). The problem is that at the end of each -block, the SPLICE_F_MORE flag is missing, therefore the hashing operation -is reset as if it was the end of the file. - -This patch adds SPLICE_F_MORE to the flags when more data is pending. - -With the patch applied, we get the correct sums: - -root@vgoip:~# md5sum patch-3.6.* -b3ffb9848196846f31b2ff133d2d6443 patch-3.6.2.gz -c5e8f687878457db77cb7158c38a7e43 patch-3.6.3.gz - -root@vgoip:~# ./md5sum2 patch-3.6.* -b3ffb9848196846f31b2ff133d2d6443 patch-3.6.2.gz -c5e8f687878457db77cb7158c38a7e43 patch-3.6.3.gz - -Signed-off-by: Christophe Leroy -Signed-off-by: Jens Axboe ---- - fs/splice.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/fs/splice.c b/fs/splice.c -index 476024b..bfe62ae 100644 ---- a/fs/splice.c -+++ b/fs/splice.c -@@ -1161,7 +1161,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, - long ret, bytes; - umode_t i_mode; - size_t len; -- int i, flags; -+ int i, flags, more; - - /* - * We require the input being a regular file, as we don't want to -@@ -1204,6 +1204,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, - * Don't block on output, we have to drain the direct pipe. - */ - sd->flags &= ~SPLICE_F_NONBLOCK; -+ more = sd->flags & SPLICE_F_MORE; - - while (len) { - size_t read_len; -@@ -1217,6 +1218,15 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, - sd->total_len = read_len; - - /* -+ * If more data is pending, set SPLICE_F_MORE -+ * If this is the last data and SPLICE_F_MORE was not set -+ * initially, clears it. -+ */ -+ if (read_len < len) -+ sd->flags |= SPLICE_F_MORE; -+ else if (!more) -+ sd->flags &= ~SPLICE_F_MORE; -+ /* - * NOTE: nonblocking mode only applies to the input. We - * must not do the output in nonblocking mode as then we - * could get stuck data in the internal pipe: --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/genirq-Fix-null-pointer-reference-in-irq_set_affinit.patch b/kernel/kernel/files/patches/mageia/genirq-Fix-null-pointer-reference-in-irq_set_affinit.patch deleted file mode 100644 index 458a93c7..00000000 --- a/kernel/kernel/files/patches/mageia/genirq-Fix-null-pointer-reference-in-irq_set_affinit.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 4fe7ffb7e17ca6ad9173b8de35f260c9c8fc2f79 Mon Sep 17 00:00:00 2001 -From: Jesse Brandeburg -Date: Wed, 28 Jan 2015 10:57:14 -0800 -Subject: [PATCH] genirq: Fix null pointer reference in irq_set_affinity_hint() - -The recent set_affinity commit by me introduced some null -pointer dereferences on driver unload, because some drivers -call this function with a NULL argument. This fixes the issue -by just checking for null before setting the affinity mask. - -Fixes: e2e64a932556 ("genirq: Set initial affinity in irq_set_affinity_hint()") -Reported-by: Yinghai Lu -Signed-off-by: Jesse Brandeburg -CC: netdev@vger.kernel.org -Link: http://lkml.kernel.org/r/20150128185739.9689.84588.stgit@jbrandeb-cp2.jf.intel.com -Signed-off-by: Ingo Molnar ---- - kernel/irq/manage.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index f038e58..196a06f 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -244,7 +244,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) - desc->affinity_hint = m; - irq_put_desc_unlock(desc, flags); - /* set the initial affinity to prevent every interrupt being on CPU0 */ -- __irq_set_affinity(irq, m, false); -+ if (m) -+ __irq_set_affinity(irq, m, false); - return 0; - } - EXPORT_SYMBOL_GPL(irq_set_affinity_hint); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/genirq-Set-initial-affinity-in-irq_set_affinity_hint.patch b/kernel/kernel/files/patches/mageia/genirq-Set-initial-affinity-in-irq_set_affinity_hint.patch deleted file mode 100644 index ca1c7fa7..00000000 --- a/kernel/kernel/files/patches/mageia/genirq-Set-initial-affinity-in-irq_set_affinity_hint.patch +++ /dev/null @@ -1,69 +0,0 @@ -From e2e64a932556cdfae455497dbe94a8db151fc9fa Mon Sep 17 00:00:00 2001 -From: Jesse Brandeburg -Date: Thu, 18 Dec 2014 17:21:41 -0800 -Subject: [PATCH] genirq: Set initial affinity in irq_set_affinity_hint() - -Problem: -The default behavior of the kernel is somewhat undesirable as all -requested interrupts end up on CPU0 after registration. A user can -run irqbalance daemon, or can manually configure smp_affinity via the -proc filesystem, but the default affinity of the interrupts for all -devices is always CPU zero, this can cause performance problems or -very heavy cpu use of only one core if not noticed and fixed by the -user. - -Solution: -Enable the setting of the initial affinity directly when the driver -sets a hint. - -This enabling means that kernel drivers can include an initial -affinity setting for the interrupt, instead of all interrupts starting -out life on CPU0. Of course if irqbalance is still running then the -interrupts will get moved as before. - -This function is currently called by drivers in block, crypto, -infiniband, ethernet and scsi trees, but only a handful, so these will -be the devices affected by this change. - -Tested on i40e, and default interrupts were spread across the CPUs -according to the hint. - -drivers/block/mtip32xx/mtip32xx.c:3 -drivers/block/nvme-core.c:2 -drivers/crypto/qat/qat_dh895xcc/adf_isr.c:3 -drivers/infiniband/hw/qib/qib_iba7322.c:2 -drivers/net/ethernet/intel/i40e/i40e_main.c:3 -drivers/net/ethernet/intel/i40evf/i40evf_main.c:3 -drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3 -drivers/net/ethernet/mellanox/mlx4/en_cq.c:2 -drivers/scsi/hpsa.c:3 -drivers/scsi/lpfc/lpfc_init.c:3 -drivers/scsi/megaraid/megaraid_sas_base.c:8 -drivers/soc/ti/knav_qmss_acc.c:1 -drivers/soc/ti/knav_qmss_queue.c:2 -drivers/virtio/virtio_pci_common.c:2 - -Signed-off-by: Jesse Brandeburg -Cc: netdev@vger.kernel.org -Link: http://lkml.kernel.org/r/20141219012206.4220.27491.stgit@jbrandeb-cp2.jf.intel.com -Signed-off-by: Thomas Gleixner ---- - kernel/irq/manage.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index 8069237..f038e58 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -243,6 +243,8 @@ int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) - return -EINVAL; - desc->affinity_hint = m; - irq_put_desc_unlock(desc, flags); -+ /* set the initial affinity to prevent every interrupt being on CPU0 */ -+ __irq_set_affinity(irq, m, false); - return 0; - } - EXPORT_SYMBOL_GPL(irq_set_affinity_hint); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Enable-the-HiZ-RAW-Stall-Optimization-on-Broadwell.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-Enable-the-HiZ-RAW-Stall-Optimization-on-Broadwell.patch deleted file mode 100644 index ae55de1c..00000000 --- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Enable-the-HiZ-RAW-Stall-Optimization-on-Broadwell.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 2701fc43562b55f5db0139ef6a7b13c2518ed6c0 Mon Sep 17 00:00:00 2001 -From: Kenneth Graunke -Date: Tue, 13 Jan 2015 12:46:52 -0800 -Subject: drm/i915: Enable the HiZ RAW Stall Optimization on Broadwell. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is an important optimization for avoiding read-after-write (RAW) -stalls in the HiZ buffer. Certain workloads would run very slowly with -HiZ enabled, but run much faster with the "hiz=false" driconf option. -With this patch, they run at full speed even with HiZ. - -Improves performance in OglVSInstancing by 3.2x on Broadwell GT3e -(Iris Pro 6200). - -Thanks to Jesse Barnes and Ben Widawsky for their help in tracking this -down. Thanks to Chris Wilson for showing me the new workarounds system. - -Signed-off-by: Kenneth Graunke -Cc: Jesse Barnes -Reviewed-by: Ville Syrjälä -Signed-off-by: Daniel Vetter - -diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c -index dabc1d8..0df15a4 100644 ---- a/drivers/gpu/drm/i915/intel_ringbuffer.c -+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c -@@ -767,6 +767,16 @@ static int bdw_init_workarounds(struct i - HDC_FORCE_NON_COHERENT | - (IS_BDW_GT3(dev) ? HDC_FENCE_DEST_SLM_DISABLE : 0)); - -+ /* From the Haswell PRM, Command Reference: Registers, CACHE_MODE_0: -+ * "The Hierarchical Z RAW Stall Optimization allows non-overlapping -+ * polygons in the same 8x4 pixel/sample area to be processed without -+ * stalling waiting for the earlier ones to write to Hierarchical Z -+ * buffer." -+ * -+ * This optimization is off by default for Broadwell; turn it on. -+ */ -+ WA_CLR_BIT_MASKED(CACHE_MODE_0_GEN7, HIZ_RAW_STALL_OPT_DISABLE); -+ - /* Wa4x4STCOptimizationDisable:bdw */ - WA_SET_BIT_MASKED(CACHE_MODE_1, - GEN8_4x4_STC_OPTIMIZATION_DISABLE); diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Ensure-the-HiZ-RAW-Stall-Optimization-is-on-for-Cherryview.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-Ensure-the-HiZ-RAW-Stall-Optimization-is-on-for-Cherryview.patch deleted file mode 100644 index 598cfe20..00000000 --- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Ensure-the-HiZ-RAW-Stall-Optimization-is-on-for-Cherryview.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 973a5b06a096f1a9494ebe94c78d809459f4dc74 Mon Sep 17 00:00:00 2001 -From: Kenneth Graunke -Date: Tue, 13 Jan 2015 12:46:53 -0800 -Subject: drm/i915: Ensure the HiZ RAW Stall Optimization is on for Cherryview. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is an important optimization for avoiding read-after-write (RAW) -stalls in the HiZ buffer. Certain workloads would run very slowly with -HiZ enabled, but run much faster with the "hiz=false" driconf option. -With this patch, they run at full speed even with HiZ. - -Increases performance in OglVSInstancing by about 2.7x on Braswell. - -Signed-off-by: Kenneth Graunke -Reviewed-by: Ville Syrjälä -Signed-off-by: Daniel Vetter - -diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c -index 0df15a4..23020d6 100644 ---- a/drivers/gpu/drm/i915/intel_ringbuffer.c -+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c -@@ -817,6 +817,11 @@ static int chv_init_workarounds(struct i - HDC_FORCE_NON_COHERENT | - HDC_DONOT_FETCH_MEM_WHEN_MASKED); - -+ /* According to the CACHE_MODE_0 default value documentation, some -+ * CHV platforms disable this optimization by default. Turn it on. -+ */ -+ WA_CLR_BIT_MASKED(CACHE_MODE_0_GEN7, HIZ_RAW_STALL_OPT_DISABLE); -+ - /* Improve HiZ throughput on CHV. */ - WA_SET_BIT_MASKED(HIZ_CHICKEN, CHV_HZ_8X8_MODE_IN_1X); - diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Improve-HiZ-throughput-on-Cherryview.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-Improve-HiZ-throughput-on-Cherryview.patch deleted file mode 100644 index 83f98e45..00000000 --- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Improve-HiZ-throughput-on-Cherryview.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d60de81da48aa25b06a015b839906243710e7253 Mon Sep 17 00:00:00 2001 -From: Kenneth Graunke -Date: Sat, 10 Jan 2015 18:02:22 -0800 -Subject: drm/i915: Improve HiZ throughput on Cherryview. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Found by reading the HIZ_CHICKEN documentation. - -Improves performance in a HiZ microbenchmark by around 50%. -Improves performance in OglZBuffer by around 18%. - -Thanks to Chris Wilson for helping me figure out where to put this. - -Signed-off-by: Kenneth Graunke -Reviewed-by: Ville Syrjälä -Signed-off-by: Daniel Vetter - -diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h -index 0f32fd1a..a39bb03 100644 ---- a/drivers/gpu/drm/i915/i915_reg.h -+++ b/drivers/gpu/drm/i915/i915_reg.h -@@ -5158,6 +5158,9 @@ enum punit_power_well { - #define COMMON_SLICE_CHICKEN2 0x7014 - # define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE (1<<0) - -+#define HIZ_CHICKEN 0x7018 -+# define CHV_HZ_8X8_MODE_IN_1X (1<<15) -+ - #define GEN7_L3SQCREG1 0xB010 - #define VLV_B0_WA_L3SQCREG1_VALUE 0x00D30000 - -diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c -index 12a36f0..dabc1d8 100644 ---- a/drivers/gpu/drm/i915/intel_ringbuffer.c -+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c -@@ -807,6 +807,9 @@ static int chv_init_workarounds(struct i - HDC_FORCE_NON_COHERENT | - HDC_DONOT_FETCH_MEM_WHEN_MASKED); - -+ /* Improve HiZ throughput on CHV. */ -+ WA_SET_BIT_MASKED(HIZ_CHICKEN, CHV_HZ_8X8_MODE_IN_1X); -+ - return 0; - } - diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Make-sample_c-messages-go-faster-on-Haswell.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-Make-sample_c-messages-go-faster-on-Haswell.patch deleted file mode 100644 index 05f60a0b..00000000 --- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-Make-sample_c-messages-go-faster-on-Haswell.patch +++ /dev/null @@ -1,69 +0,0 @@ -From c44c70983107257f33f2b9d1c6a5aaf3d2eb670a Mon Sep 17 00:00:00 2001 -From: Kenneth Graunke -Date: Wed, 31 Dec 2014 16:23:00 -0800 -Subject: drm/i915: Make sample_c messages go faster on Haswell. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Haswell significantly improved the performance of sampler_c messages, -but the optimization appears to be off by default. Later platforms -remove this bit, and apparently always enable the optimization. - -Improves performance in "Counter Strike: Global Offensive" by 18% -at default settings on Iris Pro. - -This may break sampling of paletted formats (P8/A8P8/P8A8). It's -unclear whether it affects sampling of paletted formats in general, -or just the sample_c message (which is never used). - -While libva does have support for using paletted formats (primarily -for OSDs), that support appears to have been broken for at least a -year, so I couldn't observe a regression from this: - -I tried to get libva-intel to use paletted formats, and observe a -regression...but the only thing I found that used it was mplayer's OSD -(on screen display). Even without my patch, the colors were totally -wrong with that, and it's according to a few distro wikis, that's been -the case for over a year. - -If libva's code for paletted formats /is/ broken, they could always -add code to disable this bit using the command validator when fixing -it. - -Signed-off-by: Kenneth Graunke -[danvet: Add wa name from Ville's review to the comment and copypaste -the explanation why we don't care about libva (already broken) from -Ken.] -Reviewed-by: Ville Syrjälä -Signed-off-by: Daniel Vetter - -diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h -index 1fdda42..0cb0067 100644 ---- a/drivers/gpu/drm/i915/i915_reg.h -+++ b/drivers/gpu/drm/i915/i915_reg.h -@@ -6119,6 +6119,7 @@ enum punit_power_well { - #define HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE (1 << 6) - - #define HALF_SLICE_CHICKEN3 0xe184 -+#define HSW_SAMPLE_C_PERFORMANCE (1<<9) - #define GEN8_CENTROID_PIXEL_OPT_DIS (1<<8) - #define GEN8_SAMPLER_POWER_BYPASS_DIS (1<<1) - -diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c -index 4254e91..0918604 100644 ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -6710,6 +6710,10 @@ static void haswell_init_clock_gating(st - I915_WRITE(GEN7_GT_MODE, - _MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4)); - -+ /* WaSampleCChickenBitEnable:hsw */ -+ I915_WRITE(HALF_SLICE_CHICKEN3, -+ _MASKED_BIT_ENABLE(HSW_SAMPLE_C_PERFORMANCE)); -+ - /* WaSwitchSolVfFArbitrationPriority:hsw */ - I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | HSW_ECOCHK_ARB_PRIO_SOL); - --- -cgit v0.10.2 diff --git a/kernel/kernel/files/patches/mageia/gpu-drm-i915-fix-vlv-crash.patch b/kernel/kernel/files/patches/mageia/gpu-drm-i915-fix-vlv-crash.patch deleted file mode 100644 index 2d5c684f..00000000 --- a/kernel/kernel/files/patches/mageia/gpu-drm-i915-fix-vlv-crash.patch +++ /dev/null @@ -1,24 +0,0 @@ - -Revert back to legacy turbo for vlv, fixes random crashes. - -Reported by Timothée Giet on dev@ ml. - -https://bugs.freedesktop.org/show_bug.cgi?id=88012#c33 - - ---- linux/drivers/gpu/drm/i915/i915_irq.c.orig -+++ linux/drivers/gpu/drm/i915/i915_irq.c -@@ -4361,12 +4361,7 @@ void intel_irq_init(struct drm_i915_priv - INIT_WORK(&dev_priv->rps.work, gen6_pm_rps_work); - INIT_WORK(&dev_priv->l3_parity.error_work, ivybridge_parity_work); - -- /* Let's track the enabled rps events */ -- if (IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv)) -- /* WaGsvRC0ResidencyMethod:vlv */ -- dev_priv->pm_rps_events = GEN6_PM_RP_UP_EI_EXPIRED; -- else -- dev_priv->pm_rps_events = GEN6_PM_RPS_EVENTS; -+ dev_priv->pm_rps_events = GEN6_PM_RPS_EVENTS; - - setup_timer(&dev_priv->gpu_error.hangcheck_timer, - i915_hangcheck_elapsed, diff --git a/kernel/kernel/files/patches/mageia/iommu-vt-d-Remove-unused-variable.patch b/kernel/kernel/files/patches/mageia/iommu-vt-d-Remove-unused-variable.patch deleted file mode 100644 index d6826897..00000000 --- a/kernel/kernel/files/patches/mageia/iommu-vt-d-Remove-unused-variable.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 509fca899d5682a6eee3d1fb70bba7c89439034b Mon Sep 17 00:00:00 2001 -From: Alex Williamson -Date: Mon, 23 Mar 2015 19:49:56 -0600 -Subject: [PATCH] iommu/vt-d: Remove unused variable - -Unused after commit 71684406905f ("iommu/vt-d: Detach domain *only* -from attached iommus"). Reported by 0-day builder. - -Signed-off-by: Alex Williamson -Signed-off-by: Joerg Roedel ---- - drivers/iommu/intel-iommu.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c -index a83c965..2d1e05b 100644 ---- a/drivers/iommu/intel-iommu.c -+++ b/drivers/iommu/intel-iommu.c -@@ -1742,7 +1742,6 @@ static int domain_init(struct dmar_domain *domain, int guest_width) - - static void domain_exit(struct dmar_domain *domain) - { -- struct dmar_drhd_unit *drhd; - struct page *freelist = NULL; - int i; - --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/md-raid5-dont-record-new-size-if-resize_stripes-fails.patch b/kernel/kernel/files/patches/mageia/md-raid5-dont-record-new-size-if-resize_stripes-fails.patch deleted file mode 100644 index 0e1c1439..00000000 --- a/kernel/kernel/files/patches/mageia/md-raid5-dont-record-new-size-if-resize_stripes-fails.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: NeilBrown -Subject: [PATCH 5/7] md/raid5: don't record new size if resize_stripes fails. -Date: Fri, 08 May 2015 18:56:11 +1000 - -If any memory allocation in resize_stripes fails we will return --ENOMEM, but in some cases we update conf->pool_size anyway. - -This means that if we try again, the allocations will be assumed -to be larger than they are, and badness results. - -So only update pool_size if there is no error. - -This bug was introduced in 2.6.17 and the patch is suitable for --stable. - -Fixes: ad01c9e3752f ("[PATCH] md: Allow stripes to be expanded in preparation for expanding an array") -Cc: stable@vger.kernel.org (v2.6.17+) -Signed-off-by: NeilBrown ---- - drivers/md/raid5.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c -index 85dc0e67fb88..9748e525e4c0 100644 ---- a/drivers/md/raid5.c -+++ b/drivers/md/raid5.c -@@ -2216,7 +2216,8 @@ static int resize_stripes(struct r5conf *conf, int newsize) - - conf->slab_cache = sc; - conf->active_name = 1-conf->active_name; -- conf->pool_size = newsize; -+ if (!err) -+ conf->pool_size = newsize; - return err; - } - diff --git a/kernel/kernel/files/patches/mageia/media-Fix-regression-in-some-more-dib0700-based-devi.patch b/kernel/kernel/files/patches/mageia/media-Fix-regression-in-some-more-dib0700-based-devi.patch new file mode 100644 index 00000000..590b2258 --- /dev/null +++ b/kernel/kernel/files/patches/mageia/media-Fix-regression-in-some-more-dib0700-based-devi.patch @@ -0,0 +1,53 @@ +From: Thomas Reitmayr +Date: Fri, 1 May 2015 20:18:04 -0300 +Subject: [PATCH] media: Fix regression in some more dib0700 based devices + +Fix an oops during device initialization by correctly setting size_of_priv +instead of leaving it 0. +The regression was introduced by 8abe4a0a3f6d4217b16a ("[media] dib7000: +export just one symbol") and only fixed for one type of dib0700 based +devices in 9e334c75642b6e5bfb95 ("[media] Fix regression in some dib0700 +based devices"). + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=92301 + +Fixes: 8abe4a0a3f6d4217b16a ("[media] dib7000: export just one symbol") + +Cc: stable@vger.kernel.org # for version 3.17+ +Signed-off-by: Thomas Reitmayr +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/usb/dvb-usb/dib0700_devices.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c +index d7d55a20e959..c170523226aa 100644 +--- a/drivers/media/usb/dvb-usb/dib0700_devices.c ++++ b/drivers/media/usb/dvb-usb/dib0700_devices.c +@@ -3944,6 +3944,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { + + DIB0700_DEFAULT_STREAMING_CONFIG(0x02), + }}, ++ .size_of_priv = sizeof(struct ++ dib0700_adapter_state), + }, { + .num_frontends = 1, + .fe = {{ +@@ -3956,6 +3958,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { + + DIB0700_DEFAULT_STREAMING_CONFIG(0x03), + }}, ++ .size_of_priv = sizeof(struct ++ dib0700_adapter_state), + } + }, + +@@ -4009,6 +4013,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { + + DIB0700_DEFAULT_STREAMING_CONFIG(0x02), + }}, ++ .size_of_priv = sizeof(struct ++ dib0700_adapter_state), + }, + }, + diff --git a/kernel/kernel/files/patches/mageia/mm-vmscan-wake-up-all-pfmemalloc-throttled-processes.patch b/kernel/kernel/files/patches/mageia/mm-vmscan-wake-up-all-pfmemalloc-throttled-processes.patch deleted file mode 100644 index 5c3ffae1..00000000 --- a/kernel/kernel/files/patches/mageia/mm-vmscan-wake-up-all-pfmemalloc-throttled-processes.patch +++ /dev/null @@ -1,44 +0,0 @@ -From cfc511557945812280699a92f171ddd2d254aca6 Mon Sep 17 00:00:00 2001 -From: Vlastimil Babka -Date: Wed, 11 Feb 2015 15:24:47 -0800 -Subject: [PATCH] mm, vmscan: wake up all pfmemalloc-throttled processes at - once - -Kswapd in balance_pgdate() currently uses wake_up() on processes waiting -in throttle_direct_reclaim(), which only wakes up a single process. This -might leave processes waiting for longer than necessary, until the check -is reached in the next loop iteration. Processes might also be left -waiting if zone was fully balanced in single iteration. Note that the -comment in balance_pgdat() also says "Wake them", so waking up a single -process does not seem intentional. - -Thus, replace wake_up() with wake_up_all(). - -Signed-off-by: Vlastimil Babka -Cc: Mel Gorman -Cc: Johannes Weiner -Cc: Michal Hocko -Cc: Vladimir Davydov -Acked-by: Rik van Riel -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - mm/vmscan.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mm/vmscan.c b/mm/vmscan.c -index dcd90c8..f756a20 100644 ---- a/mm/vmscan.c -+++ b/mm/vmscan.c -@@ -3175,7 +3175,7 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, - */ - if (waitqueue_active(&pgdat->pfmemalloc_wait) && - pfmemalloc_watermark_ok(pgdat)) -- wake_up(&pgdat->pfmemalloc_wait); -+ wake_up_all(&pgdat->pfmemalloc_wait); - - /* - * Fragmentation may mean that the system cannot be rebalanced --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/mm-writeback-use-1-instead-of-1-to-protect-against-div-.patch b/kernel/kernel/files/patches/mageia/mm-writeback-use-1-instead-of-1-to-protect-against-div-.patch deleted file mode 100644 index e54d0773..00000000 --- a/kernel/kernel/files/patches/mageia/mm-writeback-use-1-instead-of-1-to-protect-against-div-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 464d1387acb94dc43ba772b35242345e3d2ead1b Mon Sep 17 00:00:00 2001 -From: Tejun Heo -Date: Tue, 21 Apr 2015 16:49:13 -0400 -Subject: [PATCH] writeback: use |1 instead of +1 to protect against div by - zero - -mm/page-writeback.c has several places where 1 is added to the divisor -to prevent division by zero exceptions; however, if the original -divisor is equivalent to -1, adding 1 leads to division by zero. - -There are three places where +1 is used for this purpose - one in -pos_ratio_polynom() and two in bdi_position_ratio(). The second one -in bdi_position_ratio() actually triggered div-by-zero oops on a -machine running a 3.10 kernel. The divisor is - - x_intercept - bdi_setpoint + 1 == span + 1 - -span is confirmed to be (u32)-1. It isn't clear how it ended up that -but it could be from write bandwidth calculation underflow fixed by -c72efb658f7c ("writeback: fix possible underflow in write bandwidth -calculation"). - -At any rate, +1 isn't a proper protection against div-by-zero. This -patch converts all +1 protections to |1. Note that -bdi_update_dirty_ratelimit() was already using |1 before this patch. - -Signed-off-by: Tejun Heo -Cc: stable@vger.kernel.org -Reviewed-by: Jan Kara -Signed-off-by: Jens Axboe ---- - mm/page-writeback.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mm/page-writeback.c b/mm/page-writeback.c -index 5daf556..eb59f7e 100644 ---- a/mm/page-writeback.c -+++ b/mm/page-writeback.c -@@ -580,7 +580,7 @@ static long long pos_ratio_polynom(unsigned long setpoint, - long x; - - x = div64_s64(((s64)setpoint - (s64)dirty) << RATELIMIT_CALC_SHIFT, -- limit - setpoint + 1); -+ (limit - setpoint) | 1); - pos_ratio = x; - pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT; - pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT; -@@ -807,7 +807,7 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, - * scale global setpoint to bdi's: - * bdi_setpoint = setpoint * bdi_thresh / thresh - */ -- x = div_u64((u64)bdi_thresh << 16, thresh + 1); -+ x = div_u64((u64)bdi_thresh << 16, thresh | 1); - bdi_setpoint = setpoint * (u64)x >> 16; - /* - * Use span=(8*write_bw) in single bdi case as indicated by -@@ -822,7 +822,7 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, - - if (bdi_dirty < x_intercept - span / 4) { - pos_ratio = div64_u64(pos_ratio * (x_intercept - bdi_dirty), -- x_intercept - bdi_setpoint + 1); -+ (x_intercept - bdi_setpoint) | 1); - } else - pos_ratio /= 4; - --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/net-wireless-ath9k-Update-PCI-IDs-for-AR9565.patch b/kernel/kernel/files/patches/mageia/net-wireless-ath9k-Update-PCI-IDs-for-AR9565.patch deleted file mode 100644 index 601890ef..00000000 --- a/kernel/kernel/files/patches/mageia/net-wireless-ath9k-Update-PCI-IDs-for-AR9565.patch +++ /dev/null @@ -1,177 +0,0 @@ -From: Sujith Manoharan -To: linux-wireless@vger.kernel.org -Cc: ath9k-devel@qca.qualcomm.com -Subject: [PATCH] ath9k: Update PCI IDs for AR9565 -Date: Mon, 5 Jan 2015 11:14:25 +0530 - -From: Sujith Manoharan - -This patch adds several new PCI IDs for AR9565. - -Signed-off-by: Sujith Manoharan ---- - drivers/net/wireless/ath/ath9k/pci.c | 85 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 85 insertions(+) - -diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c -index f009b5b..cc5c681 100644 ---- a/drivers/net/wireless/ath/ath9k/pci.c -+++ b/drivers/net/wireless/ath/ath9k/pci.c -@@ -427,6 +427,11 @@ static const struct pci_device_id ath_pci_id_table[] = { - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, - 0x11AD, /* LITEON */ -+ 0x1842), -+ .driver_data = ATH9K_PCI_AR9565_1ANT }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ 0x11AD, /* LITEON */ - 0x6671), - .driver_data = ATH9K_PCI_AR9565_1ANT }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -@@ -446,9 +451,19 @@ static const struct pci_device_id ath_pci_id_table[] = { - .driver_data = ATH9K_PCI_AR9565_1ANT }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ 0x1B9A, /* XAVI */ -+ 0x28A3), -+ .driver_data = ATH9K_PCI_AR9565_1ANT }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - PCI_VENDOR_ID_AZWAVE, - 0x218A), - .driver_data = ATH9K_PCI_AR9565_1ANT }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ PCI_VENDOR_ID_AZWAVE, -+ 0x2F8A), -+ .driver_data = ATH9K_PCI_AR9565_1ANT }, - - /* WB335 1-ANT / Antenna Diversity */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -@@ -508,6 +523,11 @@ static const struct pci_device_id ath_pci_id_table[] = { - .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ PCI_VENDOR_ID_AZWAVE, -+ 0x213C), -+ .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - PCI_VENDOR_ID_HP, - 0x18E3), - .driver_data = ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_BT_ANT_DIV }, -@@ -555,6 +575,16 @@ static const struct pci_device_id ath_pci_id_table[] = { - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ PCI_VENDOR_ID_SAMSUNG, -+ 0x4129), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ PCI_VENDOR_ID_SAMSUNG, -+ 0x412A), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - PCI_VENDOR_ID_ATHEROS, - 0x3027), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -@@ -586,10 +616,25 @@ static const struct pci_device_id ath_pci_id_table[] = { - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, - 0x11AD, /* LITEON */ -+ 0x1832), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ 0x11AD, /* LITEON */ - 0x0692), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ 0x11AD, /* LITEON */ -+ 0x0803), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ 0x11AD, /* LITEON */ -+ 0x0813), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - PCI_VENDOR_ID_AZWAVE, - 0x2130), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -@@ -605,6 +650,21 @@ static const struct pci_device_id ath_pci_id_table[] = { - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ PCI_VENDOR_ID_AZWAVE, -+ 0x218B), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ PCI_VENDOR_ID_AZWAVE, -+ 0x218C), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ PCI_VENDOR_ID_AZWAVE, -+ 0x2F82), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - 0x144F, /* ASKEY */ - 0x7202), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -@@ -616,10 +676,20 @@ static const struct pci_device_id ath_pci_id_table[] = { - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, - 0x1B9A, /* XAVI */ -+ 0x2813), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ 0x1B9A, /* XAVI */ - 0x28A2), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ 0x1B9A, /* XAVI */ -+ 0x28A4), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - 0x185F, /* WNC */ - 0x3027), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -@@ -636,10 +706,25 @@ static const struct pci_device_id ath_pci_id_table[] = { - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, - PCI_VENDOR_ID_FOXCONN, -+ 0xE08F), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ PCI_VENDOR_ID_FOXCONN, - 0xE081), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, - { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, - 0x0036, -+ PCI_VENDOR_ID_FOXCONN, -+ 0xE091), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, -+ PCI_VENDOR_ID_FOXCONN, -+ 0xE099), -+ .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, -+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, -+ 0x0036, - PCI_VENDOR_ID_LENOVO, - 0x3026), - .driver_data = ATH9K_PCI_AR9565_2ANT | ATH9K_PCI_BT_ANT_DIV }, --- -2.2.1 diff --git a/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-Add-support-for-bcm43340_1-wireless-chipsets.patch b/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-Add-support-for-bcm43340_1-wireless-chipsets.patch deleted file mode 100644 index 691edd29..00000000 --- a/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-Add-support-for-bcm43340_1-wireless-chipsets.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 8b3a38daff6f50027039d6979b9eb026907508eb Mon Sep 17 00:00:00 2001 -From: Arend van Spriel -Date: Tue, 23 Dec 2014 19:04:23 +0100 -Subject: brcmfmac: Add support for bcm43340/1 wireless chipsets - -This patch adds support for the bcm43340 and bcm43341 wireless -chipsets. These two chipsets are identical from wireless parts -perspective. As such they use the same firmware image. - -Cc: Samuel Ortiz -Cc: Rob Herring -Signed-off-by: John Stultz -[arend@broadcom.com: squash to single commit, remove 43341 chipid] -Reviewed-by: Pieter-Paul Giesberts -Reviewed-by: Hante Meuleman -Signed-off-by: Arend van Spriel -Signed-off-by: Kalle Valo - -diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c -index 9880dae..dffd9e4 100644 ---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c -@@ -1005,6 +1005,8 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = { - BRCMF_SDIO_DEVICE(BRCM_SDIO_4329_DEVICE_ID), - BRCMF_SDIO_DEVICE(BRCM_SDIO_4330_DEVICE_ID), - BRCMF_SDIO_DEVICE(BRCM_SDIO_4334_DEVICE_ID), -+ BRCMF_SDIO_DEVICE(BRCM_SDIO_43340_DEVICE_ID), -+ BRCMF_SDIO_DEVICE(BRCM_SDIO_43341_DEVICE_ID), - BRCMF_SDIO_DEVICE(BRCM_SDIO_43362_DEVICE_ID), - BRCMF_SDIO_DEVICE(BRCM_SDIO_4335_4339_DEVICE_ID), - BRCMF_SDIO_DEVICE(BRCM_SDIO_4354_DEVICE_ID), -diff --git a/drivers/net/wireless/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/brcm80211/brcmfmac/chip.c -index 519b79e..04d2ca0 100644 ---- a/drivers/net/wireless/brcm80211/brcmfmac/chip.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/chip.c -@@ -481,6 +481,7 @@ static void brcmf_chip_get_raminfo(struct brcmf_chip_priv *ci) - ci->pub.ramsize = 0x48000; - break; - case BRCM_CC_4334_CHIP_ID: -+ case BRCM_CC_43340_CHIP_ID: - ci->pub.ramsize = 0x80000; - break; - case BRCM_CC_4335_CHIP_ID: -diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -index 0b0d51a..551da35 100644 ---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c -@@ -608,6 +608,8 @@ static const struct sdiod_drive_str sdiod_drvstr_tab2_3v3[] = { - #define BCM4330_NVRAM_NAME "brcm/brcmfmac4330-sdio.txt" - #define BCM4334_FIRMWARE_NAME "brcm/brcmfmac4334-sdio.bin" - #define BCM4334_NVRAM_NAME "brcm/brcmfmac4334-sdio.txt" -+#define BCM43340_FIRMWARE_NAME "brcm/brcmfmac43340-sdio.bin" -+#define BCM43340_NVRAM_NAME "brcm/brcmfmac43340-sdio.txt" - #define BCM4335_FIRMWARE_NAME "brcm/brcmfmac4335-sdio.bin" - #define BCM4335_NVRAM_NAME "brcm/brcmfmac4335-sdio.txt" - #define BCM43362_FIRMWARE_NAME "brcm/brcmfmac43362-sdio.bin" -@@ -629,6 +631,8 @@ MODULE_FIRMWARE(BCM4330_FIRMWARE_NAME); - MODULE_FIRMWARE(BCM4330_NVRAM_NAME); - MODULE_FIRMWARE(BCM4334_FIRMWARE_NAME); - MODULE_FIRMWARE(BCM4334_NVRAM_NAME); -+MODULE_FIRMWARE(BCM43340_FIRMWARE_NAME); -+MODULE_FIRMWARE(BCM43340_NVRAM_NAME); - MODULE_FIRMWARE(BCM4335_FIRMWARE_NAME); - MODULE_FIRMWARE(BCM4335_NVRAM_NAME); - MODULE_FIRMWARE(BCM43362_FIRMWARE_NAME); -@@ -660,6 +664,7 @@ static const struct brcmf_firmware_names brcmf_fwname_data[] = { - { BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4329) }, - { BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4330) }, - { BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4334) }, -+ { BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM43340) }, - { BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4335) }, - { BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, BRCMF_FIRMWARE_NVRAM(BCM43362) }, - { BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, BRCMF_FIRMWARE_NVRAM(BCM4339) }, -diff --git a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h -index 6996fcc..00215ef 100644 ---- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h -+++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h -@@ -34,6 +34,7 @@ - #define BRCM_CC_4329_CHIP_ID 0x4329 - #define BRCM_CC_4330_CHIP_ID 0x4330 - #define BRCM_CC_4334_CHIP_ID 0x4334 -+#define BRCM_CC_43340_CHIP_ID 43340 - #define BRCM_CC_43362_CHIP_ID 43362 - #define BRCM_CC_4335_CHIP_ID 0x4335 - #define BRCM_CC_4339_CHIP_ID 0x4339 -@@ -51,6 +52,8 @@ - #define BRCM_SDIO_4329_DEVICE_ID BRCM_CC_4329_CHIP_ID - #define BRCM_SDIO_4330_DEVICE_ID BRCM_CC_4330_CHIP_ID - #define BRCM_SDIO_4334_DEVICE_ID BRCM_CC_4334_CHIP_ID -+#define BRCM_SDIO_43340_DEVICE_ID BRCM_CC_43340_CHIP_ID -+#define BRCM_SDIO_43341_DEVICE_ID 43341 - #define BRCM_SDIO_43362_DEVICE_ID BRCM_CC_43362_CHIP_ID - #define BRCM_SDIO_4335_4339_DEVICE_ID BRCM_CC_4335_CHIP_ID - #define BRCM_SDIO_4354_DEVICE_ID BRCM_CC_4354_CHIP_ID -diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h -index 0f01fe0..9968079 100644 ---- a/include/linux/mmc/sdio_ids.h -+++ b/include/linux/mmc/sdio_ids.h -@@ -24,13 +24,15 @@ - * Vendors and devices. Sort key: vendor first, device next. - */ - #define SDIO_VENDOR_ID_BROADCOM 0x02d0 --#define SDIO_DEVICE_ID_BROADCOM_43143 43143 -+#define SDIO_DEVICE_ID_BROADCOM_43143 0xa887 - #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 - #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 - #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 - #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 -+#define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c -+#define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d - #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 --#define SDIO_DEVICE_ID_BROADCOM_43362 43362 -+#define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 - #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 - - #define SDIO_VENDOR_ID_INTEL 0x0089 diff --git a/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch b/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch deleted file mode 100644 index 2707f66f..00000000 --- a/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch +++ /dev/null @@ -1,53 +0,0 @@ -From c2b3fb54bf2952b0a41d13cb1df592d9aa0ecf9e Mon Sep 17 00:00:00 2001 -From: Arend van Spriel -Date: Fri, 1 May 2015 09:59:35 +0200 -Subject: [PATCH] brcmfmac: avoid null pointer access when - brcmf_msgbuf_get_pktid() fails - -The function brcmf_msgbuf_get_pktid() may return a NULL pointer so -the callers should check the return pointer before accessing it. - -Signed-off-by: Arend van Spriel ---- - drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - -diff --git a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -index 6262612..7a3231d 100644 ---- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c -@@ -510,11 +510,9 @@ static int brcmf_msgbuf_query_dcmd(struc - msgbuf->rx_pktids, - msgbuf->ioctl_resp_pktid); - if (msgbuf->ioctl_resp_ret_len != 0) { -- if (!skb) { -- brcmf_err("Invalid packet id idx recv'd %d\n", -- msgbuf->ioctl_resp_pktid); -+ if (!skb) - return -EBADF; -- } -+ - memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ? - len : msgbuf->ioctl_resp_ret_len); - } -@@ -865,10 +863,8 @@ brcmf_msgbuf_process_txstatus(struct brc - flowid -= BRCMF_NROF_H2D_COMMON_MSGRINGS; - skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, - msgbuf->tx_pktids, idx); -- if (!skb) { -- brcmf_err("Invalid packet id idx recv'd %d\n", idx); -+ if (!skb) - return; -- } - - set_bit(flowid, msgbuf->txstatus_done_map); - -@@ -1145,6 +1141,8 @@ brcmf_msgbuf_process_rx_complete(struct - - skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, - msgbuf->rx_pktids, idx); -+ if (!skb) -+ return; - - if (data_offset) - skb_pull(skb, data_offset); diff --git a/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-check-result-of-USB-firmware-request.patch b/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-check-result-of-USB-firmware-request.patch deleted file mode 100644 index 027cd3f7..00000000 --- a/kernel/kernel/files/patches/mageia/net-wireless-brcmfmac-check-result-of-USB-firmware-request.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -To: Kalle Valo , linux-wireless@vger.kernel.org -Cc: Brett Rudley , Arend van Spriel , - "Franky (Zhenhui) Lin" , - Hante Meuleman , - brcm80211-dev-list@broadcom.com, - =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH] brcmfmac: check result of USB firmware request -Date: Thu, 7 May 2015 14:13:03 +0200 - -This prevents silence failures with driver waiting (infinitely) for a -callback. - -Signed-off-by: Rafał Miłecki ---- -I don't really have any opinion if this should go for next or as a fix. ---- - drivers/net/wireless/brcm80211/brcmfmac/usb.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c -index 5df6aa7..daba86d 100644 ---- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c -+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c -@@ -1270,8 +1270,13 @@ static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo) - bus->chiprev = bus_pub->chiprev; - - /* request firmware here */ -- brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), NULL, -- brcmf_usb_probe_phase2); -+ ret = brcmf_fw_get_firmwares(dev, 0, brcmf_usb_get_fwname(devinfo), -+ NULL, brcmf_usb_probe_phase2); -+ if (ret) { -+ brcmf_err("firmware request failed: %d\n", ret); -+ goto fail; -+ } -+ - return 0; - - fail: --- -1.8.4.5 diff --git a/kernel/kernel/files/patches/mageia/pci-Add-Wellsburg-X99-to-Intel-PCH-root-port-ACS-qui.patch b/kernel/kernel/files/patches/mageia/pci-Add-Wellsburg-X99-to-Intel-PCH-root-port-ACS-qui.patch deleted file mode 100644 index 4620ec3c..00000000 --- a/kernel/kernel/files/patches/mageia/pci-Add-Wellsburg-X99-to-Intel-PCH-root-port-ACS-qui.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 78e883585db49aa6d86b8817b770d7717699ab4e Mon Sep 17 00:00:00 2001 -From: Alex Williamson -Date: Thu, 22 Jan 2015 11:15:43 -0700 -Subject: [PATCH] PCI: Add Wellsburg (X99) to Intel PCH root port ACS quirk - -Intel has confirmed that the Wellsburg chipset, while not reporting ACS, -does provide the proper isolation through the RCBA/BSPR registers, so the -same quirk works for this set of device IDs. - -Signed-off-by: Alex Williamson -Signed-off-by: Bjorn Helgaas -Acked-by: Don Dugger ---- - drivers/pci/quirks.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index 45bd870..e248a11 100644 ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -3703,6 +3703,9 @@ static const u16 pci_quirk_intel_pch_acs_ids[] = { - 0x9c98, 0x9c99, 0x9c9a, 0x9c9b, - /* Patsburg (X79) PCH */ - 0x1d10, 0x1d12, 0x1d14, 0x1d16, 0x1d18, 0x1d1a, 0x1d1c, 0x1d1e, -+ /* Wellsburg (X99) PCH */ -+ 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, 0x8d16, 0x8d17, -+ 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d1d, 0x8d1e, - }; - - static bool pci_quirk_intel_pch_acs_match(struct pci_dev *dev) --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/pnp-isapnp-async-init.patch b/kernel/kernel/files/patches/mageia/pnp-isapnp-async-init.patch deleted file mode 100644 index ccd356f4..00000000 --- a/kernel/kernel/files/patches/mageia/pnp-isapnp-async-init.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Andy Whitcroft -Date: Wed, 2 Dec 2009 14:41:53 +0000 (+0000) -Subject: UBUNTU: SAUCE: isapnp_init: make isa PNP scans occur async -X-Git-Tag: Ubuntu-2.6.32-8.12~27 -X-Git-Url: http://kernel.ubuntu.com/git?p=ubuntu%2Fubuntu-lucid.git;a=commitdiff_plain;h=da0e50d81022edb2bbef538fd7adf90381f8eb01 - -UBUNTU: SAUCE: isapnp_init: make isa PNP scans occur async - -The results of scanning for devices is to trigger udev events therefore -we can push this processing async. - -This reduces kernel initialisation time (the time from bootloader to -starting userspace) by several 10ths of a second x86 32bit systems. - -Signed-off-by: Andy Whitcroft ---- - -diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c -index e851160..7e4c8cd 100644 ---- a/drivers/pnp/isapnp/core.c -+++ b/drivers/pnp/isapnp/core.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include - - #include "../base.h" -@@ -1002,7 +1003,7 @@ struct pnp_protocol isapnp_protocol = { - .disable = isapnp_disable_resources, - }; - --static int __init isapnp_init(void) -+static int __init real_isapnp_init(void) - { - int cards; - struct pnp_card *card; -@@ -1096,6 +1097,15 @@ static int __init isapnp_init(void) - return 0; - } - -+static void __init async_isapnp_init(void *unused, async_cookie_t cookie) -+{ -+ (void)real_isapnp_init(); -+} -+ -+static int __init isapnp_init(void) -+{ -+ async_schedule(async_isapnp_init, NULL); -+} - device_initcall(isapnp_init); - - /* format is: noisapnp */ diff --git a/kernel/kernel/files/patches/mageia/pnp-pnpbios-off-by-default.patch b/kernel/kernel/files/patches/mageia/pnp-pnpbios-off-by-default.patch deleted file mode 100644 index b859c2a7..00000000 --- a/kernel/kernel/files/patches/mageia/pnp-pnpbios-off-by-default.patch +++ /dev/null @@ -1,15 +0,0 @@ --- - drivers/pnp/pnpbios/core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/pnp/pnpbios/core.c -+++ b/drivers/pnp/pnpbios/core.c -@@ -403,7 +403,7 @@ static void __init build_devlist(void) - * - */ - --static int pnpbios_disabled; -+static int pnpbios_disabled = 1; - int pnpbios_dont_use_current_config; - - static int __init pnpbios_setup(char *str) diff --git a/kernel/kernel/files/patches/mageia/rcu-Fix-rcu_barrier-race-that-could-result-in-too-sh.patch b/kernel/kernel/files/patches/mageia/rcu-Fix-rcu_barrier-race-that-could-result-in-too-sh.patch deleted file mode 100644 index ca1db7e5..00000000 --- a/kernel/kernel/files/patches/mageia/rcu-Fix-rcu_barrier-race-that-could-result-in-too-sh.patch +++ /dev/null @@ -1,206 +0,0 @@ -From 41050a009640f9f330a5b916563ca7faf853a98c Mon Sep 17 00:00:00 2001 -From: "Paul E. McKenney" -Date: Thu, 18 Dec 2014 12:31:02 -0800 -Subject: [PATCH] rcu: Fix rcu_barrier() race that could result in too-short - wait - -The rcu_barrier() no-callbacks check for no-CBs CPUs has race conditions. -It checks a given CPU's lists of callbacks, and if all three no-CBs lists -are empty, ignores that CPU. However, these three lists could potentially -be empty even when callbacks are present if the check executed just as -the callbacks were being moved from one list to another. It turns out -that recent versions of rcutorture can spot this race. - -This commit plugs this hole by consolidating the per-list counts of -no-CBs callbacks into a single count, which is incremented before -the corresponding callback is posted and after it is invoked. Then -rcu_barrier() checks this single count to reliably determine whether -the corresponding CPU has no-CBs callbacks. - -Signed-off-by: Paul E. McKenney ---- - kernel/rcu/tree.c | 1 + - kernel/rcu/tree.h | 29 +++++++---------------------- - kernel/rcu/tree_plugin.h | 45 ++++++++++++++++++++++++++++----------------- - 3 files changed, 36 insertions(+), 39 deletions(-) - -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 203b50d..5b9f3b9 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -3344,6 +3344,7 @@ static void _rcu_barrier(struct rcu_state *rsp) - } else { - _rcu_barrier_trace(rsp, "OnlineNoCB", cpu, - rsp->n_barrier_done); -+ smp_mb__before_atomic(); - atomic_inc(&rsp->barrier_cpu_count); - __call_rcu(&rdp->barrier_head, - rcu_barrier_callback, rsp, cpu, 0); -diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h -index 8e7b184..cb59086 100644 ---- a/kernel/rcu/tree.h -+++ b/kernel/rcu/tree.h -@@ -340,14 +340,10 @@ struct rcu_data { - #ifdef CONFIG_RCU_NOCB_CPU - struct rcu_head *nocb_head; /* CBs waiting for kthread. */ - struct rcu_head **nocb_tail; -- atomic_long_t nocb_q_count; /* # CBs waiting for kthread */ -- atomic_long_t nocb_q_count_lazy; /* (approximate). */ -+ atomic_long_t nocb_q_count; /* # CBs waiting for nocb */ -+ atomic_long_t nocb_q_count_lazy; /* invocation (all stages). */ - struct rcu_head *nocb_follower_head; /* CBs ready to invoke. */ - struct rcu_head **nocb_follower_tail; -- atomic_long_t nocb_follower_count; /* # CBs ready to invoke. */ -- atomic_long_t nocb_follower_count_lazy; /* (approximate). */ -- int nocb_p_count; /* # CBs being invoked by kthread */ -- int nocb_p_count_lazy; /* (approximate). */ - wait_queue_head_t nocb_wq; /* For nocb kthreads to sleep on. */ - struct task_struct *nocb_kthread; - int nocb_defer_wakeup; /* Defer wakeup of nocb_kthread. */ -@@ -356,8 +352,6 @@ struct rcu_data { - struct rcu_head *nocb_gp_head ____cacheline_internodealigned_in_smp; - /* CBs waiting for GP. */ - struct rcu_head **nocb_gp_tail; -- long nocb_gp_count; -- long nocb_gp_count_lazy; - bool nocb_leader_sleep; /* Is the nocb leader thread asleep? */ - struct rcu_data *nocb_next_follower; - /* Next follower in wakeup chain. */ -@@ -622,24 +616,15 @@ static void rcu_dynticks_task_exit(void); - #endif /* #ifndef RCU_TREE_NONCORE */ - - #ifdef CONFIG_RCU_TRACE --#ifdef CONFIG_RCU_NOCB_CPU --/* Sum up queue lengths for tracing. */ -+/* Read out queue lengths for tracing. */ - static inline void rcu_nocb_q_lengths(struct rcu_data *rdp, long *ql, long *qll) - { -- *ql = atomic_long_read(&rdp->nocb_q_count) + -- rdp->nocb_p_count + -- atomic_long_read(&rdp->nocb_follower_count) + -- rdp->nocb_p_count + rdp->nocb_gp_count; -- *qll = atomic_long_read(&rdp->nocb_q_count_lazy) + -- rdp->nocb_p_count_lazy + -- atomic_long_read(&rdp->nocb_follower_count_lazy) + -- rdp->nocb_p_count_lazy + rdp->nocb_gp_count_lazy; --} -+#ifdef CONFIG_RCU_NOCB_CPU -+ *ql = atomic_long_read(&rdp->nocb_q_count); -+ *qll = atomic_long_read(&rdp->nocb_q_count_lazy); - #else /* #ifdef CONFIG_RCU_NOCB_CPU */ --static inline void rcu_nocb_q_lengths(struct rcu_data *rdp, long *ql, long *qll) --{ - *ql = 0; - *qll = 0; --} - #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ -+} - #endif /* #ifdef CONFIG_RCU_TRACE */ -diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h -index 3ec85cb..e5c43b7 100644 ---- a/kernel/rcu/tree_plugin.h -+++ b/kernel/rcu/tree_plugin.h -@@ -2056,9 +2056,26 @@ static void wake_nocb_leader(struct rcu_data *rdp, bool force) - static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu) - { - struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu); -+ unsigned long ret; -+#ifdef CONFIG_PROVE_RCU - struct rcu_head *rhp; -+#endif /* #ifdef CONFIG_PROVE_RCU */ -+ -+ /* -+ * Check count of all no-CBs callbacks awaiting invocation. -+ * There needs to be a barrier before this function is called, -+ * but associated with a prior determination that no more -+ * callbacks would be posted. In the worst case, the first -+ * barrier in _rcu_barrier() suffices (but the caller cannot -+ * necessarily rely on this, not a substitute for the caller -+ * getting the concurrency design right!). There must also be -+ * a barrier between the following load an posting of a callback -+ * (if a callback is in fact needed). This is associated with an -+ * atomic_inc() in the caller. -+ */ -+ ret = atomic_long_read(&rdp->nocb_q_count); - -- /* No-CBs CPUs might have callbacks on any of three lists. */ -+#ifdef CONFIG_PROVE_RCU - rhp = ACCESS_ONCE(rdp->nocb_head); - if (!rhp) - rhp = ACCESS_ONCE(rdp->nocb_gp_head); -@@ -2072,8 +2089,9 @@ static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu) - cpu, rhp->func); - WARN_ON_ONCE(1); - } -+#endif /* #ifdef CONFIG_PROVE_RCU */ - -- return !!rhp; -+ return !!ret; - } - - /* -@@ -2095,9 +2113,10 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp, - struct task_struct *t; - - /* Enqueue the callback on the nocb list and update counts. */ -+ atomic_long_add(rhcount, &rdp->nocb_q_count); -+ /* rcu_barrier() relies on ->nocb_q_count add before xchg. */ - old_rhpp = xchg(&rdp->nocb_tail, rhtp); - ACCESS_ONCE(*old_rhpp) = rhp; -- atomic_long_add(rhcount, &rdp->nocb_q_count); - atomic_long_add(rhcount_lazy, &rdp->nocb_q_count_lazy); - smp_mb__after_atomic(); /* Store *old_rhpp before _wake test. */ - -@@ -2288,9 +2307,6 @@ wait_again: - /* Move callbacks to wait-for-GP list, which is empty. */ - ACCESS_ONCE(rdp->nocb_head) = NULL; - rdp->nocb_gp_tail = xchg(&rdp->nocb_tail, &rdp->nocb_head); -- rdp->nocb_gp_count = atomic_long_xchg(&rdp->nocb_q_count, 0); -- rdp->nocb_gp_count_lazy = -- atomic_long_xchg(&rdp->nocb_q_count_lazy, 0); - gotcbs = true; - } - -@@ -2338,9 +2354,6 @@ wait_again: - /* Append callbacks to follower's "done" list. */ - tail = xchg(&rdp->nocb_follower_tail, rdp->nocb_gp_tail); - *tail = rdp->nocb_gp_head; -- atomic_long_add(rdp->nocb_gp_count, &rdp->nocb_follower_count); -- atomic_long_add(rdp->nocb_gp_count_lazy, -- &rdp->nocb_follower_count_lazy); - smp_mb__after_atomic(); /* Store *tail before wakeup. */ - if (rdp != my_rdp && tail == &rdp->nocb_follower_head) { - /* -@@ -2415,13 +2428,11 @@ static int rcu_nocb_kthread(void *arg) - trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, "WokeNonEmpty"); - ACCESS_ONCE(rdp->nocb_follower_head) = NULL; - tail = xchg(&rdp->nocb_follower_tail, &rdp->nocb_follower_head); -- c = atomic_long_xchg(&rdp->nocb_follower_count, 0); -- cl = atomic_long_xchg(&rdp->nocb_follower_count_lazy, 0); -- rdp->nocb_p_count += c; -- rdp->nocb_p_count_lazy += cl; - - /* Each pass through the following loop invokes a callback. */ -- trace_rcu_batch_start(rdp->rsp->name, cl, c, -1); -+ trace_rcu_batch_start(rdp->rsp->name, -+ atomic_long_read(&rdp->nocb_q_count_lazy), -+ atomic_long_read(&rdp->nocb_q_count), -1); - c = cl = 0; - while (list) { - next = list->next; -@@ -2443,9 +2454,9 @@ static int rcu_nocb_kthread(void *arg) - list = next; - } - trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1); -- ACCESS_ONCE(rdp->nocb_p_count) = rdp->nocb_p_count - c; -- ACCESS_ONCE(rdp->nocb_p_count_lazy) = -- rdp->nocb_p_count_lazy - cl; -+ smp_mb__before_atomic(); /* _add after CB invocation. */ -+ atomic_long_add(-c, &rdp->nocb_q_count); -+ atomic_long_add(-cl, &rdp->nocb_q_count_lazy); - rdp->n_nocbs_invoked += c; - } - return 0; --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/scsi-add-1024-max-sectors-black-list-flag.patch b/kernel/kernel/files/patches/mageia/scsi-add-1024-max-sectors-black-list-flag.patch deleted file mode 100644 index 091f152f..00000000 --- a/kernel/kernel/files/patches/mageia/scsi-add-1024-max-sectors-black-list-flag.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 35e9a9f93994d7f7d12afa41169c7ba05513721b Mon Sep 17 00:00:00 2001 -From: Mike Christie -Date: Mon, 20 Apr 2015 22:42:24 -0500 -Subject: SCSI: add 1024 max sectors black list flag - -From: Mike Christie - -commit 35e9a9f93994d7f7d12afa41169c7ba05513721b upstream. - -This works around a issue with qnap iscsi targets not handling large IOs -very well. - -The target returns: - -VPD INQUIRY: Block limits page (SBC) - Maximum compare and write length: 1 blocks - Optimal transfer length granularity: 1 blocks - Maximum transfer length: 4294967295 blocks - Optimal transfer length: 4294967295 blocks - Maximum prefetch, xdread, xdwrite transfer length: 0 blocks - Maximum unmap LBA count: 8388607 - Maximum unmap block descriptor count: 1 - Optimal unmap granularity: 16383 - Unmap granularity alignment valid: 0 - Unmap granularity alignment: 0 - Maximum write same length: 0xffffffff blocks - Maximum atomic transfer length: 0 - Atomic alignment: 0 - Atomic transfer length granularity: 0 - -and it is *sometimes* able to handle at least one IO of size up to 8 MB. We -have seen in traces where it will sometimes work, but other times it -looks like it fails and it looks like it returns failures if we send -multiple large IOs sometimes. Also it looks like it can return 2 different -errors. It will sometimes send iscsi reject errors indicating out of -resources or it will send invalid cdb illegal requests check conditions. -And then when it sends iscsi rejects it does not seem to handle retries -when there are command sequence holes, so I could not just add code to -try and gracefully handle that error code. - -The problem is that we do not have a good contact for the company, -so we are not able to determine under what conditions it returns -which error and why it sometimes works. - -So, this patch just adds a new black list flag to set targets like this to -the old max safe sectors of 1024. The max_hw_sectors changes added in 3.19 -caused this regression, so I also ccing stable. - -Reported-by: Christian Hesse -Signed-off-by: Mike Christie -Reviewed-by: Christoph Hellwig -Signed-off-by: James Bottomley -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/scsi/scsi_devinfo.c | 1 + - drivers/scsi/scsi_scan.c | 6 ++++++ - include/scsi/scsi_devinfo.h | 1 + - 3 files changed, 8 insertions(+) - ---- a/drivers/scsi/scsi_devinfo.c -+++ b/drivers/scsi/scsi_devinfo.c -@@ -226,6 +226,7 @@ static struct { - {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, - {"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC}, - {"Promise", "", NULL, BLIST_SPARSELUN}, -+ {"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024}, - {"QUANTUM", "XP34301", "1071", BLIST_NOTQ}, - {"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN}, - {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN}, ---- a/drivers/scsi/scsi_scan.c -+++ b/drivers/scsi/scsi_scan.c -@@ -897,6 +897,12 @@ static int scsi_add_lun(struct scsi_devi - */ - if (*bflags & BLIST_MAX_512) - blk_queue_max_hw_sectors(sdev->request_queue, 512); -+ /* -+ * Max 1024 sector transfer length for targets that report incorrect -+ * max/optimal lengths and relied on the old block layer safe default -+ */ -+ else if (*bflags & BLIST_MAX_1024) -+ blk_queue_max_hw_sectors(sdev->request_queue, 1024); - - /* - * Some devices may not want to have a start command automatically ---- a/include/scsi/scsi_devinfo.h -+++ b/include/scsi/scsi_devinfo.h -@@ -36,5 +36,6 @@ - for sequential scan */ - #define BLIST_TRY_VPD_PAGES 0x10000000 /* Attempt to read VPD pages */ - #define BLIST_NO_RSOC 0x20000000 /* don't try to issue RSOC */ -+#define BLIST_MAX_1024 0x40000000 /* maximum 1024 sector cdb length */ - - #endif diff --git a/kernel/kernel/files/patches/mageia/series b/kernel/kernel/files/patches/mageia/series index 686f9f76..6443767d 100644 --- a/kernel/kernel/files/patches/mageia/series +++ b/kernel/kernel/files/patches/mageia/series @@ -15,6 +15,7 @@ ### Stable Queue ### + ### ### Arch x86 ### @@ -38,22 +39,9 @@ x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch # slows down boot Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch -# regression fix -x86-spinlocks-Fix-regression-in-spinlock-contention-.patch - ### ### Core ### -genirq-Set-initial-affinity-in-irq_set_affinity_hint.patch -genirq-Fix-null-pointer-reference-in-irq_set_affinit.patch - -iommu-vt-d-Remove-unused-variable.patch - -rcu-Fix-rcu_barrier-race-that-could-result-in-too-sh.patch - -# efi fixes -x86-efi-Store-upper-bits-of-command-line-buffer-addr.patch -firmware-efi-Fix-error-handling-in-add_sysfs_runtime_map_entr.patch ### ### i2c @@ -70,19 +58,12 @@ pci-add-ALI-M5229-ide-compatibility-mode-quirk.patch pci-quirks-drop-devinit-exit.patch # Intel ACS quirks -pci-Add-Wellsburg-X99-to-Intel-PCH-root-port-ACS-qui.patch pci-acs-quirks-for-Intel-9-series-PCH-root-ports.patch ### ### PNP core ### -# Turns pnpbios off by default, useful, since pnpbios -# is know to cause problems (TTL: forever) -pnp-pnpbios-off-by-default.patch - -pnp-isapnp-async-init.patch - ### ### ACPI ### @@ -93,20 +74,6 @@ acpi-CLEVO-M360S-disable_acpi_irq.patch # Clevo M720SR freezes with C3 acpi-processor-M720SR-limit-to-C2.patch -# fixes boot regression on some hw since kernel 3.11 -acpi-init-Fix-the-ordering-of-acpi_reserve_resources.patch -# audio regression -acpi-PNP-add-two-IDs-to-list-for-PNPACPI-device-enum.patch -# MB regression -acpi-SBS-Add-5-us-delay-to-fix-SBS-hangs-on-MacBook.patch -acpi-sbs-enable-battery-manager-when-present.patch -# backlight override -acpi-video-Allow-forcing-native-backlight-on-non-win.patch -# fix booting on new hw -acpi-ACPICA-Add-Windows-2015-string-to-_OSI-support.patch -# less log flooding -acpi-table-Use-pr_debug-instead-of-pr_info-for-MADT-.patch - ### ### Block ### @@ -150,42 +117,17 @@ ata-prefer-ata-drivers-over-ide-drivers-when-both-are-built.patch ata-revert-Disabling-the-async-PM-for-JMicron-chip-363-361.patch ata-jmicron-disable-broken-async_suspend.patch -# raid fixes -md-raid5-dont-record-new-size-if-resize_stripes-fails.patch - -# blk-mq -blk-mq-fix-CPU-hotplug-handling.patch -blk-mq-fix-race-between-timeout-and-CPU-hotplug.patch -blk-mq-fix-FUA-request-hang.patch -blk-mq-don-t-lose-requests-if-a-stopped-queue-restar.patch - -# QNAP fix -scsi-add-1024-max-sectors-black-list-flag.patch +# Nice SSD speedup +block-Make-CFQ-default-to-IOPS-mode-on-SSDs.patch +block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch ### ### File-system ### # aufs from: http://aufs.sourceforge.net/ (mga#8314) -fs-aufs-3.19.patch -fs-aufs-3.19-modular.patch - -# btrfs crash -fs-btrfs-fix-BUG_ON-in-btrfs_orphan_add-when-delete-unu.patch -fs-btrfs-unlock-i_mutex-after-attempting-to-delete-subvolume-during-send.patch - -# efi fix -fs-efivarfs-Ensure-VariableName-is-NUL-terminated.patch - -# ext4 fix -fs-ext4-fix-data-corruption-caused-by-unwritten-and-del.patch -fs-ext4-move-check-under-lock-scope-to-close-a-race.patch - -# core -fs-mnt-Fix-fs_fully_visible-to-verify-the-root-director.patch -fs-mnt-Fail-collect_mounts-when-applied-to-unmounted-mo.patch -fs-path_openat-fix-double-fput.patch -fs-splice-sendfile-at-once-fails-for-big-files.patch +fs-aufs4.patch +fs-aufs4-modular.patch ### ### FireWire @@ -220,14 +162,6 @@ gpu-drm-mach64-linux-3.14-buildfix.patch gpu-drm-mach64-3.17-buildfix.patch gpu-drm-mach64-3.18-buildfix.patch -# i915, nice speedups -gpu-drm-i915-Make-sample_c-messages-go-faster-on-Haswell.patch -gpu-drm-i915-Improve-HiZ-throughput-on-Cherryview.patch -gpu-drm-i915-Enable-the-HiZ-RAW-Stall-Optimization-on-Broadwell.patch -gpu-drm-i915-Ensure-the-HiZ-RAW-Stall-Optimization-is-on-for-Cherryview.patch -# i915, vlv crash -gpu-drm-i915-fix-vlv-crash.patch - ### ### Hardware Monitoring ### @@ -238,13 +172,6 @@ gpu-drm-i915-fix-vlv-crash.patch input-i8042-quirks-for-Fujitsu-Lifebook-A544-and-Lif.patch -# mga #14897 -Input-psmouse-support-for-the-FocalTech-PS-2-protoco.patch -Input-psmouse-remove-hardcoded-touchpad-size-from-th.patch -Input-psmouse-ensure-that-focaltech-reports-consiste.patch -Input-psmouse-disable-changing-resolution-rate-scale.patch -Input-psmouse-disable-palm-detection-in-the-focaltec.patch - ### ### idle ### @@ -257,6 +184,8 @@ Input-psmouse-disable-palm-detection-in-the-focaltec.patch ### Media ### +media-Fix-regression-in-some-more-dib0700-based-devi.patch + ### ### Misc ### @@ -265,11 +194,6 @@ Input-psmouse-disable-palm-detection-in-the-focaltec.patch ### MM ### -mm-vmscan-wake-up-all-pfmemalloc-throttled-processes.patch - -# div/0 fix -mm-writeback-use-1-instead-of-1-to-protect-against-div-.patch - ### ### Network ### @@ -290,14 +214,6 @@ net-netfilter-psd.patch net-netfilter-psd-mdv.patch net-netfilter-psd-2.6.35-buildfix.patch -# ath9k -net-wireless-ath9k-Update-PCI-IDs-for-AR9565.patch - -# brcmfmac -net-wireless-brcmfmac-Add-support-for-bcm43340_1-wireless-chipsets.patch -net-wireless-brcmfmac-avoid-null-pointer-access-when-brcmf_msgbuf.patch -net-wireless-brcmfmac-check-result-of-USB-firmware-request.patch - ### ### Platform drivers ### @@ -322,21 +238,6 @@ include-kbuild-export-pci_ids.patch ### Sound ### -# adds bluetooth sco support -sound-bluetooth-SCO-support.patch - -# VT1613 -sound-alsa-add-VT1613-AC97-codec-support.patch - -# Alsa updates for Dell -sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC256.patch -sound-alsa-hda-realtek-Support-headset-mode-for-ALC286-288.patch -sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC288.patch - -# emu10k -alsa-emu10k1-emu10k2-32-bit-dma-mode.patch -alsa-emu10k1-fix-card-shortname-string-buffer-overflow.patch - ### ### Staging ### @@ -350,30 +251,11 @@ alsa-emu10k1-fix-card-shortname-string-buffer-overflow.patch ### USB ### -# http://qa.mandriva.com/show_bug.cgi?id=30638 -bluetooth-hci_usb-disable-isoc-transfers.patch - hid-usbhid-IBM-BladeCenterHS20-quirk.patch usb-storage-unusual_devs-add-id.patch usb-storage-unusual_devs-add-id-2.6.37-buildfix.patch -# xhci fixes -usb-xhci-remove-unused-parameter-xhci-in-function-xhci-handshake.patch -usb-xhci-clean-up-work-to-remove-unused-parameters-for-functions-in-xhci-mem.c.patch -usb-xhci-fix-isoc-endpoint-dequeue-from-advancing-too-far-on-transaction-error.patch -usb-xhci-Solve-full-event-ring-by-increasing-TRBS_PER_SEGMENT-to-256.patch -usb-xhci-gracefully-handle-xhci_irq-dead-device.patch - -# uas -uas-allow-uas_use_uas_driver-to-return-usb-storage-flags.patch -uas-add-us_fl_max_sectors_240-flag.patch -uas-set-max_sectors_240-quirk-for-asm1053-devices.patch - -# misc fixes -usb-cdc-acm-prevent-infinite-loop-when-parsing-cdc-headers.patch -usb-chipidea-otg-remove-mutex-unlock-and-lock-while-stop-and-start-role.patch - ### ### V4L ### @@ -388,21 +270,6 @@ media-usb-pwc-lie-in-proc-usb-devices.patch # Mageia framebuffer boot logo video-mageia-logo.patch -# https://qa.mandriva.com/show_bug.cgi?id=59260 -# https://bugzilla.kernel.org/show_bug.cgi?id=26232 -# DISABLED: video-fb-avoid-oops-when-fw-fb-is-removed.patch -# DISABLED: video-fb-avoid-deadlock-caused-by-fb_set_suspend.patch - -# fbdev oops -video-fbdev-fix-possible-null-dereference.patch -# fbdev fixes -video-fbdev-Add-additional-vesa-modes.patch -video-fbdev-Check-Standard-Timing-against-DMT.patch -video-fbdev-Validate-mode-timing-against-monspec.patch -video-fbdev-Fix-sparse-warning-messages.patch -video-fbdev-fix-CVT-vertical-front-and-back-porch-values.patch -video-fbdev-fix-sys_copyarea.patch - ### ### 3rdparty ### @@ -431,6 +298,7 @@ video-fbdev-fix-sys_copyarea.patch 3rd-ndiswrapper-Kconfig.patch 3rd-ndiswrapper-Makefile-build-fix.patch 3rd-ndiswrapper-linux-3.14-buildfix.patch +3rd-ndiswrapper-4.0-buildfix.patch # rfswitch 3rd-rfswitch-1.3.patch @@ -448,7 +316,6 @@ video-fbdev-fix-sys_copyarea.patch 3rd-rtl8723bs.patch 3rd-rtl8723bs-buildfix.patch 3rd-rtl8723bs-updates.patch -3rd-rtl8723bs-revert-4.0-changes.patch ### ### Security @@ -470,9 +337,6 @@ video-fbdev-fix-sys_copyarea.patch ### IA64 ### -# fix broken header generation -KVM-ia64-drop-kvm.h-from-installed-user-headers.patch - ### ### Tools ### diff --git a/kernel/kernel/files/patches/mageia/sound-alsa-add-VT1613-AC97-codec-support.patch b/kernel/kernel/files/patches/mageia/sound-alsa-add-VT1613-AC97-codec-support.patch deleted file mode 100644 index 4d15be89..00000000 --- a/kernel/kernel/files/patches/mageia/sound-alsa-add-VT1613-AC97-codec-support.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: "Maciej S. Szmigiero" -Newsgroups: gmane.linux.kernel,gmane.linux.alsa.devel -Subject: [PATCH]Add VT1613 AC97 codec support -Date: Fri, 06 Mar 2015 16:59:00 +0100 - -Patch to add an VT1613 AC97 codec support. - -This codec has additional DC offset removal control, -headphone output and no video input. - -Signed-off-by: Maciej Szmigiero - -diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c -index 5ee2f17..5bca1a3 100644 ---- a/sound/pci/ac97/ac97_codec.c -+++ b/sound/pci/ac97/ac97_codec.c -@@ -177,6 +177,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { - { 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)] - { 0x54584e03, 0xffffffff, "TLV320AIC27", NULL, NULL }, - { 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL }, -+{ 0x56494120, 0xfffffff0, "VIA1613", patch_vt1613, NULL }, - { 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF - { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF - { 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL }, -diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c -index ceaac1c..eca2210 100644 ---- a/sound/pci/ac97/ac97_patch.c -+++ b/sound/pci/ac97/ac97_patch.c -@@ -3352,6 +3352,39 @@ static int patch_cm9780(struct snd_ac97 *ac97) - } - - /* -+ * VIA VT1613 codec -+ */ -+static const struct snd_kcontrol_new snd_ac97_controls_vt1613[] = { -+AC97_SINGLE("DC Offset removal", 0x5a, 10, 1, 0), -+}; -+ -+static int patch_vt1613_specific(struct snd_ac97 *ac97) -+{ -+ int err; -+ -+ err = patch_build_controls(ac97, &snd_ac97_controls_vt1613[0], -+ ARRAY_SIZE(snd_ac97_controls_vt1613)); -+ if (err) -+ return err; -+ -+ return 0; -+}; -+ -+static const struct snd_ac97_build_ops patch_vt1613_ops = { -+ .build_specific = patch_vt1613_specific -+}; -+ -+static int patch_vt1613(struct snd_ac97 *ac97) -+{ -+ ac97->build_ops = &patch_vt1613_ops; -+ -+ ac97->flags |= AC97_HAS_NO_VIDEO; -+ ac97->caps |= AC97_BC_HEADPHONE; -+ -+ return 0; -+} -+ -+/* - * VIA VT1616 codec - */ - static const struct snd_kcontrol_new snd_ac97_controls_vt1616[] = { - diff --git a/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC256.patch b/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC256.patch deleted file mode 100644 index 07b2c7e1..00000000 --- a/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC256.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 7081adf3f98f4c39dc6758208775b2aa48f51f8a Mon Sep 17 00:00:00 2001 -From: Kailang Yang -Date: Mon, 30 Mar 2015 17:05:37 +0800 -Subject: ALSA: hda/realtek - Support Dell headset mode for ALC256 - -Dell new platform of ALC256 audio codec. -Support headset mode for Dell ALC256 platform. - -Signed-off-by: Kailang Yang -Cc: -Signed-off-by: Takashi Iwai - -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index 7438213..f75c127 100644 ---- a/sound/pci/hda/patch_realtek.c -+++ b/sound/pci/hda/patch_realtek.c -@@ -3587,6 +3587,7 @@ static void alc_headset_mode_mic_in(stru - - switch (codec->vendor_id) { - case 0x10ec0255: -+ case 0x10ec0256: - alc_write_coef_idx(codec, 0x45, 0xc489); - snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); - alc_process_coef_fw(codec, coef0255); -@@ -3656,6 +3657,7 @@ static void alc_headset_mode_default(str - - switch (codec->vendor_id) { - case 0x10ec0255: -+ case 0x10ec0256: - alc_process_coef_fw(codec, coef0255); - break; - case 0x10ec0233: -@@ -3764,6 +3766,7 @@ static void alc_headset_mode_omtp(struct - - switch (codec->vendor_id) { - case 0x10ec0255: -+ case 0x10ec0256: - alc_process_coef_fw(codec, coef0255); - break; - case 0x10ec0233: -@@ -3809,6 +3812,7 @@ static void alc_determine_headset_type(s - - switch (codec->vendor_id) { - case 0x10ec0255: -+ case 0x10ec0256: - alc_process_coef_fw(codec, coef0255); - msleep(300); - val = alc_read_coef_idx(codec, 0x46); -@@ -5121,6 +5125,16 @@ static const struct snd_hda_pin_quirk al - {0x17, 0x40000000}, - {0x1d, 0x40700001}, - {0x21, 0x02211050}), -+ SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, -+ {0x12, 0x90a60140}, -+ {0x13, 0x40000000}, -+ {0x14, 0x90170110}, -+ {0x19, 0x411111f0}, -+ {0x1a, 0x411111f0}, -+ {0x1b, 0x411111f0}, -+ {0x1d, 0x40700001}, -+ {0x1e, 0x411111f0}, -+ {0x21, 0x02211020}), - SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, - {0x12, 0x90a60130}, - {0x13, 0x40000000}, diff --git a/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC288.patch b/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC288.patch deleted file mode 100644 index 3069bb9d..00000000 --- a/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-Dell-headset-mode-for-ALC288.patch +++ /dev/null @@ -1,119 +0,0 @@ -From e1e62b98ebddc3234f3259019d3236f66fc667f8 Mon Sep 17 00:00:00 2001 -From: Kailang Yang -Date: Wed, 8 Apr 2015 16:01:22 +0800 -Subject: ALSA: hda/realtek - Support Dell headset mode for ALC288 - -Dell create new platform with ALC288 codec. -This patch will enable headset mode for Dino platform. - -[slight code refactoring and compile fix by tiwai] - -Signed-off-by: Kailang Yang -Signed-off-by: Takashi Iwai - -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index ceb599a..7b5c93e 100644 ---- a/sound/pci/hda/patch_realtek.c -+++ b/sound/pci/hda/patch_realtek.c -@@ -4089,6 +4089,29 @@ static void alc_fixup_headset_mode_alc25 - alc_fixup_headset_mode(codec, fix, action); - } - -+static void alc288_update_headset_jack_cb(struct hda_codec *codec, -+ struct hda_jack_callback *jack) -+{ -+ struct alc_spec *spec = codec->spec; -+ int present; -+ -+ alc_update_headset_jack_cb(codec, jack); -+ /* Headset Mic enable or disable, only for Dell Dino */ -+ present = spec->gen.hp_jack_present ? 0x40 : 0; -+ snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, -+ present); -+} -+ -+static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, -+ const struct hda_fixup *fix, int action) -+{ -+ alc_fixup_headset_mode(codec, fix, action); -+ if (action == HDA_FIXUP_ACT_PROBE) { -+ struct alc_spec *spec = codec->spec; -+ spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; -+ } -+} -+ - static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, - const struct hda_fixup *fix, int action) - { -@@ -4427,6 +4450,9 @@ enum { - ALC282_FIXUP_ASPIRE_V5_PINS, - ALC280_FIXUP_HP_GPIO4, - ALC286_FIXUP_HP_GPIO_LED, -+ ALC288_FIXUP_DELL_HEADSET_MODE, -+ ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, -+ ALC288_FIXUP_DELL_XPS_13_GPIO6, - }; - - static const struct hda_fixup alc269_fixups[] = { -@@ -4907,6 +4933,33 @@ static const struct hda_fixup alc269_fix - .type = HDA_FIXUP_FUNC, - .v.func = alc286_fixup_hp_gpio_led, - }, -+ [ALC288_FIXUP_DELL_HEADSET_MODE] = { -+ .type = HDA_FIXUP_FUNC, -+ .v.func = alc_fixup_headset_mode_dell_alc288, -+ .chained = true, -+ .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED -+ }, -+ [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { -+ .type = HDA_FIXUP_PINS, -+ .v.pins = (const struct hda_pintbl[]) { -+ { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ -+ { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ -+ { } -+ }, -+ .chained = true, -+ .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE -+ }, -+ [ALC288_FIXUP_DELL_XPS_13_GPIO6] = { -+ .type = HDA_FIXUP_VERBS, -+ .v.verbs = (const struct hda_verb[]) { -+ {0x01, AC_VERB_SET_GPIO_MASK, 0x40}, -+ {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x40}, -+ {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, -+ { } -+ }, -+ .chained = true, -+ .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE -+ }, - }; - - static const struct snd_pci_quirk alc269_fixup_tbl[] = { -@@ -5131,6 +5184,13 @@ static const struct hda_model_fixup alc2 - {0x1b, 0x411111f0}, \ - {0x1e, 0x411111f0} - -+#define ALC288_STANDARD_PINS \ -+ {0x17, 0x411111f0}, \ -+ {0x18, 0x411111f0}, \ -+ {0x19, 0x411111f0}, \ -+ {0x1a, 0x411111f0}, \ -+ {0x1e, 0x411111f0} -+ - #define ALC290_STANDARD_PINS \ - {0x12, 0x99a30130}, \ - {0x13, 0x40000000}, \ -@@ -5326,6 +5386,13 @@ static const struct snd_hda_pin_quirk al - {0x19, 0x03a11020}, - {0x1d, 0x40e00001}, - {0x21, 0x0321101f}), -+ SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6, -+ ALC288_STANDARD_PINS, -+ {0x12, 0x90a60120}, -+ {0x13, 0x40000000}, -+ {0x14, 0x90170110}, -+ {0x1d, 0x4076832d}, -+ {0x21, 0x0321101f}), - SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, - ALC290_STANDARD_PINS, - {0x14, 0x411111f0}, diff --git a/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-headset-mode-for-ALC286-288.patch b/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-headset-mode-for-ALC286-288.patch deleted file mode 100644 index faaad70b..00000000 --- a/kernel/kernel/files/patches/mageia/sound-alsa-hda-realtek-Support-headset-mode-for-ALC286-288.patch +++ /dev/null @@ -1,178 +0,0 @@ -From f3b703326541d0c1ce85f5e570f6d2b6bd4296ec Mon Sep 17 00:00:00 2001 -From: Kailang Yang -Date: Wed, 8 Apr 2015 15:01:17 +0800 -Subject: ALSA: hda/realtek - Support headset mode for ALC286/288 - -Support headset mode for ALC286 and ALC288 platforms. - -Signed-off-by: Kailang Yang -Signed-off-by: Takashi Iwai - -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index 7f46d06..ceb599a 100644 ---- a/sound/pci/hda/patch_realtek.c -+++ b/sound/pci/hda/patch_realtek.c -@@ -3542,6 +3542,14 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) - WRITE_COEF(0x32, 0x42a3), - {} - }; -+ static struct coef_fw coef0288[] = { -+ UPDATE_COEF(0x4f, 0xfcc0, 0xc400), -+ UPDATE_COEF(0x50, 0x2000, 0x2000), -+ UPDATE_COEF(0x56, 0x0006, 0x0006), -+ UPDATE_COEF(0x66, 0x0008, 0), -+ UPDATE_COEF(0x67, 0x2000, 0), -+ {} -+ }; - static struct coef_fw coef0292[] = { - WRITE_COEF(0x76, 0x000e), - WRITE_COEF(0x6c, 0x2400), -@@ -3573,6 +3581,10 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) - case 0x10ec0283: - alc_process_coef_fw(codec, coef0233); - break; -+ case 0x10ec0286: -+ case 0x10ec0288: -+ alc_process_coef_fw(codec, coef0288); -+ break; - case 0x10ec0292: - alc_process_coef_fw(codec, coef0292); - break; -@@ -3602,6 +3614,14 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, - WRITE_COEF(0x26, 0x008c), - {} - }; -+ static struct coef_fw coef0288[] = { -+ UPDATE_COEF(0x50, 0x2000, 0), -+ UPDATE_COEF(0x56, 0x0006, 0), -+ UPDATE_COEF(0x4f, 0xfcc0, 0xc400), -+ UPDATE_COEF(0x66, 0x0008, 0x0008), -+ UPDATE_COEF(0x67, 0x2000, 0x2000), -+ {} -+ }; - static struct coef_fw coef0292[] = { - WRITE_COEF(0x19, 0xa208), - WRITE_COEF(0x2e, 0xacf0), -@@ -3635,6 +3655,13 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, - alc_process_coef_fw(codec, coef0233); - snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); - break; -+ case 0x10ec0286: -+ case 0x10ec0288: -+ alc_update_coef_idx(codec, 0x4f, 0x000c, 0); -+ snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); -+ alc_process_coef_fw(codec, coef0288); -+ snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); -+ break; - case 0x10ec0292: - snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); - alc_process_coef_fw(codec, coef0292); -@@ -3670,6 +3697,14 @@ static void alc_headset_mode_default(struct hda_codec *codec) - WRITE_COEF(0x32, 0x4ea3), - {} - }; -+ static struct coef_fw coef0288[] = { -+ UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ -+ UPDATE_COEF(0x50, 0x2000, 0x2000), -+ UPDATE_COEF(0x56, 0x0006, 0x0006), -+ UPDATE_COEF(0x66, 0x0008, 0), -+ UPDATE_COEF(0x67, 0x2000, 0), -+ {} -+ }; - static struct coef_fw coef0292[] = { - WRITE_COEF(0x76, 0x000e), - WRITE_COEF(0x6c, 0x2400), -@@ -3699,6 +3734,11 @@ static void alc_headset_mode_default(struct hda_codec *codec) - case 0x10ec0283: - alc_process_coef_fw(codec, coef0233); - break; -+ case 0x10ec0286: -+ case 0x10ec0288: -+ alc_process_coef_fw(codec, coef0288); -+ break; -+ break; - case 0x10ec0292: - alc_process_coef_fw(codec, coef0292); - break; -@@ -3727,6 +3767,13 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) - WRITE_COEF(0x32, 0x4ea3), - {} - }; -+ static struct coef_fw coef0288[] = { -+ UPDATE_COEF(0x50, 0x2000, 0x2000), -+ UPDATE_COEF(0x56, 0x0006, 0x0006), -+ UPDATE_COEF(0x66, 0x0008, 0), -+ UPDATE_COEF(0x67, 0x2000, 0), -+ {} -+ }; - static struct coef_fw coef0292[] = { - WRITE_COEF(0x6b, 0xd429), - WRITE_COEF(0x76, 0x0008), -@@ -3754,6 +3801,12 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) - case 0x10ec0283: - alc_process_coef_fw(codec, coef0233); - break; -+ case 0x10ec0286: -+ case 0x10ec0288: -+ alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); -+ msleep(300); -+ alc_process_coef_fw(codec, coef0288); -+ break; - case 0x10ec0292: - alc_process_coef_fw(codec, coef0292); - break; -@@ -3782,6 +3835,13 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) - WRITE_COEF(0x32, 0x4ea3), - {} - }; -+ static struct coef_fw coef0288[] = { -+ UPDATE_COEF(0x50, 0x2000, 0x2000), -+ UPDATE_COEF(0x56, 0x0006, 0x0006), -+ UPDATE_COEF(0x66, 0x0008, 0), -+ UPDATE_COEF(0x67, 0x2000, 0), -+ {} -+ }; - static struct coef_fw coef0292[] = { - WRITE_COEF(0x6b, 0xe429), - WRITE_COEF(0x76, 0x0008), -@@ -3809,6 +3869,12 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) - case 0x10ec0283: - alc_process_coef_fw(codec, coef0233); - break; -+ case 0x10ec0286: -+ case 0x10ec0288: -+ alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); -+ msleep(300); -+ alc_process_coef_fw(codec, coef0288); -+ break; - case 0x10ec0292: - alc_process_coef_fw(codec, coef0292); - break; -@@ -3833,6 +3899,10 @@ static void alc_determine_headset_type(struct hda_codec *codec) - conteol) */ - {} - }; -+ static struct coef_fw coef0288[] = { -+ UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ -+ {} -+ }; - static struct coef_fw coef0293[] = { - UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ - WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ -@@ -3861,6 +3931,13 @@ static void alc_determine_headset_type(struct hda_codec *codec) - val = alc_read_coef_idx(codec, 0x46); - is_ctia = (val & 0x0070) == 0x0070; - break; -+ case 0x10ec0286: -+ case 0x10ec0288: -+ alc_process_coef_fw(codec, coef0288); -+ msleep(350); -+ val = alc_read_coef_idx(codec, 0x50); -+ is_ctia = (val & 0x0070) == 0x0070; -+ break; - case 0x10ec0292: - alc_write_coef_idx(codec, 0x6b, 0xd429); - msleep(300); --- -cgit v0.10.2 - diff --git a/kernel/kernel/files/patches/mageia/sound-bluetooth-SCO-support.patch b/kernel/kernel/files/patches/mageia/sound-bluetooth-SCO-support.patch deleted file mode 100644 index 3fe7325a..00000000 --- a/kernel/kernel/files/patches/mageia/sound-bluetooth-SCO-support.patch +++ /dev/null @@ -1,1296 +0,0 @@ -Subject: Support a Bluetooth SCO. - -This patch is need of supporting it with an SCO(Synchronous -Connection Oriented links) device. -The SCO of Bluetooth sound device. - -This patch has to change configuration of kernel. - -Signed-off-by: Go Taniguchi - ---- - sound/drivers/Kconfig | 6 - sound/drivers/Makefile | 1 - sound/drivers/btsco.c | 1252 +++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 1259 insertions(+) - ---- a/sound/drivers/Kconfig -+++ b/sound/drivers/Kconfig -@@ -113,6 +113,12 @@ config SND_MTS64 - To compile this driver as a module, chose 'M' here: the module - will be called snd-mts64. - -+config SND_BT_SCO -+ tristate "bluetooth SCO audio support" -+ select SND_HWDEP -+ help -+ Say 'Y' or 'M' to include support for bluetooth SCO audio support -+ - config SND_SERIAL_U16550 - tristate "UART16550 serial MIDI driver" - select SND_RAWMIDI ---- a/sound/drivers/Makefile -+++ b/sound/drivers/Makefile -@@ -7,6 +7,7 @@ snd-dummy-objs := dummy.o - snd-aloop-objs := aloop.o - snd-mtpav-objs := mtpav.o - snd-mts64-objs := mts64.o -+snd-bt-sco-objs := btsco.o - snd-portman2x4-objs := portman2x4.o - snd-serial-u16550-objs := serial-u16550.o - snd-virmidi-objs := virmidi.o ---- /dev/null -+++ b/sound/drivers/btsco.c -@@ -0,0 +1,1252 @@ -+/* -+ * Bluetooth SCO soundcard -+ * Copyright (c) 2003, 2004 by Jonathan Paisley -+ * -+ * Based on dummy.c which is -+ * Copyright (c) by Jaroslav Kysela -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ * -+ */ -+ -+ -+/* note: defining these two independently is not tested, -+ * thus not recommended -+ */ -+ -+/* enable dynamic compression */ -+#define DYNAMIC_COMPRESSION -+/* enable automatic endianness fixup */ -+#define AUTO_FIXUP_BYTESHIFT -+ -+ -+#ifdef DYNAMIC_COMPRESSION -+/* Autoadjust mic at most this often in 1/8000s */ -+#define GRABSAMPLES 400 -+/* Maximum push for the mike 16= 1:1 - default 20:1 = 320 */ -+#define COMPRESSION_MAX_16 320 -+/* Minimum push for the mike 1= 1:16 */ -+#define COMPRESSION_MIN_16 1 -+#endif -+ -+#define chip_t snd_card_bt_sco_t -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#define SNDRV_GET_ID -+#include -+ -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) -+#include -+#else -+#define mutex semaphore -+#define mutex_init init_MUTEX -+#define mutex_lock down -+#define mutex_unlock up -+#endif -+ -+#ifndef SNDRV_HWDEP_IFACE_BLUETOOTH -+#define SNDRV_HWDEP_IFACE_BLUETOOTH (SNDRV_HWDEP_IFACE_EMUX_WAVETABLE + 1) -+#endif -+ -+#ifndef SNDRV_HWDEP_IFACE_BT_SCO -+#define SNDRV_HWDEP_IFACE_BT_SCO (SNDRV_HWDEP_IFACE_BLUETOOTH + 1) -+#endif -+ -+#define SNDRV_BT_SCO_IOCTL_SET_SCO_SOCKET _IOW ('H', 0x10, int) -+#define SNDRV_BT_SCO_IOCTL_REQ_INFO _IO ('H', 0x11) -+ -+MODULE_AUTHOR("Jonathan Paisley "); -+MODULE_DESCRIPTION("Bluetooth SCO Headset Soundcard"); -+MODULE_LICENSE("GPL"); -+MODULE_SUPPORTED_DEVICE("{{ALSA,Bluetooth SCO Soundcard}}"); -+ -+static char *mod_revision = "$Revision: 1.13 $"; -+ -+static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ -+ -+module_param_array(index, int, NULL, 0444); -+MODULE_PARM_DESC(index, "Index value for Bluetooth SCO Headset Soundcard."); -+ -+#undef dprintk -+#if 1 -+#define dprintk(fmt...) printk(KERN_INFO "snd-bt-sco: " fmt) -+#else -+#define dprintk(fmt...) do {} while(0) -+#endif -+ -+#define MAX_BUFFER_SIZE (32*1024) -+ -+#define MIXER_ADDR_MASTER 0 -+#define MIXER_ADDR_MIC 1 -+#define MIXER_ADDR_LAST 1 -+ -+#define MIXER_MASK_MASTER 1 -+#define MIXER_MASK_MIC 2 -+ -+#define MIXER_MIN_VOLUME 1 -+#define MIXER_MAX_VOLUME 15 -+ -+struct snd_card_bt_sco_pcm; -+ -+typedef struct snd_card_bt_sco_info { -+ int mixer_volume[MIXER_ADDR_LAST + 1]; -+ int playback_count, capture_count; -+} snd_card_bt_sco_info_t; -+ -+typedef struct snd_card_bt_sco { -+ snd_card_t *card; -+ spinlock_t mixer_lock; -+ int mixer_volume[MIXER_ADDR_LAST + 1]; -+#ifdef DYNAMIC_COMPRESSION -+ snd_kcontrol_t *mixer_controls[MIXER_ADDR_LAST + 2 + 1]; /* also loopback and agc */ -+#else -+ snd_kcontrol_t *mixer_controls[MIXER_ADDR_LAST + 2 ]; /* also loopback */ -+#endif -+ volatile int loopback; -+#ifdef DYNAMIC_COMPRESSION -+ volatile int agc; -+#endif -+ atomic_t playback_count, capture_count; -+ volatile int count_changed; -+ spinlock_t count_changed_lock; -+ -+ spinlock_t mixer_changed_lock; -+ volatile int mixer_changed; -+ wait_queue_head_t hwdep_wait; -+ -+ int thread_pid; -+ struct completion thread_done; -+ -+ volatile int thread_exit; -+ struct mutex thread_sem; -+ -+ volatile struct socket *sco_sock; -+ struct mutex sock_sem; -+ wait_queue_head_t wait; -+ -+ struct mutex playback_sem; -+ struct snd_card_bt_sco_pcm *playback; -+ struct mutex capture_sem; -+ struct snd_card_bt_sco_pcm *capture; -+} snd_card_bt_sco_t; -+ -+typedef struct snd_card_bt_sco_pcm { -+ snd_card_bt_sco_t *bt_sco; -+ spinlock_t lock; -+ unsigned int pcm_size; -+ unsigned int pcm_count; -+ unsigned int pcm_bps; /* bytes per second */ -+ unsigned int pcm_irq_pos; /* IRQ position */ -+ unsigned int pcm_buf_pos; /* position in buffer */ -+ snd_pcm_substream_t *substream; -+} snd_card_bt_sco_pcm_t; -+ -+static snd_card_t *snd_bt_sco_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; -+ -+static int snd_card_bt_sco_playback_trigger(snd_pcm_substream_t * -+ substream, int cmd) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm = runtime->private_data; -+ snd_card_bt_sco_t *bt_sco = snd_pcm_substream_chip(substream); -+ -+ dprintk("playback_trigger %d\n", cmd); -+ -+ if (cmd == SNDRV_PCM_TRIGGER_START) { -+ bt_sco->playback = bspcm; -+ dprintk("setting playback to bspcm\n"); -+ } else if (cmd == SNDRV_PCM_TRIGGER_STOP) { -+ bt_sco->playback = NULL; -+ dprintk("setting playback to NULL\n"); -+ } else { -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+static int snd_card_bt_sco_capture_trigger(snd_pcm_substream_t * -+ substream, int cmd) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm = runtime->private_data; -+ snd_card_bt_sco_t *bt_sco = snd_pcm_substream_chip(substream); -+ -+ dprintk("capture_trigger %d\n", cmd); -+ -+ if (cmd == SNDRV_PCM_TRIGGER_START) { -+ bt_sco->capture = bspcm; -+ dprintk("setting capture to bspcm\n"); -+ } else if (cmd == SNDRV_PCM_TRIGGER_STOP) { -+ bt_sco->capture = NULL; -+ dprintk("setting capture to NULL\n"); -+ } else { -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+static int snd_card_bt_sco_pcm_prepare(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm = runtime->private_data; -+ unsigned int bps; -+ -+ bps = runtime->rate * runtime->channels; -+ bps *= snd_pcm_format_width(runtime->format); -+ bps /= 8; -+ if (bps <= 0) -+ return -EINVAL; -+ bspcm->pcm_bps = bps; -+ bspcm->pcm_size = snd_pcm_lib_buffer_bytes(substream); -+ bspcm->pcm_count = snd_pcm_lib_period_bytes(substream); -+ bspcm->pcm_irq_pos = 0; -+ bspcm->pcm_buf_pos = 0; -+ dprintk("prepare ok bps: %d size: %d count: %d\n", -+ bspcm->pcm_bps, bspcm->pcm_size, bspcm->pcm_count); -+ return 0; -+} -+ -+static int snd_card_bt_sco_playback_prepare(snd_pcm_substream_t * substream) -+{ -+ return snd_card_bt_sco_pcm_prepare(substream); -+} -+ -+static int snd_card_bt_sco_capture_prepare(snd_pcm_substream_t * substream) -+{ -+ dprintk("capture_prepare\n"); -+ return snd_card_bt_sco_pcm_prepare(substream); -+} -+ -+static void snd_card_bt_sco_pcm_receive(snd_card_bt_sco_pcm_t * bspcm, -+ unsigned char *data, unsigned int len) -+{ -+ unsigned long flags; -+ unsigned int oldptr; -+ -+ spin_lock_irqsave(&bspcm->lock, flags); -+ oldptr = bspcm->pcm_buf_pos; -+ bspcm->pcm_irq_pos += len; -+ bspcm->pcm_buf_pos += len; -+ bspcm->pcm_buf_pos %= bspcm->pcm_size; -+ spin_unlock_irqrestore(&bspcm->lock, flags); -+ /* copy a data chunk */ -+ if (oldptr + len > bspcm->pcm_size) { -+ unsigned int cnt = bspcm->pcm_size - oldptr; -+ memcpy(bspcm->substream->runtime->dma_area + oldptr, data, cnt); -+ memcpy(bspcm->substream->runtime->dma_area, data + cnt, -+ len - cnt); -+ } else { -+ memcpy(bspcm->substream->runtime->dma_area + oldptr, data, len); -+ } -+ /* update the pointer, call callback if necessary */ -+ spin_lock_irqsave(&bspcm->lock, flags); -+ if (bspcm->pcm_irq_pos >= bspcm->pcm_count) { -+ bspcm->pcm_irq_pos %= bspcm->pcm_count; -+ spin_unlock_irqrestore(&bspcm->lock, flags); -+ snd_pcm_period_elapsed(bspcm->substream); -+ } else -+ spin_unlock_irqrestore(&bspcm->lock, flags); -+ -+} -+ -+static void snd_card_bt_sco_pcm_send(snd_card_bt_sco_pcm_t * bspcm, -+ unsigned char *data, unsigned int len) -+{ -+ unsigned long flags; -+ unsigned int oldptr; -+ -+ spin_lock_irqsave(&bspcm->lock, flags); -+ oldptr = bspcm->pcm_buf_pos; -+ bspcm->pcm_irq_pos += len; -+ bspcm->pcm_buf_pos += len; -+ bspcm->pcm_buf_pos %= bspcm->pcm_size; -+ spin_unlock_irqrestore(&bspcm->lock, flags); -+ /* copy a data chunk */ -+ if (oldptr + len > bspcm->pcm_size) { -+ unsigned int cnt = bspcm->pcm_size - oldptr; -+ memcpy(data, bspcm->substream->runtime->dma_area + oldptr, cnt); -+ memcpy(data + cnt, bspcm->substream->runtime->dma_area, -+ len - cnt); -+ } else { -+ memcpy(data, bspcm->substream->runtime->dma_area + oldptr, len); -+ } -+ /* update the pointer, call callback if necessary */ -+ spin_lock_irqsave(&bspcm->lock, flags); -+ if (bspcm->pcm_irq_pos >= bspcm->pcm_count) { -+ bspcm->pcm_irq_pos %= bspcm->pcm_count; -+ spin_unlock_irqrestore(&bspcm->lock, flags); -+ snd_pcm_period_elapsed(bspcm->substream); -+ } else -+ spin_unlock_irqrestore(&bspcm->lock, flags); -+} -+ -+static snd_pcm_uframes_t -+snd_card_bt_sco_playback_pointer(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm = runtime->private_data; -+ -+ return bytes_to_frames(runtime, bspcm->pcm_buf_pos); -+} -+ -+static snd_pcm_uframes_t -+snd_card_bt_sco_capture_pointer(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm = runtime->private_data; -+ -+ return bytes_to_frames(runtime, bspcm->pcm_buf_pos); -+} -+ -+static snd_pcm_hardware_t snd_card_bt_sco_playback = { -+ .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | -+ SNDRV_PCM_INFO_MMAP_VALID), -+ .formats = SNDRV_PCM_FMTBIT_S16_LE, -+ .rates = SNDRV_PCM_RATE_8000, -+ .rate_min = 8000, -+ .rate_max = 8000, -+ .channels_min = 1, -+ .channels_max = 1, -+ .buffer_bytes_max = MAX_BUFFER_SIZE, -+ .period_bytes_min = 24, -+ .period_bytes_max = MAX_BUFFER_SIZE, -+ .periods_min = 1, -+ .periods_max = 4 * 8000 / 24, -+ .fifo_size = 0, -+}; -+ -+static snd_pcm_hardware_t snd_card_bt_sco_capture = { -+ .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | -+ SNDRV_PCM_INFO_MMAP_VALID), -+ .formats = SNDRV_PCM_FMTBIT_S16_LE, -+ .rates = SNDRV_PCM_RATE_8000, -+ .rate_min = 8000, -+ .rate_max = 8000, -+ .channels_min = 1, -+ .channels_max = 1, -+ .buffer_bytes_max = MAX_BUFFER_SIZE, -+ .period_bytes_min = 24, -+ .period_bytes_max = MAX_BUFFER_SIZE, -+ .periods_min = 1, -+ .periods_max = 4 * 8000 / 24, -+ .fifo_size = 0, -+}; -+ -+static void snd_card_bt_sco_runtime_free(snd_pcm_runtime_t * runtime) -+{ -+ snd_card_bt_sco_pcm_t *bspcm = runtime->private_data; -+ kfree(bspcm); -+} -+ -+static int snd_card_bt_sco_playback_open(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm; -+ snd_card_bt_sco_t *bt_sco = snd_pcm_substream_chip(substream); -+ -+ dprintk("playback_open\n"); -+ -+ bspcm = kmalloc(sizeof(*bspcm), GFP_KERNEL); -+ if (bspcm == NULL) -+ return -ENOMEM; -+ memset(bspcm, 0, sizeof(*bspcm)); -+ if ((runtime->dma_area = -+ snd_malloc_pages(MAX_BUFFER_SIZE, GFP_KERNEL)) == NULL) { -+ kfree(bspcm); -+ return -ENOMEM; -+ } -+ runtime->dma_bytes = MAX_BUFFER_SIZE; -+ spin_lock_init(&bspcm->lock); -+ bspcm->substream = substream; -+ runtime->private_data = bspcm; -+ runtime->private_free = snd_card_bt_sco_runtime_free; -+ runtime->hw = snd_card_bt_sco_playback; -+ -+ atomic_inc(&bt_sco->playback_count); -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ bt_sco->count_changed = 1; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ wake_up(&bt_sco->hwdep_wait); -+ -+ return 0; -+} -+ -+static int snd_card_bt_sco_capture_open(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_pcm_t *bspcm; -+ snd_card_bt_sco_t *bt_sco = snd_pcm_substream_chip(substream); -+ -+ dprintk("capture_open\n"); -+ -+ bspcm = kmalloc(sizeof(*bspcm), GFP_KERNEL); -+ if (bspcm == NULL) -+ return -ENOMEM; -+ memset(bspcm, 0, sizeof(*bspcm)); -+ if ((runtime->dma_area = -+ snd_malloc_pages(MAX_BUFFER_SIZE, GFP_KERNEL)) == NULL) { -+ kfree(bspcm); -+ return -ENOMEM; -+ } -+ runtime->dma_bytes = MAX_BUFFER_SIZE; -+ memset(runtime->dma_area, 0, runtime->dma_bytes); -+ spin_lock_init(&bspcm->lock); -+ bspcm->substream = substream; -+ runtime->private_data = bspcm; -+ runtime->private_free = snd_card_bt_sco_runtime_free; -+ runtime->hw = snd_card_bt_sco_capture; -+ -+ atomic_inc(&bt_sco->capture_count); -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ bt_sco->count_changed = 1; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ wake_up(&bt_sco->hwdep_wait); -+ -+ return 0; -+} -+ -+static int snd_card_bt_sco_playback_close(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ snd_card_bt_sco_t *bt_sco = snd_pcm_substream_chip(substream); -+ -+ snd_assert(bt_sco->playback == NULL,; -+ ); -+ -+ /* Ensure any references to this in our thread have finished */ -+ mutex_lock(&bt_sco->playback_sem); -+ mutex_unlock(&bt_sco->playback_sem); -+ -+ atomic_dec(&bt_sco->playback_count); -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ bt_sco->count_changed = 1; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ wake_up(&bt_sco->hwdep_wait); -+ -+ snd_free_pages(runtime->dma_area, runtime->dma_bytes); -+ return 0; -+} -+ -+static int snd_card_bt_sco_capture_close(snd_pcm_substream_t * substream) -+{ -+ snd_pcm_runtime_t *runtime = substream->runtime; -+ struct snd_card_bt_sco *bt_sco = -+ (struct snd_card_bt_sco *)substream->private_data; -+ -+ snd_assert(bt_sco->capture == NULL,; -+ ); -+ -+ /* Ensure any references to this in our thread have finished */ -+ mutex_lock(&bt_sco->capture_sem); -+ mutex_unlock(&bt_sco->capture_sem); -+ -+ atomic_dec(&bt_sco->capture_count); -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ bt_sco->count_changed = 1; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ wake_up(&bt_sco->hwdep_wait); -+ -+ snd_free_pages(runtime->dma_area, runtime->dma_bytes); -+ return 0; -+} -+ -+static snd_pcm_ops_t snd_card_bt_sco_playback_ops = { -+ .open = snd_card_bt_sco_playback_open, -+ .close = snd_card_bt_sco_playback_close, -+ .ioctl = snd_pcm_lib_ioctl, -+ .prepare = snd_card_bt_sco_playback_prepare, -+ .trigger = snd_card_bt_sco_playback_trigger, -+ .pointer = snd_card_bt_sco_playback_pointer, -+}; -+ -+static snd_pcm_ops_t snd_card_bt_sco_capture_ops = { -+ .open = snd_card_bt_sco_capture_open, -+ .close = snd_card_bt_sco_capture_close, -+ .ioctl = snd_pcm_lib_ioctl, -+ .prepare = snd_card_bt_sco_capture_prepare, -+ .trigger = snd_card_bt_sco_capture_trigger, -+ .pointer = snd_card_bt_sco_capture_pointer, -+}; -+ -+static int __init snd_card_bt_sco_pcm(snd_card_bt_sco_t * bt_sco) -+{ -+ snd_pcm_t *pcm; -+ int err; -+ -+ if ((err = -+ snd_pcm_new(bt_sco->card, "Bluetooth SCO PCM", 0, 1, 1, &pcm)) < 0) -+ return err; -+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, -+ &snd_card_bt_sco_playback_ops); -+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, -+ &snd_card_bt_sco_capture_ops); -+ pcm->private_data = bt_sco; -+ pcm->info_flags = 0; -+ strcpy(pcm->name, "BT SCO PCM"); -+ return 0; -+} -+ -+#define BT_SCO_VOLUME(xname, xindex, addr) \ -+{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ -+ .info = snd_bt_sco_volume_info, \ -+ .get = snd_bt_sco_volume_get, .put = snd_bt_sco_volume_put, \ -+ .private_value = addr } -+ -+static int snd_bt_sco_volume_info(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_info_t * uinfo) -+{ -+ uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; -+ uinfo->count = 1; -+ uinfo->value.integer.min = MIXER_MIN_VOLUME; -+ uinfo->value.integer.max = MIXER_MAX_VOLUME; -+ return 0; -+} -+ -+static int snd_bt_sco_volume_get(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_value_t * ucontrol) -+{ -+ snd_card_bt_sco_t *bt_sco = snd_kcontrol_chip(kcontrol); -+ unsigned long flags; -+ int addr = kcontrol->private_value; -+ -+ spin_lock_irqsave(&bt_sco->mixer_lock, flags); -+ ucontrol->value.integer.value[0] = bt_sco->mixer_volume[addr]; -+ spin_unlock_irqrestore(&bt_sco->mixer_lock, flags); -+ return 0; -+} -+ -+static int snd_bt_sco_volume_put(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_value_t * ucontrol) -+{ -+ snd_card_bt_sco_t *bt_sco = snd_kcontrol_chip(kcontrol); -+ unsigned long flags; -+ int changed, addr = kcontrol->private_value; -+ int vol; -+ -+ vol = ucontrol->value.integer.value[0]; -+ if (vol < MIXER_MIN_VOLUME) -+ vol = MIXER_MIN_VOLUME; -+ if (vol > MIXER_MAX_VOLUME) -+ vol = MIXER_MAX_VOLUME; -+ spin_lock_irqsave(&bt_sco->mixer_lock, flags); -+ changed = bt_sco->mixer_volume[addr] != vol; -+ bt_sco->mixer_volume[addr] = vol; -+ spin_unlock_irqrestore(&bt_sco->mixer_lock, flags); -+ if (changed) { -+ spin_lock_irqsave(&bt_sco->mixer_changed_lock, flags); -+ bt_sco->mixer_changed = 1; -+ spin_unlock_irqrestore(&bt_sco->mixer_changed_lock, flags); -+ wake_up(&bt_sco->hwdep_wait); -+ } -+ return changed; -+} -+ -+static int snd_bt_sco_boolean_info(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_info_t * uinfo) -+{ -+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; -+ uinfo->count = 1; -+ uinfo->value.integer.min = 0; -+ uinfo->value.integer.max = 1; -+ return 0; -+} -+ -+static int snd_bt_sco_loopback_get(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_value_t * ucontrol) -+{ -+ snd_card_bt_sco_t *bt_sco = snd_kcontrol_chip(kcontrol); -+ unsigned long flags; -+ -+ spin_lock_irqsave(&bt_sco->mixer_lock, flags); -+ ucontrol->value.integer.value[0] = bt_sco->loopback; -+ spin_unlock_irqrestore(&bt_sco->mixer_lock, flags); -+ return 0; -+} -+ -+static int snd_bt_sco_loopback_put(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_value_t * ucontrol) -+{ -+ snd_card_bt_sco_t *bt_sco = snd_kcontrol_chip(kcontrol); -+ unsigned long flags; -+ int changed; -+ int loopback; -+ -+ loopback = !!ucontrol->value.integer.value[0]; -+ -+ spin_lock_irqsave(&bt_sco->mixer_lock, flags); -+ changed = bt_sco->loopback != loopback; -+ bt_sco->loopback = loopback; -+ spin_unlock_irqrestore(&bt_sco->mixer_lock, flags); -+ return changed; -+} -+ -+#ifdef DYNAMIC_COMPRESSION -+static int snd_bt_sco_agc_get(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_value_t * ucontrol) -+{ -+ snd_card_bt_sco_t *bt_sco = snd_kcontrol_chip(kcontrol); -+ unsigned long flags; -+ -+ spin_lock_irqsave(&bt_sco->mixer_lock, flags); -+ ucontrol->value.integer.value[0] = bt_sco->agc; -+ spin_unlock_irqrestore(&bt_sco->mixer_lock, flags); -+ return 0; -+} -+ -+static int snd_bt_sco_agc_put(snd_kcontrol_t * kcontrol, -+ snd_ctl_elem_value_t * ucontrol) -+{ -+ snd_card_bt_sco_t *bt_sco = snd_kcontrol_chip(kcontrol); -+ unsigned long flags; -+ int changed; -+ int agc; -+ -+ agc = !!ucontrol->value.integer.value[0]; -+ -+ spin_lock_irqsave(&bt_sco->mixer_lock, flags); -+ changed = bt_sco->agc != agc; -+ bt_sco->agc = agc; -+ spin_unlock_irqrestore(&bt_sco->mixer_lock, flags); -+ return changed; -+} -+#endif -+ -+#define BT_SCO_CONTROLS (sizeof(snd_bt_sco_controls)/sizeof(snd_kcontrol_new_t)) -+ -+static snd_kcontrol_new_t snd_bt_sco_controls[] = { -+ BT_SCO_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER), -+ BT_SCO_VOLUME("Mic Volume", 0, MIXER_ADDR_MIC), -+ {.iface = SNDRV_CTL_ELEM_IFACE_MIXER, -+ .name = "Loopback Switch", -+ .index = 0, -+ .info = snd_bt_sco_boolean_info, -+ .get = snd_bt_sco_loopback_get, -+ .put = snd_bt_sco_loopback_put, -+ } -+#ifdef DYNAMIC_COMPRESSION -+ , -+ {.iface = SNDRV_CTL_ELEM_IFACE_MIXER, -+ .name = "AGC Switch", -+ .index = 0, -+ .info = snd_bt_sco_boolean_info, -+ .get = snd_bt_sco_agc_get, -+ .put = snd_bt_sco_agc_put, -+ } -+#endif -+}; -+ -+int __init snd_card_bt_sco_new_mixer(snd_card_bt_sco_t * bt_sco) -+{ -+ snd_card_t *card = bt_sco->card; -+ -+ unsigned int idx; -+ int err; -+ -+ snd_assert(bt_sco != NULL, return -EINVAL); -+ spin_lock_init(&bt_sco->mixer_lock); -+ strcpy(card->mixername, "BT Headset Mixer"); -+ -+ for (idx = 0; idx < BT_SCO_CONTROLS; idx++) { -+ bt_sco->mixer_controls[idx] = -+ snd_ctl_new1(&snd_bt_sco_controls[idx], bt_sco); -+ -+ if ((err = snd_ctl_add(card, bt_sco->mixer_controls[idx])) < 0) -+ return err; -+ } -+ return 0; -+} -+ -+static int snd_card_bt_open(snd_hwdep_t * hw, struct file *file) -+{ -+ return 0; -+} -+ -+static int snd_card_bt_release(snd_hwdep_t * hw, struct file *file) -+{ -+ return 0; -+} -+ -+static int snd_card_bt_ioctl(snd_hwdep_t * hw, struct file *file, -+ unsigned int cmd, unsigned long arg) -+{ -+ snd_card_bt_sco_t *bt_sco = hw->card->private_data; -+ struct socket *sock; -+ int err = -ENOTTY; -+ int fd = arg; -+ -+ switch (cmd) { -+ case SNDRV_BT_SCO_IOCTL_SET_SCO_SOCKET: -+ err = 0; -+ /* Interrupt any socket operations, so that we may -+ * change the socket */ -+ mutex_lock(&bt_sco->sock_sem); -+ kill_proc(bt_sco->thread_pid, SIGINT, 1); -+ if (bt_sco->sco_sock) { -+ dprintk("Disposing of previous socket count %d\n", -+ file_count(bt_sco->sco_sock->file)); -+ /* Extra brackets needed here since sockfd_put is a poorly implemented macro */ -+ sockfd_put(((struct socket *)bt_sco->sco_sock)); -+ -+ bt_sco->sco_sock = NULL; -+ } -+ -+ if (fd >= 0) { -+ err = -EINVAL; -+ sock = sockfd_lookup(fd, &err); -+ if (sock) { -+ if (sock->sk->sk_family == PF_BLUETOOTH && -+ sock->sk->sk_protocol == BTPROTO_SCO) { -+ bt_sco->sco_sock = sock; -+ wake_up(&bt_sco->wait); -+ err = 0; -+ } else { -+ dprintk -+ ("Not a bluetooth SCO socket %d:%d\n", -+ sock->sk->sk_family, -+ sock->sk->sk_protocol); -+ sockfd_put(sock); -+ } -+ } -+ } -+ mutex_unlock(&bt_sco->sock_sem); -+ break; -+ case SNDRV_BT_SCO_IOCTL_REQ_INFO: -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ bt_sco->count_changed = 1; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ wake_up(&bt_sco->hwdep_wait); -+ break; -+ } -+ return err; -+} -+ -+static long snd_card_bt_write(snd_hwdep_t * hw, const char *buf, long count, -+ loff_t * offset) -+{ -+ snd_card_bt_sco_t *bt_sco = hw->card->private_data; -+ int mixer_volume[MIXER_ADDR_LAST + 1]; -+ int retval; -+ int i; -+ -+ if (count != sizeof(mixer_volume)) -+ return -EINVAL; -+ -+ if (copy_from_user(mixer_volume, buf, sizeof(mixer_volume))) -+ return -EFAULT; -+ -+ retval = sizeof(mixer_volume); -+ -+ spin_lock_irq(&bt_sco->mixer_lock); -+ for (i = 0; i <= MIXER_ADDR_LAST; i++) { -+ int vol = mixer_volume[i]; -+ if (vol > MIXER_MAX_VOLUME) -+ vol = MIXER_MAX_VOLUME; -+ if (vol < MIXER_MIN_VOLUME) -+ vol = MIXER_MIN_VOLUME; -+ if (bt_sco->mixer_volume[i] != vol) { -+ bt_sco->mixer_volume[i] = vol; -+ snd_ctl_notify(bt_sco->card, -+ SNDRV_CTL_EVENT_MASK_VALUE, -+ &bt_sco->mixer_controls[i]->id); -+ } -+ } -+ spin_unlock_irq(&bt_sco->mixer_lock); -+ -+ return retval; -+} -+ -+static long snd_card_bt_read(snd_hwdep_t * hw, char *buf, long count, -+ loff_t * offset) -+{ -+ snd_card_bt_sco_t *bt_sco = hw->card->private_data; -+ DECLARE_WAITQUEUE(wait, current); -+ ssize_t retval; -+ int changed; -+ snd_card_bt_sco_info_t infobuf; -+ -+ if (count < sizeof(bt_sco->mixer_volume)) -+ return -EINVAL; -+ -+ add_wait_queue(&bt_sco->hwdep_wait, &wait); -+ current->state = TASK_INTERRUPTIBLE; -+ do { -+ changed = 0; -+ spin_lock_irq(&bt_sco->mixer_changed_lock); -+ if(bt_sco->mixer_changed) -+ changed = 1; -+ bt_sco->mixer_changed = 0; -+ spin_unlock_irq(&bt_sco->mixer_changed_lock); -+ -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ if(bt_sco->count_changed) -+ changed = 1; -+ bt_sco->count_changed = 0; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ -+ if (changed != 0) -+ break; -+ -+ if (signal_pending(current)) { -+ retval = -ERESTARTSYS; -+ goto out; -+ } -+ schedule(); -+ } while (1); -+ -+ memcpy(infobuf.mixer_volume, bt_sco->mixer_volume, sizeof(infobuf.mixer_volume)); -+ infobuf.playback_count = atomic_read(&bt_sco->playback_count); -+ infobuf.capture_count = atomic_read(&bt_sco->capture_count); -+ -+ if (copy_to_user -+ (buf, &infobuf, sizeof(infobuf))) -+ retval = -EFAULT; -+ else -+ retval = sizeof(infobuf); -+ -+ out: -+ current->state = TASK_RUNNING; -+ remove_wait_queue(&bt_sco->hwdep_wait, &wait); -+ return retval; -+} -+ -+static unsigned int snd_card_bt_poll(snd_hwdep_t * hw, -+ struct file *file, poll_table * wait) -+{ -+ snd_card_bt_sco_t *bt_sco = hw->card->private_data; -+ int ret; -+ -+ poll_wait(file, &bt_sco->hwdep_wait, wait); -+ -+ ret = 0; -+ spin_lock_irq(&bt_sco->mixer_changed_lock); -+ if(bt_sco->mixer_changed) -+ ret |= POLLIN | POLLRDNORM; -+ spin_unlock_irq(&bt_sco->mixer_changed_lock); -+ -+ spin_lock_irq(&bt_sco->count_changed_lock); -+ if(bt_sco->count_changed) -+ ret |= POLLIN | POLLRDNORM; -+ spin_unlock_irq(&bt_sco->count_changed_lock); -+ -+ return ret; -+} -+ -+static int snd_card_bt_sco_thread(void *data) -+{ -+ snd_card_t *card = (snd_card_t *) data; -+ snd_card_bt_sco_t *bt_sco = card->private_data; -+ struct socket *sock; -+ int len; -+#define BUF_SIZE 256 -+ unsigned char buf[BUF_SIZE]; -+ struct msghdr msg; -+ struct iovec iov; -+ sigset_t unblocked; -+#if defined(DYNAMIC_COMPRESSION) || defined(AUTO_FIXUP_BYTESHIFT) -+ int i; -+#endif -+#ifdef DYNAMIC_COMPRESSION -+ static int factor=16; -+ static int maxvalsmoothed=0; -+ static int maxvalgrablen=GRABSAMPLES; /* adjust volume at most 4 times/second */ -+#endif -+#ifdef AUTO_FIXUP_BYTESHIFT -+ static int shift=0; -+ static unsigned char lastbyte; -+#endif -+ -+ lock_kernel(); -+ -+ daemonize("snd-bt-scod"); -+ sigemptyset(&unblocked); -+ sigaddset(&unblocked, SIGINT); -+ sigaddset(&unblocked, SIGTERM); -+ sigprocmask(SIG_UNBLOCK, &unblocked, NULL); -+ -+ /* Pretend so that copy_to_user and friends work */ -+ set_fs(KERNEL_DS); -+ -+ dprintk("snd-bt-scod thread starting\n"); -+ mutex_unlock(&bt_sco->thread_sem); -+ -+ do { -+ -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)) -+ try_to_freeze(); -+#else -+ if (current->flags & PF_FREEZE) -+ refrigerator(PF_FREEZE); -+#endif -+ -+ if (signal_pending(current)) -+ flush_signals(current); -+ -+ /* This may be woken up by a wake_up() when -+ * a new socket is installed, or by a signal. -+ * Signals are sent to terminate the thread, -+ * in which case thread_exit is set, and to force -+ * recvmesg() to wake up (from the ioctl handler) -+ */ -+ wait_event_interruptible(bt_sco->wait, bt_sco->sco_sock != 0); -+ if (bt_sco->thread_exit) -+ break; -+ -+ mutex_lock(&bt_sco->sock_sem); -+ sock = (struct socket *)bt_sco->sco_sock; -+ if (sock) -+ get_file(sock->file); -+ mutex_unlock(&bt_sco->sock_sem); -+ -+ if (!sock) -+ continue; -+ -+ /* We have a socket, let's read from it and write to it... */ -+ -+ memset(&msg, 0, sizeof(msg)); -+ msg.msg_iov = &iov; -+ iov.iov_base = buf; -+ iov.iov_len = BUF_SIZE; -+ -+ /* This will block until we receive data or a signal */ -+ len = sock_recvmsg(sock, &msg, BUF_SIZE, 0); -+ if (len > 0) { -+ -+#if defined (AUTO_FIXUP_BYTESHIFT) || defined (DYNAMIC_COMPRESSION) -+ -+#ifdef AUTO_FIXUP_BYTESHIFT -+ int lostatcnt=0; -+#endif -+ if (len&1) dprintk("odd len %d\n",len); -+#ifdef AUTO_FIXUP_BYTESHIFT -+ if (shift) { -+ unsigned char newlastbyte; -+ newlastbyte=buf[len-1]; -+ memmove(buf+1,buf,len-1); -+ buf[0]=lastbyte; -+ lastbyte=newlastbyte; -+ } -+#endif -+ for(i=0;i0x7fff) { -+ k=0x7fff; -+ if (bt_sco->agc&&factor>COMPRESSION_MIN_16) factor--; -+ } else if (k<-0x8000) { -+ k=0x8000; -+ if (bt_sco->agc&&factor>COMPRESSION_MIN_16) factor--; -+ } -+ buf[i+1]=(k>>8)&0xff; -+ buf[i ]=k&0xff; -+ -+ /* find the highest absolute value in a -+ * GRABSAMPLES long interval. -+ */ -+ if (k<0) k=-j; -+ if (k>maxvalsmoothed) maxvalsmoothed=k; -+ /* if the interval is over, recalculate -+ * the compression factor. Move it slowly. -+ */ -+ if (maxvalgrablen--<=0) { -+ maxvalgrablen=GRABSAMPLES; -+ /* If the noise goes up over 1000, we stop -+ * pushing the software gain -+ */ -+ if (maxvalsmoothed<1000&&factoragc) factor=16; -+ maxvalsmoothed=0; -+ } -+#endif -+ } -+#ifdef AUTO_FIXUP_BYTESHIFT -+ if (lostatcnt==len/2&&len>32) { -+ shift=!shift; -+ //dprintk("Shift problem detected! Fixing to %d.\n",shift); -+ } -+#endif -+#endif /* any of them */ -+ mutex_lock(&bt_sco->capture_sem); -+ if (bt_sco->capture) { -+ snd_card_bt_sco_pcm_receive -+ (bt_sco->capture, buf, len); -+ } -+ mutex_unlock(&bt_sco->capture_sem); -+ -+ mutex_lock(&bt_sco->playback_sem); -+ -+ if (bt_sco->playback || !bt_sco->loopback) { -+ memset(buf, 0, len); -+#if 0 -+ /* fill with tone instead of silence */ -+ int i; -+ -+ for (i = 0; i < len / 2; i++) { -+ buf[i] = 0; -+ } -+ for (i = len / 2; i < len; i++) { -+ buf[i] = 127; -+ } -+#endif -+ } -+ if (bt_sco->playback) { -+ int i, notzero = -1; -+ -+ snd_card_bt_sco_pcm_send -+ (bt_sco->playback, buf, len); -+ -+ /* Strangely, when the device is open but no audio is -+ being written by the app, there's an occasional glitch -+ in the silence data. This hack eliminates it. */ -+ -+ for (i = 0; i < len; i++) { -+ if (buf[i] != 0) { -+ if (notzero >= 0) -+ break; -+ notzero = i; -+ } -+ } -+ if (notzero >= 0 && i >= len) { -+ buf[notzero] = 0; -+ } -+ } -+ mutex_unlock(&bt_sco->playback_sem); -+ -+#if 0 -+ /* This chunk of code lets us record (using arecord) -+ what data alsa is sending out. -+ -+ e.g., when idle, we'd expect something like: -+ -+ 8080 8080 8080 8080 8483 8281 8182 8384 -+ 8080 8080 8080 8080 8080 8080 8080 8080 -+ 8080 8080 8080 8080 8483 8281 8182 8384 -+ 8080 8080 8080 8080 8080 8080 8080 8080 -+ -+ (this is from 'xxd' of a wav file, that data in -+ which is unsigned, whereas we are dealing with signed). -+ */ -+ -+ mutex_lock(&bt_sco->capture_sem); -+ if (bt_sco->capture) { -+ snd_card_bt_sco_pcm_receive -+ (bt_sco->capture, "\001\002\003\004", 4); -+ snd_card_bt_sco_pcm_receive -+ (bt_sco->capture, buf, len); -+ snd_card_bt_sco_pcm_receive -+ (bt_sco->capture, "\004\003\002\001", 4); -+ } -+ mutex_unlock(&bt_sco->capture_sem); -+#endif -+ msg.msg_flags = 0; -+ msg.msg_iov = &iov; -+ iov.iov_base = buf; -+ iov.iov_len = BUF_SIZE; -+ sock_sendmsg(sock, &msg, len); -+ } -+ -+ /* Expect this to be 3 because we (this thead) have a copy, -+ the driver process keeps one, and the app has the socket open. -+ */ -+ if (file_count(sock->file) != 3) { -+ dprintk("file_count is %d (expected 3)\n", -+ file_count(sock->file)); -+ } -+ fput(sock->file); -+ -+ schedule(); -+ } while (!bt_sco->thread_exit); -+ -+ dprintk("thread exiting\n"); -+ -+ unlock_kernel(); -+ complete_and_exit(&bt_sco->thread_done, 0); -+} -+ -+static void snd_card_bt_private_free(snd_card_t * card) -+{ -+ snd_card_bt_sco_t *bt_sco = card->private_data; -+ -+ dprintk("private_free, killing thread\n"); -+ bt_sco->thread_exit = 1; -+ kill_proc(bt_sco->thread_pid, SIGTERM, 1); -+ wait_for_completion(&bt_sco->thread_done); -+ dprintk("private_free, thread exited\n"); -+ -+ if (bt_sco->sco_sock) { -+ dprintk("shutdown: freeing socket count %d\n", -+ file_count(bt_sco->sco_sock->file)); -+ -+ sockfd_put(((struct socket *)bt_sco->sco_sock)); -+ } -+ -+ kfree(bt_sco); -+} -+ -+static int __init snd_card_bt_sco_probe(int dev) -+{ -+ snd_card_t *card; -+ snd_card_bt_sco_t *bt_sco; -+ int err; -+ snd_hwdep_t *hw; -+ -+ card = -+ snd_card_new(index[dev], SNDRV_DEFAULT_STR1, -+ THIS_MODULE, 0); -+ if (card == NULL) -+ return -ENOMEM; -+ -+ bt_sco = kmalloc(sizeof(*bt_sco), GFP_KERNEL); -+ if(bt_sco == NULL) -+ return -ENOMEM; -+ memset(bt_sco, 0, sizeof(*bt_sco)); -+ card->private_data = bt_sco; -+ card->private_free = snd_card_bt_private_free; -+ -+ bt_sco->card = card; -+ -+ init_completion(&bt_sco->thread_done); -+ mutex_init(&bt_sco->thread_sem); -+ mutex_lock(&bt_sco->thread_sem); -+ mutex_init(&bt_sco->sock_sem); -+ mutex_init(&bt_sco->capture_sem); -+ mutex_init(&bt_sco->playback_sem); -+ init_waitqueue_head(&bt_sco->wait); -+ init_waitqueue_head(&bt_sco->hwdep_wait); -+ spin_lock_init(&bt_sco->mixer_changed_lock); -+ spin_lock_init(&bt_sco->count_changed_lock); -+ -+ /* These clone flags copied from some other driver. -+ Not sure that they're really correct... */ -+ bt_sco->thread_pid = -+ kernel_thread(snd_card_bt_sco_thread, card, CLONE_KERNEL); -+ if (bt_sco->thread_pid < 0) { -+ err = bt_sco->thread_pid; -+ goto __nodev; -+ } -+ -+ mutex_lock(&bt_sco->thread_sem); -+ -+ if ((err = snd_card_bt_sco_pcm(bt_sco)) < 0) -+ goto __nodev; -+ if ((err = snd_card_bt_sco_new_mixer(bt_sco)) < 0) -+ goto __nodev; -+ strcpy(card->driver, "Bluetooth SCO"); -+ strcpy(card->shortname, "BT Headset"); -+ sprintf(card->longname, "BT Headset %i", dev + 1); -+ -+ err = snd_hwdep_new(card, "BTSCO", 0, &hw); -+ if (err < 0) -+ goto __nodev; -+ -+ sprintf(hw->name, "BTSCO"); -+ hw->iface = SNDRV_HWDEP_IFACE_BT_SCO; -+ hw->ops.open = snd_card_bt_open; -+ hw->ops.ioctl = snd_card_bt_ioctl; -+ hw->ops.release = snd_card_bt_release; -+ hw->ops.read = snd_card_bt_read; -+ hw->ops.write = snd_card_bt_write; -+ hw->ops.poll = snd_card_bt_poll; -+ -+ if ((err = snd_card_register(card)) == 0) { -+ snd_bt_sco_cards[dev] = card; -+ return 0; -+ } -+ __nodev: -+ snd_card_free(card); -+ return err; -+} -+ -+static int __init alsa_card_bt_sco_init(void) -+{ -+ printk(KERN_INFO "snd-bt-sco revision %s\n", mod_revision + 11); -+ -+ if (snd_card_bt_sco_probe(0) < 0) { -+#ifdef MODULE -+ printk(KERN_ERR -+ "Bluetooth SCO soundcard not found or device busy\n"); -+#endif -+ return -ENODEV; -+ } -+ return 0; -+} -+ -+static void __exit alsa_card_bt_sco_exit(void) -+{ -+ int idx; -+ -+ for (idx = 0; idx < SNDRV_CARDS; idx++) -+ snd_card_free(snd_bt_sco_cards[idx]); -+} -+ -+module_init(alsa_card_bt_sco_init) -+ module_exit(alsa_card_bt_sco_exit) -+#ifndef MODULE -+static int __init alsa_card_bt_sco_setup(char *str) -+{ -+ static unsigned __initdata nr_dev = 0; -+ -+ if (nr_dev >= SNDRV_CARDS) -+ return 0; -+ nr_dev++; -+ return 1; -+} -+ -+__setup("snd-bt-sco=", alsa_card_bt_sco_setup); -+ -+#endif /* ifndef MODULE */ diff --git a/kernel/kernel/files/patches/mageia/uas-add-us_fl_max_sectors_240-flag.patch b/kernel/kernel/files/patches/mageia/uas-add-us_fl_max_sectors_240-flag.patch deleted file mode 100644 index 0a4fc4a6..00000000 --- a/kernel/kernel/files/patches/mageia/uas-add-us_fl_max_sectors_240-flag.patch +++ /dev/null @@ -1,98 +0,0 @@ -From ee136af4a064c2f61e2025873584d2c7ec93f4ae Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 21 Apr 2015 11:20:31 +0200 -Subject: uas: Add US_FL_MAX_SECTORS_240 flag - -From: Hans de Goede - -commit ee136af4a064c2f61e2025873584d2c7ec93f4ae upstream. - -The usb-storage driver sets max_sectors = 240 in its scsi-host template, -for uas we do not want to do that for all devices, but testing has shown -that some devices need it. - -This commit adds a US_FL_MAX_SECTORS_240 flag for such devices, and -implements support for it in uas.c, while at it it also adds support -for US_FL_MAX_SECTORS_64 to uas.c. - -Signed-off-by: Hans de Goede -Acked-by: Alan Stern -Signed-off-by: Greg Kroah-Hartman - ---- - Documentation/kernel-parameters.txt | 2 ++ - drivers/usb/storage/uas.c | 10 +++++++++- - drivers/usb/storage/usb.c | 6 +++++- - include/linux/usb_usual.h | 2 ++ - 4 files changed, 18 insertions(+), 2 deletions(-) - ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -3746,6 +3746,8 @@ bytes respectively. Such letter suffixes - READ_CAPACITY_16 command); - f = NO_REPORT_OPCODES (don't use report opcodes - command, uas only); -+ g = MAX_SECTORS_240 (don't transfer more than -+ 240 sectors at a time, uas only); - h = CAPACITY_HEURISTICS (decrease the - reported device capacity by one - sector if the number is odd); ---- a/drivers/usb/storage/uas.c -+++ b/drivers/usb/storage/uas.c -@@ -759,7 +759,10 @@ static int uas_eh_bus_reset_handler(stru - - static int uas_slave_alloc(struct scsi_device *sdev) - { -- sdev->hostdata = (void *)sdev->host->hostdata; -+ struct uas_dev_info *devinfo = -+ (struct uas_dev_info *)sdev->host->hostdata; -+ -+ sdev->hostdata = devinfo; - - /* USB has unusual DMA-alignment requirements: Although the - * starting address of each scatter-gather element doesn't matter, -@@ -778,6 +781,11 @@ static int uas_slave_alloc(struct scsi_d - */ - blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); - -+ if (devinfo->flags & US_FL_MAX_SECTORS_64) -+ blk_queue_max_hw_sectors(sdev->request_queue, 64); -+ else if (devinfo->flags & US_FL_MAX_SECTORS_240) -+ blk_queue_max_hw_sectors(sdev->request_queue, 240); -+ - return 0; - } - ---- a/drivers/usb/storage/usb.c -+++ b/drivers/usb/storage/usb.c -@@ -479,7 +479,8 @@ void usb_stor_adjust_quirks(struct usb_d - US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT | - US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 | - US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE | -- US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES); -+ US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES | -+ US_FL_MAX_SECTORS_240); - - p = quirks; - while (*p) { -@@ -520,6 +521,9 @@ void usb_stor_adjust_quirks(struct usb_d - case 'f': - f |= US_FL_NO_REPORT_OPCODES; - break; -+ case 'g': -+ f |= US_FL_MAX_SECTORS_240; -+ break; - case 'h': - f |= US_FL_CAPACITY_HEURISTICS; - break; ---- a/include/linux/usb_usual.h -+++ b/include/linux/usb_usual.h -@@ -77,6 +77,8 @@ - /* Cannot handle ATA_12 or ATA_16 CDBs */ \ - US_FLAG(NO_REPORT_OPCODES, 0x04000000) \ - /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \ -+ US_FLAG(MAX_SECTORS_240, 0x08000000) \ -+ /* Sets max_sectors to 240 */ \ - - #define US_FLAG(name, value) US_FL_##name = value , - enum { US_DO_ALL_FLAGS }; diff --git a/kernel/kernel/files/patches/mageia/uas-allow-uas_use_uas_driver-to-return-usb-storage-flags.patch b/kernel/kernel/files/patches/mageia/uas-allow-uas_use_uas_driver-to-return-usb-storage-flags.patch deleted file mode 100644 index beb6a750..00000000 --- a/kernel/kernel/files/patches/mageia/uas-allow-uas_use_uas_driver-to-return-usb-storage-flags.patch +++ /dev/null @@ -1,79 +0,0 @@ -From a5011d44f0e1117a6db14b19b57c51f8be5673a0 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 21 Apr 2015 11:20:30 +0200 -Subject: uas: Allow uas_use_uas_driver to return usb-storage flags - -From: Hans de Goede - -commit a5011d44f0e1117a6db14b19b57c51f8be5673a0 upstream. - -uas_use_uas_driver may set some US_FL_foo flags during detection, currently -these are stored in a local variable and then throw away, but these may be -of interest to the caller, so add an extra parameter to (optionally) return -the detected flags, and use this in the uas driver. - -Signed-off-by: Hans de Goede -Acked-by: Alan Stern -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/usb/storage/uas-detect.h | 6 +++++- - drivers/usb/storage/uas.c | 6 +++--- - drivers/usb/storage/usb.c | 2 +- - 3 files changed, 9 insertions(+), 5 deletions(-) - ---- a/drivers/usb/storage/uas-detect.h -+++ b/drivers/usb/storage/uas-detect.h -@@ -51,7 +51,8 @@ static int uas_find_endpoints(struct usb - } - - static int uas_use_uas_driver(struct usb_interface *intf, -- const struct usb_device_id *id) -+ const struct usb_device_id *id, -+ unsigned long *flags_ret) - { - struct usb_host_endpoint *eps[4] = { }; - struct usb_device *udev = interface_to_usbdev(intf); -@@ -132,5 +133,8 @@ static int uas_use_uas_driver(struct usb - return 0; - } - -+ if (flags_ret) -+ *flags_ret = flags; -+ - return 1; - } ---- a/drivers/usb/storage/uas.c -+++ b/drivers/usb/storage/uas.c -@@ -887,8 +887,9 @@ static int uas_probe(struct usb_interfac - struct Scsi_Host *shost = NULL; - struct uas_dev_info *devinfo; - struct usb_device *udev = interface_to_usbdev(intf); -+ unsigned long dev_flags; - -- if (!uas_use_uas_driver(intf, id)) -+ if (!uas_use_uas_driver(intf, id, &dev_flags)) - return -ENODEV; - - if (uas_switch_interface(udev, intf)) -@@ -910,8 +911,7 @@ static int uas_probe(struct usb_interfac - devinfo->udev = udev; - devinfo->resetting = 0; - devinfo->shutdown = 0; -- devinfo->flags = id->driver_info; -- usb_stor_adjust_quirks(udev, &devinfo->flags); -+ devinfo->flags = dev_flags; - init_usb_anchor(&devinfo->cmd_urbs); - init_usb_anchor(&devinfo->sense_urbs); - init_usb_anchor(&devinfo->data_urbs); ---- a/drivers/usb/storage/usb.c -+++ b/drivers/usb/storage/usb.c -@@ -1080,7 +1080,7 @@ static int storage_probe(struct usb_inte - - /* If uas is enabled and this device can do uas then ignore it. */ - #if IS_ENABLED(CONFIG_USB_UAS) -- if (uas_use_uas_driver(intf, id)) -+ if (uas_use_uas_driver(intf, id, NULL)) - return -ENXIO; - #endif - diff --git a/kernel/kernel/files/patches/mageia/uas-set-max_sectors_240-quirk-for-asm1053-devices.patch b/kernel/kernel/files/patches/mageia/uas-set-max_sectors_240-quirk-for-asm1053-devices.patch deleted file mode 100644 index 6a00d620..00000000 --- a/kernel/kernel/files/patches/mageia/uas-set-max_sectors_240-quirk-for-asm1053-devices.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 8e779c6c4a398763c21371fe40f649206041dc1e Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 21 Apr 2015 11:20:32 +0200 -Subject: uas: Set max_sectors_240 quirk for ASM1053 devices - -From: Hans de Goede - -commit 8e779c6c4a398763c21371fe40f649206041dc1e upstream. - -Testing has shown that ASM1053 devices do not work properly with transfers -larger than 240 sectors, so set max_sectors to 240 on these. - -Reported-by: Steve Bangert -Signed-off-by: Hans de Goede -Tested-by: Steve Bangert -Acked-by: Alan Stern -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/usb/storage/uas-detect.h | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/usb/storage/uas-detect.h -+++ b/drivers/usb/storage/uas-detect.h -@@ -74,7 +74,7 @@ static int uas_use_uas_driver(struct usb - * this writing the following versions exist: - * ASM1051 - no uas support version - * ASM1051 - with broken (*) uas support -- * ASM1053 - with working uas support -+ * ASM1053 - with working uas support, but problems with large xfers - * ASM1153 - with working uas support - * - * Devices with these chips re-use a number of device-ids over the -@@ -104,6 +104,9 @@ static int uas_use_uas_driver(struct usb - } else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) { - /* Possibly an ASM1051, disable uas */ - flags |= US_FL_IGNORE_UAS; -+ } else { -+ /* ASM1053, these have issues with large transfers */ -+ flags |= US_FL_MAX_SECTORS_240; - } - } - diff --git a/kernel/kernel/files/patches/mageia/usb-cdc-acm-prevent-infinite-loop-when-parsing-cdc-headers.patch b/kernel/kernel/files/patches/mageia/usb-cdc-acm-prevent-infinite-loop-when-parsing-cdc-headers.patch deleted file mode 100644 index d80a6f77..00000000 --- a/kernel/kernel/files/patches/mageia/usb-cdc-acm-prevent-infinite-loop-when-parsing-cdc-headers.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0d3bba0287d4e284c3ec7d3397e81eec920d5e7e Mon Sep 17 00:00:00 2001 -From: Quentin Casasnovas -Date: Tue, 14 Apr 2015 11:25:43 +0200 -Subject: cdc-acm: prevent infinite loop when parsing CDC headers. - -From: Quentin Casasnovas - -commit 0d3bba0287d4e284c3ec7d3397e81eec920d5e7e upstream. - -Phil and I found out a problem with commit: - - 7e860a6e7aa6 ("cdc-acm: add sanity checks") - -It added some sanity checks to ignore potential garbage in CDC headers but -also introduced a potential infinite loop. This can happen at the first -loop iteration (elength = 0 in that case) if the description isn't a -DT_CS_INTERFACE or later if 'buffer[0]' is zero. - -It should also be noted that the wrong length was being added to 'buffer' -in case 'buffer[1]' was not a DT_CS_INTERFACE descriptor, since elength was -assigned after that check in the loop. - -A specially crafted USB device could be used to trigger this infinite loop. - -Fixes: 7e860a6e7aa6 ("cdc-acm: add sanity checks") -Signed-off-by: Phil Turnbull -Signed-off-by: Quentin Casasnovas -CC: Sergei Shtylyov -CC: Oliver Neukum -CC: Adam Lee -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/usb/class/cdc-acm.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/drivers/usb/class/cdc-acm.c -+++ b/drivers/usb/class/cdc-acm.c -@@ -1133,11 +1133,16 @@ static int acm_probe(struct usb_interfac - } - - while (buflen > 0) { -+ elength = buffer[0]; -+ if (!elength) { -+ dev_err(&intf->dev, "skipping garbage byte\n"); -+ elength = 1; -+ goto next_desc; -+ } - if (buffer[1] != USB_DT_CS_INTERFACE) { - dev_err(&intf->dev, "skipping garbage\n"); - goto next_desc; - } -- elength = buffer[0]; - - switch (buffer[2]) { - case USB_CDC_UNION_TYPE: /* we've found it */ diff --git a/kernel/kernel/files/patches/mageia/usb-chipidea-otg-remove-mutex-unlock-and-lock-while-stop-and-start-role.patch b/kernel/kernel/files/patches/mageia/usb-chipidea-otg-remove-mutex-unlock-and-lock-while-stop-and-start-role.patch deleted file mode 100644 index 03ac59ec..00000000 --- a/kernel/kernel/files/patches/mageia/usb-chipidea-otg-remove-mutex-unlock-and-lock-while-stop-and-start-role.patch +++ /dev/null @@ -1,53 +0,0 @@ -From a5a356cee89f86ff86cc3ce24136ca1f802c1bf1 Mon Sep 17 00:00:00 2001 -From: Li Jun -Date: Sun, 12 Apr 2015 17:51:02 +0800 -Subject: usb: chipidea: otg: remove mutex unlock and lock while stop and start role - -From: Li Jun - -commit a5a356cee89f86ff86cc3ce24136ca1f802c1bf1 upstream. - -Wrongly release mutex lock during otg_statemachine may result in re-enter -otg_statemachine, which is not allowed, we should do next state transtition -after previous one completed. - -Fixes: 826cfe751f3e ("usb: chipidea: add OTG fsm operation functions implementation") -Signed-off-by: Li Jun -Signed-off-by: Peter Chen -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/usb/chipidea/otg_fsm.c | 4 ---- - 1 file changed, 4 deletions(-) - ---- a/drivers/usb/chipidea/otg_fsm.c -+++ b/drivers/usb/chipidea/otg_fsm.c -@@ -537,7 +537,6 @@ static int ci_otg_start_host(struct otg_ - { - struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm); - -- mutex_unlock(&fsm->lock); - if (on) { - ci_role_stop(ci); - ci_role_start(ci, CI_ROLE_HOST); -@@ -546,7 +545,6 @@ static int ci_otg_start_host(struct otg_ - hw_device_reset(ci); - ci_role_start(ci, CI_ROLE_GADGET); - } -- mutex_lock(&fsm->lock); - return 0; - } - -@@ -554,12 +552,10 @@ static int ci_otg_start_gadget(struct ot - { - struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm); - -- mutex_unlock(&fsm->lock); - if (on) - usb_gadget_vbus_connect(&ci->gadget); - else - usb_gadget_vbus_disconnect(&ci->gadget); -- mutex_lock(&fsm->lock); - - return 0; - } diff --git a/kernel/kernel/files/patches/mageia/usb-xhci-Solve-full-event-ring-by-increasing-TRBS_PER_SEGMENT-to-256.patch b/kernel/kernel/files/patches/mageia/usb-xhci-Solve-full-event-ring-by-increasing-TRBS_PER_SEGMENT-to-256.patch deleted file mode 100644 index 2224e77b..00000000 --- a/kernel/kernel/files/patches/mageia/usb-xhci-Solve-full-event-ring-by-increasing-TRBS_PER_SEGMENT-to-256.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 18cc2f4cbbaf825a4fedcf2d60fd388d291e0a38 Mon Sep 17 00:00:00 2001 -From: Mathias Nyman -Date: Thu, 30 Apr 2015 17:16:03 +0300 -Subject: xhci: Solve full event ring by increasing TRBS_PER_SEGMENT to 256 - -Our event ring consists of only one segment, and we risk filling -the event ring in case we get isoc transfers with short intervals -such as webcams that fill a TD every microframe (125us) - -With 64 TRB segment size one usb camera could fill the event ring in 8ms. -A setup with several cameras and other devices can fill up the -event ring as it is shared between all devices. -This has occurred when uvcvideo queues 5 * 32TD URBs which then -get cancelled when the video mode changes. The cancelled URBs are returned -in the xhci interrupt context and blocks the interrupt handler from -handling the new events. - -A full event ring will block xhci from scheduling traffic and affect all -devices conneted to the xhci, will see errors such as Missed Service -Intervals for isoc devices, and and Split transaction errors for LS/FS -interrupt devices. - -Increasing the TRB_PER_SEGMENT will also increase the default endpoint ring -size, which is welcome as for most isoc transfer we had to dynamically -expand the endpoint ring anyway to be able to queue the 5 * 32TDs uvcvideo -queues. - -The default size used to be 64 TRBs per segment - -Cc: -Signed-off-by: Mathias Nyman -Signed-off-by: Greg Kroah-Hartman - -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 8e421b8..ea75e8c 100644 ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -1267,7 +1267,7 @@ union xhci_trb { - * since the command ring is 64-byte aligned. - * It must also be greater than 16. - */ --#define TRBS_PER_SEGMENT 64 -+#define TRBS_PER_SEGMENT 256 - /* Allow two commands + a link TRB, along with any reserved command TRBs */ - #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) - #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) --- -cgit v0.10.2 - diff --git a/kernel/kernel/files/patches/mageia/usb-xhci-clean-up-work-to-remove-unused-parameters-for-functions-in-xhci-mem.c.patch b/kernel/kernel/files/patches/mageia/usb-xhci-clean-up-work-to-remove-unused-parameters-for-functions-in-xhci-mem.c.patch deleted file mode 100644 index f58d0c68..00000000 --- a/kernel/kernel/files/patches/mageia/usb-xhci-clean-up-work-to-remove-unused-parameters-for-functions-in-xhci-mem.c.patch +++ /dev/null @@ -1,339 +0,0 @@ -From 4daf9df51fbfb03b8c2bcb538cb467f7c7af1f11 Mon Sep 17 00:00:00 2001 -From: Lin Wang -Date: Fri, 9 Jan 2015 16:06:31 +0200 -Subject: xhci: clean up work to remove unused parameters for functions in - xhci-mem.c - -Some parameters are not used by functions in xhci-mem.c, just -remove it. - -Changes compared to v1: -- Rebase to the latest usb-next branch - -Signed-off-by: Lin Wang -Signed-off-by: Mathias Nyman -Signed-off-by: Greg Kroah-Hartman - -diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c -index bb89175..745717e 100644 ---- a/drivers/usb/host/xhci-dbg.c -+++ b/drivers/usb/host/xhci-dbg.c -@@ -552,7 +552,7 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci, - - if (ctx->type == XHCI_CTX_TYPE_INPUT) { - struct xhci_input_control_ctx *ctrl_ctx = -- xhci_get_input_control_ctx(xhci, ctx); -+ xhci_get_input_control_ctx(ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "Could not get input context, bad type.\n"); - return; -diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c -index e72265c..f833640 100644 ---- a/drivers/usb/host/xhci-mem.c -+++ b/drivers/usb/host/xhci-mem.c -@@ -535,7 +535,7 @@ static void xhci_free_container_ctx(struct xhci_hcd *xhci, - kfree(ctx); - } - --struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, -+struct xhci_input_control_ctx *xhci_get_input_control_ctx( - struct xhci_container_ctx *ctx) - { - if (ctx->type != XHCI_CTX_TYPE_INPUT) -@@ -784,8 +784,7 @@ void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci, - * Reinstalls the "normal" endpoint ring (at its previous dequeue mark, - * not at the beginning of the ring). - */ --void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci, -- struct xhci_ep_ctx *ep_ctx, -+void xhci_setup_no_streams_ep_input_ctx(struct xhci_ep_ctx *ep_ctx, - struct xhci_virt_ep *ep) - { - dma_addr_t addr; -@@ -1341,8 +1340,7 @@ static u32 xhci_get_endpoint_mult(struct usb_device *udev, - return ep->ss_ep_comp.bmAttributes; - } - --static u32 xhci_get_endpoint_type(struct usb_device *udev, -- struct usb_host_endpoint *ep) -+static u32 xhci_get_endpoint_type(struct usb_host_endpoint *ep) - { - int in; - u32 type; -@@ -1375,8 +1373,7 @@ static u32 xhci_get_endpoint_type(struct usb_device *udev, - * Basically, this is the maxpacket size, multiplied by the burst size - * and mult size. - */ --static u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci, -- struct usb_device *udev, -+static u32 xhci_get_max_esit_payload(struct usb_device *udev, - struct usb_host_endpoint *ep) - { - int max_burst; -@@ -1417,7 +1414,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, - ep_index = xhci_get_endpoint_index(&ep->desc); - ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); - -- endpoint_type = xhci_get_endpoint_type(udev, ep); -+ endpoint_type = xhci_get_endpoint_type(ep); - if (!endpoint_type) - return -EINVAL; - ep_ctx->ep_info2 = cpu_to_le32(endpoint_type); -@@ -1483,7 +1480,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, - } - ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) | - MAX_BURST(max_burst)); -- max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep); -+ max_esit_payload = xhci_get_max_esit_payload(udev, ep); - ep_ctx->tx_info = cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload)); - - /* -@@ -1772,7 +1769,7 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, - return command; - } - --void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv) -+void xhci_urb_free_priv(struct urb_priv *urb_priv) - { - if (urb_priv) { - kfree(urb_priv->td[0]); -@@ -1925,7 +1922,7 @@ static int xhci_test_trb_in_td(struct xhci_hcd *xhci, - } - - /* TRB math checks for xhci_trb_in_td(), using the command and event rings. */ --static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags) -+static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci) - { - struct { - dma_addr_t input_dma; -@@ -2451,7 +2448,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) - flags); - if (!xhci->event_ring) - goto fail; -- if (xhci_check_trb_in_td_math(xhci, flags) < 0) -+ if (xhci_check_trb_in_td_math(xhci) < 0) - goto fail; - - xhci->erst.entries = dma_alloc_coherent(dev, -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index c84a959..067f18a 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -609,7 +609,7 @@ static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci, - - spin_unlock(&xhci->lock); - usb_hcd_giveback_urb(hcd, urb, status); -- xhci_urb_free_priv(xhci, urb_priv); -+ xhci_urb_free_priv(urb_priv); - spin_lock(&xhci->lock); - } - } -@@ -1110,7 +1110,7 @@ static void xhci_handle_cmd_config_ep(struct xhci_hcd *xhci, int slot_id, - * is not waiting on the configure endpoint command. - */ - virt_dev = xhci->devs[slot_id]; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "Could not get input context, bad type.\n"); - return; -@@ -2497,7 +2497,7 @@ cleanup: - urb = td->urb; - urb_priv = urb->hcpriv; - -- xhci_urb_free_priv(xhci, urb_priv); -+ xhci_urb_free_priv(urb_priv); - - usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); - if ((urb->actual_length != urb->transfer_buffer_length && -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 1e3f39c..e282765 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -1275,7 +1275,7 @@ static int xhci_check_maxpacket(struct x - return -ENOMEM; - - command->in_ctx = xhci->devs[slot_id]->in_ctx; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -1373,7 +1373,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd - ret = xhci_check_maxpacket(xhci, slot_id, - ep_index, urb); - if (ret < 0) { -- xhci_urb_free_priv(xhci, urb_priv); -+ xhci_urb_free_priv(urb_priv); - urb->hcpriv = NULL; - return ret; - } -@@ -1439,7 +1439,7 @@ dying: - urb->ep->desc.bEndpointAddress, urb); - ret = -ESHUTDOWN; - free_priv: -- xhci_urb_free_priv(xhci, urb_priv); -+ xhci_urb_free_priv(urb_priv); - urb->hcpriv = NULL; - spin_unlock_irqrestore(&xhci->lock, flags); - return ret; -@@ -1552,7 +1552,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd - usb_hcd_unlink_urb_from_ep(hcd, urb); - spin_unlock_irqrestore(&xhci->lock, flags); - usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN); -- xhci_urb_free_priv(xhci, urb_priv); -+ xhci_urb_free_priv(urb_priv); - return ret; - } - if ((xhci->xhc_state & XHCI_STATE_DYING) || -@@ -1659,7 +1659,7 @@ int xhci_drop_endpoint(struct usb_hcd *h - - in_ctx = xhci->devs[udev->slot_id]->in_ctx; - out_ctx = xhci->devs[udev->slot_id]->out_ctx; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -1745,7 +1745,7 @@ int xhci_add_endpoint(struct usb_hcd *hc - virt_dev = xhci->devs[udev->slot_id]; - in_ctx = virt_dev->in_ctx; - out_ctx = virt_dev->out_ctx; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -1815,7 +1815,7 @@ static void xhci_zero_in_ctx(struct xhci - struct xhci_slot_ctx *slot_ctx; - int i; - -- ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -2541,7 +2541,7 @@ static int xhci_reserve_bandwidth(struct - if (virt_dev->tt_info) - old_active_eps = virt_dev->tt_info->active_eps; - -- ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -2638,7 +2638,7 @@ static int xhci_configure_endpoint(struc - spin_lock_irqsave(&xhci->lock, flags); - virt_dev = xhci->devs[udev->slot_id]; - -- ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx); - if (!ctrl_ctx) { - spin_unlock_irqrestore(&xhci->lock, flags); - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", -@@ -2757,7 +2757,7 @@ int xhci_check_bandwidth(struct usb_hcd - command->in_ctx = virt_dev->in_ctx; - - /* See section 4.6.6 - A0 = 1; A1 = D0 = D1 = 0 */ -- ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -2882,7 +2882,7 @@ static void xhci_setup_input_ctx_for_qui - dma_addr_t addr; - - in_ctx = xhci->devs[slot_id]->in_ctx; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -3172,7 +3172,7 @@ int xhci_alloc_streams(struct usb_hcd *h - xhci_dbg(xhci, "Could not allocate xHCI command structure.\n"); - return -ENOMEM; - } -- ctrl_ctx = xhci_get_input_control_ctx(xhci, config_cmd->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(config_cmd->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -3327,7 +3327,7 @@ int xhci_free_streams(struct usb_hcd *hc - */ - ep_index = xhci_get_endpoint_index(&eps[0]->desc); - command = vdev->eps[ep_index].stream_info->free_streams_command; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx); - if (!ctrl_ctx) { - spin_unlock_irqrestore(&xhci->lock, flags); - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", -@@ -3345,7 +3345,7 @@ int xhci_free_streams(struct usb_hcd *hc - - xhci_endpoint_copy(xhci, command->in_ctx, - vdev->out_ctx, ep_index); -- xhci_setup_no_streams_ep_input_ctx(xhci, ep_ctx, -+ xhci_setup_no_streams_ep_input_ctx(ep_ctx, - &vdev->eps[ep_index]); - } - xhci_setup_input_ctx_for_config_ep(xhci, command->in_ctx, -@@ -3819,7 +3819,7 @@ static int xhci_setup_device(struct usb_ - command->completion = &xhci->addr_dev; - - slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx); -- ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -@@ -4002,7 +4002,7 @@ static int __maybe_unused xhci_change_ma - - /* Attempt to issue an Evaluate Context command to change the MEL. */ - command = xhci->lpm_command; -- ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx); - if (!ctrl_ctx) { - spin_unlock_irqrestore(&xhci->lock, flags); - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", -@@ -4740,7 +4740,7 @@ int xhci_update_hub_device(struct usb_hc - xhci_dbg(xhci, "Could not allocate xHCI command structure.\n"); - return -ENOMEM; - } -- ctrl_ctx = xhci_get_input_control_ctx(xhci, config_cmd->in_ctx); -+ ctrl_ctx = xhci_get_input_control_ctx(config_cmd->in_ctx); - if (!ctrl_ctx) { - xhci_warn(xhci, "%s: Could not get input context, bad type.\n", - __func__); -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index eeea5c0..e23f31d 100644 ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -1712,8 +1712,7 @@ void xhci_free_stream_info(struct xhci_hcd *xhci, - void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci, - struct xhci_ep_ctx *ep_ctx, - struct xhci_stream_info *stream_info); --void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci, -- struct xhci_ep_ctx *ep_ctx, -+void xhci_setup_no_streams_ep_input_ctx(struct xhci_ep_ctx *ep_ctx, - struct xhci_virt_ep *ep); - void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci, - struct xhci_virt_device *virt_dev, bool drop_control_ep); -@@ -1727,7 +1726,7 @@ struct xhci_ring *xhci_stream_id_to_ring( - struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci, - bool allocate_in_ctx, bool allocate_completion, - gfp_t mem_flags); --void xhci_urb_free_priv(struct xhci_hcd *xhci, struct urb_priv *urb_priv); -+void xhci_urb_free_priv(struct urb_priv *urb_priv); - void xhci_free_command(struct xhci_hcd *xhci, - struct xhci_command *command); - -@@ -1863,7 +1862,7 @@ int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, - void xhci_ring_device(struct xhci_hcd *xhci, int slot_id); - - /* xHCI contexts */ --struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); -+struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_container_ctx *ctx); - struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); - struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); - --- -cgit v0.10.2 diff --git a/kernel/kernel/files/patches/mageia/usb-xhci-fix-isoc-endpoint-dequeue-from-advancing-too-far-on-transaction-error.patch b/kernel/kernel/files/patches/mageia/usb-xhci-fix-isoc-endpoint-dequeue-from-advancing-too-far-on-transaction-error.patch deleted file mode 100644 index 33804781..00000000 --- a/kernel/kernel/files/patches/mageia/usb-xhci-fix-isoc-endpoint-dequeue-from-advancing-too-far-on-transaction-error.patch +++ /dev/null @@ -1,43 +0,0 @@ -From d104d0152a97fade389f47635b73a9ccc7295d0b Mon Sep 17 00:00:00 2001 -From: Mathias Nyman -Date: Thu, 30 Apr 2015 17:16:02 +0300 -Subject: xhci: fix isoc endpoint dequeue from advancing too far on transaction - error - -Isoc TDs usually consist of one TRB, sometimes two. When all goes well we -receive only one success event for a TD, and move the dequeue pointer to -the next TD. - -This fails if the TD consists of two TRBs and we get a transfer error -on the first TRB, we will then see two events for that TD. - -Fix this by making sure the event we get is for the last TRB in that TD -before moving the dequeue pointer to the next TD. This will resolve some -of the uvc and dvb issues with the -"ERROR Transfer event TRB DMA ptr not part of current TD" error message - -Cc: -Signed-off-by: Mathias Nyman -Signed-off-by: Greg Kroah-Hartman - -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index f5397a5..ae0894c 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -2026,8 +2026,13 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td, - break; - case COMP_DEV_ERR: - case COMP_STALL: -+ frame->status = -EPROTO; -+ skip_td = true; -+ break; - case COMP_TX_ERR: - frame->status = -EPROTO; -+ if (event_trb != td->last_trb) -+ return 0; - skip_td = true; - break; - case COMP_STOP: --- -cgit v0.10.2 - diff --git a/kernel/kernel/files/patches/mageia/usb-xhci-gracefully-handle-xhci_irq-dead-device.patch b/kernel/kernel/files/patches/mageia/usb-xhci-gracefully-handle-xhci_irq-dead-device.patch deleted file mode 100644 index 9685e1f9..00000000 --- a/kernel/kernel/files/patches/mageia/usb-xhci-gracefully-handle-xhci_irq-dead-device.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 948fa13504f80b9765d2b753691ab94c83a10341 Mon Sep 17 00:00:00 2001 -From: Joe Lawrence -Date: Thu, 30 Apr 2015 17:16:04 +0300 -Subject: xhci: gracefully handle xhci_irq dead device - -If the xHCI host controller has died (ie, device removed) or suffered -other serious fatal error (STS_FATAL), then xhci_irq should handle this -condition with IRQ_HANDLED instead of -ESHUTDOWN. - -Signed-off-by: Joe Lawrence -Cc: -Signed-off-by: Mathias Nyman -Signed-off-by: Greg Kroah-Hartman - -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index ae0894c..7d34cbf 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -2645,7 +2645,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) - xhci_halt(xhci); - hw_died: - spin_unlock(&xhci->lock); -- return -ESHUTDOWN; -+ return IRQ_HANDLED; - } - - /* --- -cgit v0.10.2 - diff --git a/kernel/kernel/files/patches/mageia/usb-xhci-remove-unused-parameter-xhci-in-function-xhci-handshake.patch b/kernel/kernel/files/patches/mageia/usb-xhci-remove-unused-parameter-xhci-in-function-xhci-handshake.patch deleted file mode 100644 index f55e6489..00000000 --- a/kernel/kernel/files/patches/mageia/usb-xhci-remove-unused-parameter-xhci-in-function-xhci-handshake.patch +++ /dev/null @@ -1,128 +0,0 @@ -From dc0b177cf8be1e7371cfb92cfbccac595bf8dac8 Mon Sep 17 00:00:00 2001 -From: Lin Wang -Date: Fri, 9 Jan 2015 16:06:28 +0200 -Subject: xhci: remove unused parameter 'xhci' in function xhci_handshake(). - -Parameter 'xhci' is no longer be used in function xhci_handshake(), -just remove it. - -Signed-off-by: Lin Wang -Signed-off-by: Mathias Nyman -Signed-off-by: Greg Kroah-Hartman - -diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index e692e76..c84a959 100644 ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -299,7 +299,7 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) - * seconds), then it should assume that the there are - * larger problems with the xHC and assert HCRST. - */ -- ret = xhci_handshake(xhci, &xhci->op_regs->cmd_ring, -+ ret = xhci_handshake(&xhci->op_regs->cmd_ring, - CMD_RING_RUNNING, 0, 5 * 1000 * 1000); - if (ret < 0) { - xhci_err(xhci, "Stopped the command ring failed, " -diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 93200db..5ec74e2 100644 ---- a/drivers/usb/host/xhci.c -+++ b/drivers/usb/host/xhci.c -@@ -60,8 +60,7 @@ MODULE_PARM_DESC(quirks, "Bit flags for quirks to be enabled as default"); - * handshake done). There are two failure modes: "usec" have passed (major - * hardware flakeout), or the register reads as all-ones (hardware removed). - */ --int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr, -- u32 mask, u32 done, int usec) -+int xhci_handshake(void __iomem *ptr, u32 mask, u32 done, int usec) - { - u32 result; - -@@ -111,7 +110,7 @@ int xhci_halt(struct xhci_hcd *xhci) - xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Halt the HC"); - xhci_quiesce(xhci); - -- ret = xhci_handshake(xhci, &xhci->op_regs->status, -+ ret = xhci_handshake(&xhci->op_regs->status, - STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC); - if (!ret) { - xhci->xhc_state |= XHCI_STATE_HALTED; -@@ -140,7 +139,7 @@ static int xhci_start(struct xhci_hcd *xhci) - * Wait for the HCHalted Status bit to be 0 to indicate the host is - * running. - */ -- ret = xhci_handshake(xhci, &xhci->op_regs->status, -+ ret = xhci_handshake(&xhci->op_regs->status, - STS_HALT, 0, XHCI_MAX_HALT_USEC); - if (ret == -ETIMEDOUT) - xhci_err(xhci, "Host took too long to start, " -@@ -175,7 +174,7 @@ int xhci_reset(struct xhci_hcd *xhci) - command |= CMD_RESET; - writel(command, &xhci->op_regs->command); - -- ret = xhci_handshake(xhci, &xhci->op_regs->command, -+ ret = xhci_handshake(&xhci->op_regs->command, - CMD_RESET, 0, 10 * 1000 * 1000); - if (ret) - return ret; -@@ -186,7 +185,7 @@ int xhci_reset(struct xhci_hcd *xhci) - * xHCI cannot write to any doorbells or operational registers other - * than status until the "Controller Not Ready" flag is cleared. - */ -- ret = xhci_handshake(xhci, &xhci->op_regs->status, -+ ret = xhci_handshake(&xhci->op_regs->status, - STS_CNR, 0, 10 * 1000 * 1000); - - for (i = 0; i < 2; ++i) { -@@ -929,7 +928,7 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) - /* Some chips from Fresco Logic need an extraordinary delay */ - delay *= (xhci->quirks & XHCI_SLOW_SUSPEND) ? 10 : 1; - -- if (xhci_handshake(xhci, &xhci->op_regs->status, -+ if (xhci_handshake(&xhci->op_regs->status, - STS_HALT, STS_HALT, delay)) { - xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n"); - spin_unlock_irq(&xhci->lock); -@@ -944,7 +943,7 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) - command = readl(&xhci->op_regs->command); - command |= CMD_CSS; - writel(command, &xhci->op_regs->command); -- if (xhci_handshake(xhci, &xhci->op_regs->status, -+ if (xhci_handshake(&xhci->op_regs->status, - STS_SAVE, 0, 10 * 1000)) { - xhci_warn(xhci, "WARN: xHC save state timeout\n"); - spin_unlock_irq(&xhci->lock); -@@ -1011,7 +1010,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) - command = readl(&xhci->op_regs->command); - command |= CMD_CRS; - writel(command, &xhci->op_regs->command); -- if (xhci_handshake(xhci, &xhci->op_regs->status, -+ if (xhci_handshake(&xhci->op_regs->status, - STS_RESTORE, 0, 10 * 1000)) { - xhci_warn(xhci, "WARN: xHC restore state timeout\n"); - spin_unlock_irq(&xhci->lock); -@@ -1082,7 +1081,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) - command = readl(&xhci->op_regs->command); - command |= CMD_RUN; - writel(command, &xhci->op_regs->command); -- xhci_handshake(xhci, &xhci->op_regs->status, STS_HALT, -+ xhci_handshake(&xhci->op_regs->status, STS_HALT, - 0, 250 * 1000); - - /* step 5: walk topology and initialize portsc, -diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index cc7c5bb..eeea5c0 100644 ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -1733,8 +1733,7 @@ void xhci_free_command(struct xhci_hcd *xhci, - - /* xHCI host controller glue */ - typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *); --int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr, -- u32 mask, u32 done, int usec); -+int xhci_handshake(void __iomem *ptr, u32 mask, u32 done, int usec); - void xhci_quiesce(struct xhci_hcd *xhci); - int xhci_halt(struct xhci_hcd *xhci); - int xhci_reset(struct xhci_hcd *xhci); --- -cgit v0.10.2 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-Add-additional-vesa-modes.patch b/kernel/kernel/files/patches/mageia/video-fbdev-Add-additional-vesa-modes.patch deleted file mode 100644 index 3dce1000..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-Add-additional-vesa-modes.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 37715f556a0776356300391f8ac41ace91bea447 Mon Sep 17 00:00:00 2001 -From: David Ung -Date: Tue, 13 Jan 2015 19:04:00 -0800 -Subject: [PATCH 1/4] video: fbdev: Add additional vesa modes - -Add high resolution modes to vesa_modes struct. - -Signed-off-by: David Ung -Signed-off-by: Tomi Valkeinen ---- - drivers/video/fbdev/core/modedb.c | 27 +++++++++++++++++++++++++++ - include/linux/fb.h | 2 +- - 2 files changed, 28 insertions(+), 1 deletion(-) - -diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c -index 388f797..0b57c1df 100644 ---- a/drivers/video/fbdev/core/modedb.c -+++ b/drivers/video/fbdev/core/modedb.c -@@ -468,6 +468,33 @@ const struct fb_videomode vesa_modes[] = { - /* 33 1920x1440-75 VESA */ - { NULL, 75, 1920, 1440, 3367, 352, 144, 56, 1, 224, 3, - FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 34 1920x1200-60 RB VESA */ -+ { NULL, 60, 1920, 1200, 6493, 80, 48, 26, 3, 32, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 35 1920x1200-60 VESA */ -+ { NULL, 60, 1920, 1200, 5174, 336, 136, 36, 3, 200, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 36 1920x1200-75 VESA */ -+ { NULL, 75, 1920, 1200, 4077, 344, 136, 46, 3, 208, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 37 1920x1200-85 VESA */ -+ { NULL, 85, 1920, 1200, 3555, 352, 144, 53, 3, 208, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 38 2560x1600-60 RB VESA */ -+ { NULL, 60, 2560, 1600, 3724, 80, 48, 37, 3, 32, 6, -+ FB_SYNC_HOR_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 39 2560x1600-60 VESA */ -+ { NULL, 60, 2560, 1600, 2869, 472, 192, 49, 3, 280, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 40 2560x1600-75 VESA */ -+ { NULL, 75, 2560, 1600, 2256, 488, 208, 63, 3, 280, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 41 2560x1600-85 VESA */ -+ { NULL, 85, 2560, 1600, 1979, 488, 208, 73, 3, 280, 6, -+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, -+ /* 42 2560x1600-120 RB VESA */ -+ { NULL, 120, 2560, 1600, 1809, 80, 48, 85, 3, 32, 6, -+ FB_SYNC_HOR_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, - }; - EXPORT_SYMBOL(vesa_modes); - #endif /* CONFIG_FB_MODE_HELPERS */ -diff --git a/include/linux/fb.h b/include/linux/fb.h -index 09bb7a1..882dbd1 100644 ---- a/include/linux/fb.h -+++ b/include/linux/fb.h -@@ -726,7 +726,7 @@ extern int fb_videomode_from_videomode(const struct videomode *vm, - struct fb_videomode *fbmode); - - /* drivers/video/modedb.c */ --#define VESA_MODEDB_SIZE 34 -+#define VESA_MODEDB_SIZE 43 - extern void fb_var_to_videomode(struct fb_videomode *mode, - const struct fb_var_screeninfo *var); - extern void fb_videomode_to_var(struct fb_var_screeninfo *var, --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-Check-Standard-Timing-against-DMT.patch b/kernel/kernel/files/patches/mageia/video-fbdev-Check-Standard-Timing-against-DMT.patch deleted file mode 100644 index 1bcbd0e0..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-Check-Standard-Timing-against-DMT.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 8f5ee77bb8d162abe28ff8cd56f36e825d143207 Mon Sep 17 00:00:00 2001 -From: David Ung -Date: Tue, 13 Jan 2015 19:04:01 -0800 -Subject: [PATCH 2/4] video: fbdev: Check Standard Timing against DMT - -Add the VESA Display Monitor Timing (DMT) table. -During parsing of Standard Timings, it compare the 2 byte STD code -with DMT to see what the VESA mode should be. If there is no entry -in the vesa_modes table or no match found, it fallsback to the -GTF timings. - -Signed-off-by: David Ung -Signed-off-by: Tomi Valkeinen ---- - drivers/video/fbdev/core/fbmon.c | 76 +++++++++++++++++++---------------- - drivers/video/fbdev/core/modedb.c | 84 +++++++++++++++++++++++++++++++++++++++ - include/linux/fb.h | 10 +++++ - 3 files changed, 136 insertions(+), 34 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c -index 5b0e313..0f234c1 100644 ---- a/drivers/video/fbdev/core/fbmon.c -+++ b/drivers/video/fbdev/core/fbmon.c -@@ -498,44 +498,52 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode) - static int get_std_timing(unsigned char *block, struct fb_videomode *mode, - int ver, int rev) - { -- int xres, yres = 0, refresh, ratio, i; -- -- xres = (block[0] + 31) * 8; -- if (xres <= 256) -- return 0; -+ int i; - -- ratio = (block[1] & 0xc0) >> 6; -- switch (ratio) { -- case 0: -- /* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */ -- if (ver < 1 || (ver == 1 && rev < 3)) -- yres = xres; -- else -- yres = (xres * 10)/16; -- break; -- case 1: -- yres = (xres * 3)/4; -- break; -- case 2: -- yres = (xres * 4)/5; -- break; -- case 3: -- yres = (xres * 9)/16; -- break; -+ for (i = 0; i < DMT_SIZE; i++) { -+ u32 std_2byte_code = block[0] << 8 | block[1]; -+ if (std_2byte_code == dmt_modes[i].std_2byte_code) -+ break; - } -- refresh = (block[1] & 0x3f) + 60; -- -- DPRINTK(" %dx%d@%dHz\n", xres, yres, refresh); -- for (i = 0; i < VESA_MODEDB_SIZE; i++) { -- if (vesa_modes[i].xres == xres && -- vesa_modes[i].yres == yres && -- vesa_modes[i].refresh == refresh) { -- *mode = vesa_modes[i]; -- mode->flag |= FB_MODE_IS_STANDARD; -- return 1; -+ -+ if (i < DMT_SIZE && dmt_modes[i].mode) { -+ /* DMT mode found */ -+ *mode = *dmt_modes[i].mode; -+ mode->flag |= FB_MODE_IS_STANDARD; -+ DPRINTK(" DMT id=%d\n", dmt_modes[i].dmt_id); -+ -+ } else { -+ int xres, yres = 0, refresh, ratio; -+ -+ xres = (block[0] + 31) * 8; -+ if (xres <= 256) -+ return 0; -+ -+ ratio = (block[1] & 0xc0) >> 6; -+ switch (ratio) { -+ case 0: -+ /* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */ -+ if (ver < 1 || (ver == 1 && rev < 3)) -+ yres = xres; -+ else -+ yres = (xres * 10)/16; -+ break; -+ case 1: -+ yres = (xres * 3)/4; -+ break; -+ case 2: -+ yres = (xres * 4)/5; -+ break; -+ case 3: -+ yres = (xres * 9)/16; -+ break; - } -+ refresh = (block[1] & 0x3f) + 60; -+ DPRINTK(" %dx%d@%dHz\n", xres, yres, refresh); -+ -+ calc_mode_timings(xres, yres, refresh, mode); - } -- calc_mode_timings(xres, yres, refresh, mode); -+ - return 1; - } - -diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c -index 0b57c1df..858a97e 100644 ---- a/drivers/video/fbdev/core/modedb.c -+++ b/drivers/video/fbdev/core/modedb.c -@@ -497,6 +497,90 @@ const struct fb_videomode vesa_modes[] = { - FB_SYNC_HOR_HIGH_ACT, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, - }; - EXPORT_SYMBOL(vesa_modes); -+ -+const struct dmt_videomode dmt_modes[DMT_SIZE] = { -+ { 0x01, 0x0000, 0x000000, &vesa_modes[0] }, -+ { 0x02, 0x3119, 0x000000, &vesa_modes[1] }, -+ { 0x03, 0x0000, 0x000000, &vesa_modes[2] }, -+ { 0x04, 0x3140, 0x000000, &vesa_modes[3] }, -+ { 0x05, 0x314c, 0x000000, &vesa_modes[4] }, -+ { 0x06, 0x314f, 0x000000, &vesa_modes[5] }, -+ { 0x07, 0x3159, 0x000000, &vesa_modes[6] }, -+ { 0x08, 0x0000, 0x000000, &vesa_modes[7] }, -+ { 0x09, 0x4540, 0x000000, &vesa_modes[8] }, -+ { 0x0a, 0x454c, 0x000000, &vesa_modes[9] }, -+ { 0x0b, 0x454f, 0x000000, &vesa_modes[10] }, -+ { 0x0c, 0x4559, 0x000000, &vesa_modes[11] }, -+ { 0x0d, 0x0000, 0x000000, 0 }, -+ { 0x0e, 0x0000, 0x000000, 0 }, -+ { 0x0f, 0x0000, 0x000000, &vesa_modes[12] }, -+ { 0x10, 0x6140, 0x000000, &vesa_modes[13] }, -+ { 0x11, 0x614a, 0x000000, &vesa_modes[14] }, -+ { 0x12, 0x614f, 0x000000, &vesa_modes[15] }, -+ { 0x13, 0x6159, 0x000000, &vesa_modes[16] }, -+ { 0x14, 0x0000, 0x000000, 0 }, -+ { 0x15, 0x714f, 0x000000, &vesa_modes[17] }, -+ { 0x16, 0x0000, 0x7f1c21, 0 }, -+ { 0x17, 0x0000, 0x7f1c28, 0 }, -+ { 0x18, 0x0000, 0x7f1c44, 0 }, -+ { 0x19, 0x0000, 0x7f1c62, 0 }, -+ { 0x1a, 0x0000, 0x000000, 0 }, -+ { 0x1b, 0x0000, 0x8f1821, 0 }, -+ { 0x1c, 0x8100, 0x8f1828, 0 }, -+ { 0x1d, 0x810f, 0x8f1844, 0 }, -+ { 0x1e, 0x8119, 0x8f1862, 0 }, -+ { 0x1f, 0x0000, 0x000000, 0 }, -+ { 0x20, 0x8140, 0x000000, &vesa_modes[18] }, -+ { 0x21, 0x8159, 0x000000, &vesa_modes[19] }, -+ { 0x22, 0x0000, 0x000000, 0 }, -+ { 0x23, 0x8180, 0x000000, &vesa_modes[20] }, -+ { 0x24, 0x818f, 0x000000, &vesa_modes[21] }, -+ { 0x25, 0x8199, 0x000000, &vesa_modes[22] }, -+ { 0x26, 0x0000, 0x000000, 0 }, -+ { 0x27, 0x0000, 0x000000, 0 }, -+ { 0x28, 0x0000, 0x000000, 0 }, -+ { 0x29, 0x0000, 0x0c2021, 0 }, -+ { 0x2a, 0x9040, 0x0c2028, 0 }, -+ { 0x2b, 0x904f, 0x0c2044, 0 }, -+ { 0x2c, 0x9059, 0x0c2062, 0 }, -+ { 0x2d, 0x0000, 0x000000, 0 }, -+ { 0x2e, 0x9500, 0xc11821, 0 }, -+ { 0x2f, 0x9500, 0xc11828, 0 }, -+ { 0x30, 0x950f, 0xc11844, 0 }, -+ { 0x31, 0x9519, 0xc11868, 0 }, -+ { 0x32, 0x0000, 0x000000, 0 }, -+ { 0x33, 0xa940, 0x000000, &vesa_modes[23] }, -+ { 0x34, 0xa945, 0x000000, &vesa_modes[24] }, -+ { 0x35, 0xa94a, 0x000000, &vesa_modes[25] }, -+ { 0x36, 0xa94f, 0x000000, &vesa_modes[26] }, -+ { 0x37, 0xa959, 0x000000, &vesa_modes[27] }, -+ { 0x38, 0x0000, 0x000000, 0 }, -+ { 0x39, 0x0000, 0x0c2821, 0 }, -+ { 0x3a, 0xb300, 0x0c2828, 0 }, -+ { 0x3b, 0xb30f, 0x0c2844, 0 }, -+ { 0x3c, 0xb319, 0x0c2868, 0 }, -+ { 0x3d, 0x0000, 0x000000, 0 }, -+ { 0x3e, 0xc140, 0x000000, &vesa_modes[28] }, -+ { 0x3f, 0xc14f, 0x000000, &vesa_modes[29] }, -+ { 0x40, 0x0000, 0x000000, 0 }, -+ { 0x41, 0xc940, 0x000000, &vesa_modes[30] }, -+ { 0x42, 0xc94f, 0x000000, &vesa_modes[31] }, -+ { 0x43, 0x0000, 0x000000, 0 }, -+ { 0x44, 0x0000, 0x572821, &vesa_modes[34] }, -+ { 0x45, 0xd100, 0x572828, &vesa_modes[35] }, -+ { 0x46, 0xd10f, 0x572844, &vesa_modes[36] }, -+ { 0x47, 0xd119, 0x572862, &vesa_modes[37] }, -+ { 0x48, 0x0000, 0x000000, 0 }, -+ { 0x49, 0xd140, 0x000000, &vesa_modes[32] }, -+ { 0x4a, 0xd14f, 0x000000, &vesa_modes[33] }, -+ { 0x4b, 0x0000, 0x000000, 0 }, -+ { 0x4c, 0x0000, 0x1f3821, &vesa_modes[38] }, -+ { 0x4d, 0x0000, 0x1f3828, &vesa_modes[39] }, -+ { 0x4e, 0x0000, 0x1f3844, &vesa_modes[40] }, -+ { 0x4f, 0x0000, 0x1f3862, &vesa_modes[41] }, -+ { 0x50, 0x0000, 0x000000, &vesa_modes[42] }, -+}; -+EXPORT_SYMBOL(dmt_modes); - #endif /* CONFIG_FB_MODE_HELPERS */ - - /** -diff --git a/include/linux/fb.h b/include/linux/fb.h -index 882dbd1..043f328 100644 ---- a/include/linux/fb.h -+++ b/include/linux/fb.h -@@ -727,6 +727,8 @@ extern int fb_videomode_from_videomode(const struct videomode *vm, - - /* drivers/video/modedb.c */ - #define VESA_MODEDB_SIZE 43 -+#define DMT_SIZE 0x50 -+ - extern void fb_var_to_videomode(struct fb_videomode *mode, - const struct fb_var_screeninfo *var); - extern void fb_videomode_to_var(struct fb_var_screeninfo *var, -@@ -777,9 +779,17 @@ struct fb_videomode { - u32 flag; - }; - -+struct dmt_videomode { -+ u32 dmt_id; -+ u32 std_2byte_code; -+ u32 cvt_3byte_code; -+ const struct fb_videomode *mode; -+}; -+ - extern const char *fb_mode_option; - extern const struct fb_videomode vesa_modes[]; - extern const struct fb_videomode cea_modes[64]; -+extern const struct dmt_videomode dmt_modes[]; - - struct fb_modelist { - struct list_head list; --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-Fix-sparse-warning-messages.patch b/kernel/kernel/files/patches/mageia/video-fbdev-Fix-sparse-warning-messages.patch deleted file mode 100644 index dbf9f834..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-Fix-sparse-warning-messages.patch +++ /dev/null @@ -1,128 +0,0 @@ -From ba59bab7530cf98b40b7c4e1c8f86dc3d7f2b47f Mon Sep 17 00:00:00 2001 -From: David Ung -Date: Fri, 16 Jan 2015 16:39:35 -0800 -Subject: [PATCH 4/4] video: fbdev: Fix sparse warning messages - -Use NULL instead of 0 for the last entry of dmt_modes struct. -Supresses "sparse: Using plain integer as NULL pointer" warning. - -Signed-off-by: David Ung -Signed-off-by: Tomi Valkeinen ---- - drivers/video/fbdev/core/modedb.c | 74 +++++++++++++++++++-------------------- - 1 file changed, 37 insertions(+), 37 deletions(-) - -diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c -index 858a97e..7d07cf8 100644 ---- a/drivers/video/fbdev/core/modedb.c -+++ b/drivers/video/fbdev/core/modedb.c -@@ -511,69 +511,69 @@ const struct dmt_videomode dmt_modes[DMT_SIZE] = { - { 0x0a, 0x454c, 0x000000, &vesa_modes[9] }, - { 0x0b, 0x454f, 0x000000, &vesa_modes[10] }, - { 0x0c, 0x4559, 0x000000, &vesa_modes[11] }, -- { 0x0d, 0x0000, 0x000000, 0 }, -- { 0x0e, 0x0000, 0x000000, 0 }, -+ { 0x0d, 0x0000, 0x000000, NULL }, -+ { 0x0e, 0x0000, 0x000000, NULL }, - { 0x0f, 0x0000, 0x000000, &vesa_modes[12] }, - { 0x10, 0x6140, 0x000000, &vesa_modes[13] }, - { 0x11, 0x614a, 0x000000, &vesa_modes[14] }, - { 0x12, 0x614f, 0x000000, &vesa_modes[15] }, - { 0x13, 0x6159, 0x000000, &vesa_modes[16] }, -- { 0x14, 0x0000, 0x000000, 0 }, -+ { 0x14, 0x0000, 0x000000, NULL }, - { 0x15, 0x714f, 0x000000, &vesa_modes[17] }, -- { 0x16, 0x0000, 0x7f1c21, 0 }, -- { 0x17, 0x0000, 0x7f1c28, 0 }, -- { 0x18, 0x0000, 0x7f1c44, 0 }, -- { 0x19, 0x0000, 0x7f1c62, 0 }, -- { 0x1a, 0x0000, 0x000000, 0 }, -- { 0x1b, 0x0000, 0x8f1821, 0 }, -- { 0x1c, 0x8100, 0x8f1828, 0 }, -- { 0x1d, 0x810f, 0x8f1844, 0 }, -- { 0x1e, 0x8119, 0x8f1862, 0 }, -- { 0x1f, 0x0000, 0x000000, 0 }, -+ { 0x16, 0x0000, 0x7f1c21, NULL }, -+ { 0x17, 0x0000, 0x7f1c28, NULL }, -+ { 0x18, 0x0000, 0x7f1c44, NULL }, -+ { 0x19, 0x0000, 0x7f1c62, NULL }, -+ { 0x1a, 0x0000, 0x000000, NULL }, -+ { 0x1b, 0x0000, 0x8f1821, NULL }, -+ { 0x1c, 0x8100, 0x8f1828, NULL }, -+ { 0x1d, 0x810f, 0x8f1844, NULL }, -+ { 0x1e, 0x8119, 0x8f1862, NULL }, -+ { 0x1f, 0x0000, 0x000000, NULL }, - { 0x20, 0x8140, 0x000000, &vesa_modes[18] }, - { 0x21, 0x8159, 0x000000, &vesa_modes[19] }, -- { 0x22, 0x0000, 0x000000, 0 }, -+ { 0x22, 0x0000, 0x000000, NULL }, - { 0x23, 0x8180, 0x000000, &vesa_modes[20] }, - { 0x24, 0x818f, 0x000000, &vesa_modes[21] }, - { 0x25, 0x8199, 0x000000, &vesa_modes[22] }, -- { 0x26, 0x0000, 0x000000, 0 }, -- { 0x27, 0x0000, 0x000000, 0 }, -- { 0x28, 0x0000, 0x000000, 0 }, -- { 0x29, 0x0000, 0x0c2021, 0 }, -- { 0x2a, 0x9040, 0x0c2028, 0 }, -- { 0x2b, 0x904f, 0x0c2044, 0 }, -- { 0x2c, 0x9059, 0x0c2062, 0 }, -- { 0x2d, 0x0000, 0x000000, 0 }, -- { 0x2e, 0x9500, 0xc11821, 0 }, -- { 0x2f, 0x9500, 0xc11828, 0 }, -- { 0x30, 0x950f, 0xc11844, 0 }, -- { 0x31, 0x9519, 0xc11868, 0 }, -- { 0x32, 0x0000, 0x000000, 0 }, -+ { 0x26, 0x0000, 0x000000, NULL }, -+ { 0x27, 0x0000, 0x000000, NULL }, -+ { 0x28, 0x0000, 0x000000, NULL }, -+ { 0x29, 0x0000, 0x0c2021, NULL }, -+ { 0x2a, 0x9040, 0x0c2028, NULL }, -+ { 0x2b, 0x904f, 0x0c2044, NULL }, -+ { 0x2c, 0x9059, 0x0c2062, NULL }, -+ { 0x2d, 0x0000, 0x000000, NULL }, -+ { 0x2e, 0x9500, 0xc11821, NULL }, -+ { 0x2f, 0x9500, 0xc11828, NULL }, -+ { 0x30, 0x950f, 0xc11844, NULL }, -+ { 0x31, 0x9519, 0xc11868, NULL }, -+ { 0x32, 0x0000, 0x000000, NULL }, - { 0x33, 0xa940, 0x000000, &vesa_modes[23] }, - { 0x34, 0xa945, 0x000000, &vesa_modes[24] }, - { 0x35, 0xa94a, 0x000000, &vesa_modes[25] }, - { 0x36, 0xa94f, 0x000000, &vesa_modes[26] }, - { 0x37, 0xa959, 0x000000, &vesa_modes[27] }, -- { 0x38, 0x0000, 0x000000, 0 }, -- { 0x39, 0x0000, 0x0c2821, 0 }, -- { 0x3a, 0xb300, 0x0c2828, 0 }, -- { 0x3b, 0xb30f, 0x0c2844, 0 }, -- { 0x3c, 0xb319, 0x0c2868, 0 }, -- { 0x3d, 0x0000, 0x000000, 0 }, -+ { 0x38, 0x0000, 0x000000, NULL }, -+ { 0x39, 0x0000, 0x0c2821, NULL }, -+ { 0x3a, 0xb300, 0x0c2828, NULL }, -+ { 0x3b, 0xb30f, 0x0c2844, NULL }, -+ { 0x3c, 0xb319, 0x0c2868, NULL }, -+ { 0x3d, 0x0000, 0x000000, NULL }, - { 0x3e, 0xc140, 0x000000, &vesa_modes[28] }, - { 0x3f, 0xc14f, 0x000000, &vesa_modes[29] }, -- { 0x40, 0x0000, 0x000000, 0 }, -+ { 0x40, 0x0000, 0x000000, NULL}, - { 0x41, 0xc940, 0x000000, &vesa_modes[30] }, - { 0x42, 0xc94f, 0x000000, &vesa_modes[31] }, -- { 0x43, 0x0000, 0x000000, 0 }, -+ { 0x43, 0x0000, 0x000000, NULL }, - { 0x44, 0x0000, 0x572821, &vesa_modes[34] }, - { 0x45, 0xd100, 0x572828, &vesa_modes[35] }, - { 0x46, 0xd10f, 0x572844, &vesa_modes[36] }, - { 0x47, 0xd119, 0x572862, &vesa_modes[37] }, -- { 0x48, 0x0000, 0x000000, 0 }, -+ { 0x48, 0x0000, 0x000000, NULL }, - { 0x49, 0xd140, 0x000000, &vesa_modes[32] }, - { 0x4a, 0xd14f, 0x000000, &vesa_modes[33] }, -- { 0x4b, 0x0000, 0x000000, 0 }, -+ { 0x4b, 0x0000, 0x000000, NULL }, - { 0x4c, 0x0000, 0x1f3821, &vesa_modes[38] }, - { 0x4d, 0x0000, 0x1f3828, &vesa_modes[39] }, - { 0x4e, 0x0000, 0x1f3844, &vesa_modes[40] }, --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-Validate-mode-timing-against-monspec.patch b/kernel/kernel/files/patches/mageia/video-fbdev-Validate-mode-timing-against-monspec.patch deleted file mode 100644 index afdf4ae1..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-Validate-mode-timing-against-monspec.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 72bbf10bf0fdaa097252149ef3a9b74c48a0d683 Mon Sep 17 00:00:00 2001 -From: David Ung -Date: Tue, 13 Jan 2015 19:04:02 -0800 -Subject: [PATCH 3/4] video: fbdev: Validate mode timing against monspec - -fbmon may generate mode timings that are out of spec of the monitor. -eg DELL U2410 has a max clock 170mhz but advertises a resolutions of -1920x1200@60 in its Standard Timings using 2byte code of D1 00. -When this is looked up in the DMT table it gives it a 193mhz clock. -Although the DELL monitor supports 1920x1200@60, it can only run with -reduced timings at 154mhz or DMT id 0x44 which has no STD 2byte code. -This patch checks to see if the mode can be supported by the monitor -by comparing against monspecs.dclkmax. - -Signed-off-by: David Ung -Signed-off-by: Tomi Valkeinen ---- - drivers/video/fbdev/core/fbmon.c | 27 ++++++++++++++++++--------- - 1 file changed, 18 insertions(+), 9 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c -index 0f234c1..9533859 100644 ---- a/drivers/video/fbdev/core/fbmon.c -+++ b/drivers/video/fbdev/core/fbmon.c -@@ -496,7 +496,7 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode) - } - - static int get_std_timing(unsigned char *block, struct fb_videomode *mode, -- int ver, int rev) -+ int ver, int rev, const struct fb_monspecs *specs) - { - int i; - -@@ -544,16 +544,23 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode, - calc_mode_timings(xres, yres, refresh, mode); - } - -+ /* Check the mode we got is within valid spec of the monitor */ -+ if (specs && specs->dclkmax -+ && PICOS2KHZ(mode->pixclock) * 1000 > specs->dclkmax) { -+ DPRINTK(" mode exceed max DCLK\n"); -+ return 0; -+ } -+ - return 1; - } - --static int get_dst_timing(unsigned char *block, -- struct fb_videomode *mode, int ver, int rev) -+static int get_dst_timing(unsigned char *block, struct fb_videomode *mode, -+ int ver, int rev, const struct fb_monspecs *specs) - { - int j, num = 0; - - for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE) -- num += get_std_timing(block, &mode[num], ver, rev); -+ num += get_std_timing(block, &mode[num], ver, rev, specs); - - return num; - } -@@ -609,7 +616,8 @@ static void get_detailed_timing(unsigned char *block, - * This function builds a mode database using the contents of the EDID - * data - */ --static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) -+static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, -+ const struct fb_monspecs *specs) - { - struct fb_videomode *mode, *m; - unsigned char *block; -@@ -651,12 +659,13 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) - DPRINTK(" Standard Timings\n"); - block = edid + STD_TIMING_DESCRIPTIONS_START; - for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE) -- num += get_std_timing(block, &mode[num], ver, rev); -+ num += get_std_timing(block, &mode[num], ver, rev, specs); - - block = edid + DETAILED_TIMING_DESCRIPTIONS_START; - for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { - if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa) -- num += get_dst_timing(block + 5, &mode[num], ver, rev); -+ num += get_dst_timing(block + 5, &mode[num], -+ ver, rev, specs); - } - - /* Yikes, EDID data is totally useless */ -@@ -715,7 +724,7 @@ static int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs) - int num_modes, hz, hscan, pixclock; - int vtotal, htotal; - -- modes = fb_create_modedb(edid, &num_modes); -+ modes = fb_create_modedb(edid, &num_modes, specs); - if (!modes) { - DPRINTK("None Available\n"); - return 1; -@@ -972,7 +981,7 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) - DPRINTK(" Display Characteristics:\n"); - get_monspecs(edid, specs); - -- specs->modedb = fb_create_modedb(edid, &specs->modedb_len); -+ specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs); - - /* - * Workaround for buggy EDIDs that sets that the first --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-fix-CVT-vertical-front-and-back-porch-values.patch b/kernel/kernel/files/patches/mageia/video-fbdev-fix-CVT-vertical-front-and-back-porch-values.patch deleted file mode 100644 index fdcd789f..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-fix-CVT-vertical-front-and-back-porch-values.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4d073292a74b31ea00443d7778a95c209140aa42 Mon Sep 17 00:00:00 2001 -From: Tomi Valkeinen -Date: Wed, 21 Jan 2015 09:37:51 +0200 -Subject: [PATCH] fbdev: fix CVT vertical front and back porch values - -CVT v1.1 spec says: "the vertical front porch shall in all cases be -fixed to 3 lines". The code in fbcvt.c instead sets the _back_ porch to -3 (plus margin). - -After swapping cvt.v_front_porch and cvt.v_back_porch the resulting -timings were in line with CVT timings in VESA DMT spec. - -The bug seems to be more than 9 years old, but I presume it has not been -noticed as usually the video timings come from the EDID or from the -timing tables in fbdev, and probably swapped values for vfp and vbp work -fine for most of the displays. - -Signed-off-by: Tomi Valkeinen -Acked-by: David Ung -Cc: Antonino A. Daplas ---- - drivers/video/fbdev/core/fbcvt.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbcvt.c b/drivers/video/fbdev/core/fbcvt.c -index 7cb715d..55d2bd0 100644 ---- a/drivers/video/fbdev/core/fbcvt.c -+++ b/drivers/video/fbdev/core/fbcvt.c -@@ -369,9 +369,9 @@ int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb) - cvt.h_back_porch = cvt.hblank/2 + cvt.h_margin; - cvt.h_front_porch = cvt.hblank - cvt.hsync - cvt.h_back_porch + - 2 * cvt.h_margin; -- cvt.v_back_porch = 3 + cvt.v_margin; -- cvt.v_front_porch = cvt.vtotal - cvt.yres/cvt.interlace - -- cvt.v_back_porch - cvt.vsync; -+ cvt.v_front_porch = 3 + cvt.v_margin; -+ cvt.v_back_porch = cvt.vtotal - cvt.yres/cvt.interlace - -+ cvt.v_front_porch - cvt.vsync; - fb_cvt_print_name(&cvt); - fb_cvt_convert_to_mode(&cvt, mode); - --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-fix-possible-null-dereference.patch b/kernel/kernel/files/patches/mageia/video-fbdev-fix-possible-null-dereference.patch deleted file mode 100644 index 0131de78..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-fix-possible-null-dereference.patch +++ /dev/null @@ -1,42 +0,0 @@ -From d746b40c64619f5064ebbe545938062481ef5183 Mon Sep 17 00:00:00 2001 -From: Sudip Mukherjee -Date: Thu, 12 Feb 2015 21:17:11 +0530 -Subject: [PATCH] video: fbdev: fix possible null dereference - -we were dereferencing edid first and the NULL check was after -accessing that. now we are using edid only if we know that -it is not NULL. - -Signed-off-by: Sudip Mukherjee -Signed-off-by: Tomi Valkeinen ---- - drivers/video/fbdev/core/fbmon.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c -index 9533859..868facd 100644 ---- a/drivers/video/fbdev/core/fbmon.c -+++ b/drivers/video/fbdev/core/fbmon.c -@@ -624,9 +624,6 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, - int num = 0, i, first = 1; - int ver, rev; - -- ver = edid[EDID_STRUCT_VERSION]; -- rev = edid[EDID_STRUCT_REVISION]; -- - mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL); - if (mode == NULL) - return NULL; -@@ -637,6 +634,9 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize, - return NULL; - } - -+ ver = edid[EDID_STRUCT_VERSION]; -+ rev = edid[EDID_STRUCT_REVISION]; -+ - *dbsize = 0; - - DPRINTK(" Detailed Timings\n"); --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/video-fbdev-fix-sys_copyarea.patch b/kernel/kernel/files/patches/mageia/video-fbdev-fix-sys_copyarea.patch deleted file mode 100644 index 03c3dc6d..00000000 --- a/kernel/kernel/files/patches/mageia/video-fbdev-fix-sys_copyarea.patch +++ /dev/null @@ -1,332 +0,0 @@ -From ee06bd155b081a1895f995ec2777094c7e746152 Mon Sep 17 00:00:00 2001 -From: Mans Rullgard -Date: Thu, 22 Jan 2015 01:19:24 +0000 -Subject: [PATCH] video: fbdev: fix sys_copyarea - -The sys_copyarea() function performs the same operation as -cfb_copyarea() but using normal memory access instead of I/O -accessors. Since the introduction of sys_copyarea(), there -have been two fixes to cfb_copyarea(): - -- 00a9d699 ("framebuffer: fix cfb_copyarea") -- 5b789da8 ("framebuffer: fix screen corruption when copying") - -This patch incorporates the fixes into sys_copyarea() as well. - -Signed-off-by: Mans Rullgard -Signed-off-by: Tomi Valkeinen ---- - drivers/video/fbdev/core/syscopyarea.c | 137 ++++++++++++++++----------------- - 1 file changed, 65 insertions(+), 72 deletions(-) - -diff --git a/drivers/video/fbdev/core/syscopyarea.c b/drivers/video/fbdev/core/syscopyarea.c -index 844a32f..c1eda31 100644 ---- a/drivers/video/fbdev/core/syscopyarea.c -+++ b/drivers/video/fbdev/core/syscopyarea.c -@@ -25,8 +25,8 @@ - */ - - static void --bitcpy(struct fb_info *p, unsigned long *dst, int dst_idx, -- const unsigned long *src, int src_idx, int bits, unsigned n) -+bitcpy(struct fb_info *p, unsigned long *dst, unsigned dst_idx, -+ const unsigned long *src, unsigned src_idx, int bits, unsigned n) - { - unsigned long first, last; - int const shift = dst_idx-src_idx; -@@ -86,15 +86,15 @@ bitcpy(struct fb_info *p, unsigned long *dst, int dst_idx, - first &= last; - if (shift > 0) { - /* Single source word */ -- *dst = comp(*src >> right, *dst, first); -+ *dst = comp(*src << left, *dst, first); - } else if (src_idx+n <= bits) { - /* Single source word */ -- *dst = comp(*src << left, *dst, first); -+ *dst = comp(*src >> right, *dst, first); - } else { - /* 2 source words */ - d0 = *src++; - d1 = *src; -- *dst = comp(d0 << left | d1 >> right, *dst, -+ *dst = comp(d0 >> right | d1 << left, *dst, - first); - } - } else { -@@ -109,13 +109,14 @@ bitcpy(struct fb_info *p, unsigned long *dst, int dst_idx, - /* Leading bits */ - if (shift > 0) { - /* Single source word */ -- *dst = comp(d0 >> right, *dst, first); -+ *dst = comp(d0 << left, *dst, first); - dst++; - n -= bits - dst_idx; - } else { - /* 2 source words */ - d1 = *src++; -- *dst = comp(d0 << left | *dst >> right, *dst, first); -+ *dst = comp(d0 >> right | d1 << left, *dst, -+ first); - d0 = d1; - dst++; - n -= bits - dst_idx; -@@ -126,36 +127,36 @@ bitcpy(struct fb_info *p, unsigned long *dst, int dst_idx, - n /= bits; - while (n >= 4) { - d1 = *src++; -- *dst++ = d0 << left | d1 >> right; -+ *dst++ = d0 >> right | d1 << left; - d0 = d1; - d1 = *src++; -- *dst++ = d0 << left | d1 >> right; -+ *dst++ = d0 >> right | d1 << left; - d0 = d1; - d1 = *src++; -- *dst++ = d0 << left | d1 >> right; -+ *dst++ = d0 >> right | d1 << left; - d0 = d1; - d1 = *src++; -- *dst++ = d0 << left | d1 >> right; -+ *dst++ = d0 >> right | d1 << left; - d0 = d1; - n -= 4; - } - while (n--) { - d1 = *src++; -- *dst++ = d0 << left | d1 >> right; -+ *dst++ = d0 >> right | d1 << left; - d0 = d1; - } - - /* Trailing bits */ -- if (last) { -- if (m <= right) { -+ if (m) { -+ if (m <= bits - right) { - /* Single source word */ -- *dst = comp(d0 << left, *dst, last); -+ d0 >>= right; - } else { - /* 2 source words */ - d1 = *src; -- *dst = comp(d0 << left | d1 >> right, -- *dst, last); -+ d0 = d0 >> right | d1 << left; - } -+ *dst = comp(d0, *dst, last); - } - } - } -@@ -166,40 +167,35 @@ bitcpy(struct fb_info *p, unsigned long *dst, int dst_idx, - */ - - static void --bitcpy_rev(struct fb_info *p, unsigned long *dst, int dst_idx, -- const unsigned long *src, int src_idx, int bits, unsigned n) -+bitcpy_rev(struct fb_info *p, unsigned long *dst, unsigned dst_idx, -+ const unsigned long *src, unsigned src_idx, unsigned bits, -+ unsigned n) - { - unsigned long first, last; - int shift; - -- dst += (n-1)/bits; -- src += (n-1)/bits; -- if ((n-1) % bits) { -- dst_idx += (n-1) % bits; -- dst += dst_idx >> (ffs(bits) - 1); -- dst_idx &= bits - 1; -- src_idx += (n-1) % bits; -- src += src_idx >> (ffs(bits) - 1); -- src_idx &= bits - 1; -- } -+ dst += (dst_idx + n - 1) / bits; -+ src += (src_idx + n - 1) / bits; -+ dst_idx = (dst_idx + n - 1) % bits; -+ src_idx = (src_idx + n - 1) % bits; - - shift = dst_idx-src_idx; - -- first = FB_SHIFT_LOW(p, ~0UL, bits - 1 - dst_idx); -- last = ~(FB_SHIFT_LOW(p, ~0UL, bits - 1 - ((dst_idx-n) % bits))); -+ first = ~FB_SHIFT_HIGH(p, ~0UL, (dst_idx + 1) % bits); -+ last = FB_SHIFT_HIGH(p, ~0UL, (bits + dst_idx + 1 - n) % bits); - - if (!shift) { - /* Same alignment for source and dest */ - if ((unsigned long)dst_idx+1 >= n) { - /* Single word */ -- if (last) -- first &= last; -- *dst = comp(*src, *dst, first); -+ if (first) -+ last &= first; -+ *dst = comp(*src, *dst, last); - } else { - /* Multiple destination words */ - - /* Leading bits */ -- if (first != ~0UL) { -+ if (first) { - *dst = comp(*src, *dst, first); - dst--; - src--; -@@ -222,29 +218,29 @@ bitcpy_rev(struct fb_info *p, unsigned long *dst, int dst_idx, - while (n--) - *dst-- = *src--; - /* Trailing bits */ -- if (last) -+ if (last != -1UL) - *dst = comp(*src, *dst, last); - } - } else { - /* Different alignment for source and dest */ - -- int const left = -shift & (bits-1); -- int const right = shift & (bits-1); -+ int const left = shift & (bits-1); -+ int const right = -shift & (bits-1); - - if ((unsigned long)dst_idx+1 >= n) { - /* Single destination word */ -- if (last) -- first &= last; -+ if (first) -+ last &= first; - if (shift < 0) { - /* Single source word */ -- *dst = comp(*src << left, *dst, first); -+ *dst = comp(*src >> right, *dst, last); - } else if (1+(unsigned long)src_idx >= n) { - /* Single source word */ -- *dst = comp(*src >> right, *dst, first); -+ *dst = comp(*src << left, *dst, last); - } else { - /* 2 source words */ -- *dst = comp(*src >> right | *(src-1) << left, -- *dst, first); -+ *dst = comp(*src << left | *(src-1) >> right, -+ *dst, last); - } - } else { - /* Multiple destination words */ -@@ -261,14 +257,18 @@ bitcpy_rev(struct fb_info *p, unsigned long *dst, int dst_idx, - /* Leading bits */ - if (shift < 0) { - /* Single source word */ -- *dst = comp(d0 << left, *dst, first); -+ d1 = d0; -+ d0 >>= right; - } else { - /* 2 source words */ - d1 = *src--; -- *dst = comp(d0 >> right | d1 << left, *dst, -- first); -- d0 = d1; -+ d0 = d0 << left | d1 >> right; - } -+ if (!first) -+ *dst = d0; -+ else -+ *dst = comp(d0, *dst, first); -+ d0 = d1; - dst--; - n -= dst_idx+1; - -@@ -277,36 +277,36 @@ bitcpy_rev(struct fb_info *p, unsigned long *dst, int dst_idx, - n /= bits; - while (n >= 4) { - d1 = *src--; -- *dst-- = d0 >> right | d1 << left; -+ *dst-- = d0 << left | d1 >> right; - d0 = d1; - d1 = *src--; -- *dst-- = d0 >> right | d1 << left; -+ *dst-- = d0 << left | d1 >> right; - d0 = d1; - d1 = *src--; -- *dst-- = d0 >> right | d1 << left; -+ *dst-- = d0 << left | d1 >> right; - d0 = d1; - d1 = *src--; -- *dst-- = d0 >> right | d1 << left; -+ *dst-- = d0 << left | d1 >> right; - d0 = d1; - n -= 4; - } - while (n--) { - d1 = *src--; -- *dst-- = d0 >> right | d1 << left; -+ *dst-- = d0 << left | d1 >> right; - d0 = d1; - } - - /* Trailing bits */ -- if (last) { -- if (m <= left) { -+ if (m) { -+ if (m <= bits - left) { - /* Single source word */ -- *dst = comp(d0 >> right, *dst, last); -+ d0 <<= left; - } else { - /* 2 source words */ - d1 = *src; -- *dst = comp(d0 >> right | d1 << left, -- *dst, last); -+ d0 = d0 << left | d1 >> right; - } -+ *dst = comp(d0, *dst, last); - } - } - } -@@ -317,9 +317,9 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) - u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; - u32 height = area->height, width = area->width; - unsigned long const bits_per_line = p->fix.line_length*8u; -- unsigned long *dst = NULL, *src = NULL; -+ unsigned long *base = NULL; - int bits = BITS_PER_LONG, bytes = bits >> 3; -- int dst_idx = 0, src_idx = 0, rev_copy = 0; -+ unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; - - if (p->state != FBINFO_STATE_RUNNING) - return; -@@ -334,8 +334,7 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) - - /* split the base of the framebuffer into a long-aligned address and - the index of the first bit */ -- dst = src = (unsigned long *)((unsigned long)p->screen_base & -- ~(bytes-1)); -+ base = (unsigned long *)((unsigned long)p->screen_base & ~(bytes-1)); - dst_idx = src_idx = 8*((unsigned long)p->screen_base & (bytes-1)); - /* add offset of source and target area */ - dst_idx += dy*bits_per_line + dx*p->var.bits_per_pixel; -@@ -348,20 +347,14 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) - while (height--) { - dst_idx -= bits_per_line; - src_idx -= bits_per_line; -- dst += dst_idx >> (ffs(bits) - 1); -- dst_idx &= (bytes - 1); -- src += src_idx >> (ffs(bits) - 1); -- src_idx &= (bytes - 1); -- bitcpy_rev(p, dst, dst_idx, src, src_idx, bits, -+ bitcpy_rev(p, base + (dst_idx / bits), dst_idx % bits, -+ base + (src_idx / bits), src_idx % bits, bits, - width*p->var.bits_per_pixel); - } - } else { - while (height--) { -- dst += dst_idx >> (ffs(bits) - 1); -- dst_idx &= (bytes - 1); -- src += src_idx >> (ffs(bits) - 1); -- src_idx &= (bytes - 1); -- bitcpy(p, dst, dst_idx, src, src_idx, bits, -+ bitcpy(p, base + (dst_idx / bits), dst_idx % bits, -+ base + (src_idx / bits), src_idx % bits, bits, - width*p->var.bits_per_pixel); - dst_idx += bits_per_line; - src_idx += bits_per_line; --- -2.3.1 - diff --git a/kernel/kernel/files/patches/mageia/x86-efi-Store-upper-bits-of-command-line-buffer-addr.patch b/kernel/kernel/files/patches/mageia/x86-efi-Store-upper-bits-of-command-line-buffer-addr.patch deleted file mode 100644 index 8120a59d..00000000 --- a/kernel/kernel/files/patches/mageia/x86-efi-Store-upper-bits-of-command-line-buffer-addr.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 98b228f55014870092c15d7d168fecac69f2f12a Mon Sep 17 00:00:00 2001 -From: Roy Franz -Date: Wed, 15 Apr 2015 16:32:24 -0700 -Subject: [PATCH] x86/efi: Store upper bits of command line buffer address in - ext_cmd_line_ptr - -Until now, the EFI stub was only setting the 32 bit cmd_line_ptr in -the setup_header structure, so on 64 bit platforms this could be truncated. -This patch adds setting the upper bits of the buffer address in -ext_cmd_line_ptr. This case was likely never hit, as the allocation -for this buffer is done at the lowest available address. Only -x86_64 kernels have this problem, as the 1-1 mapping mandated -by EFI ensures that all memory is 32 bit addressable on 32 bit -platforms. The EFI stub does not support mixed mode, so the -32 bit kernel on 64 bit firmware case does not need to be handled. - -Signed-off-by: Roy Franz -Cc: -Signed-off-by: Matt Fleming ---- - arch/x86/boot/compressed/eboot.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c -index 92b9a5f..5999980 100644 ---- a/arch/x86/boot/compressed/eboot.c -+++ b/arch/x86/boot/compressed/eboot.c -@@ -1110,6 +1110,8 @@ struct boot_params *make_boot_params(struct efi_config *c) - if (!cmdline_ptr) - goto fail; - hdr->cmd_line_ptr = (unsigned long)cmdline_ptr; -+ /* Fill in upper bits of command line address, NOP on 32 bit */ -+ boot_params->ext_cmd_line_ptr = (u64)(unsigned long)cmdline_ptr >> 32; - - hdr->ramdisk_image = 0; - hdr->ramdisk_size = 0; --- -2.3.2 - diff --git a/kernel/kernel/files/patches/mageia/x86-spinlocks-Fix-regression-in-spinlock-contention-.patch b/kernel/kernel/files/patches/mageia/x86-spinlocks-Fix-regression-in-spinlock-contention-.patch deleted file mode 100644 index fb41fb52..00000000 --- a/kernel/kernel/files/patches/mageia/x86-spinlocks-Fix-regression-in-spinlock-contention-.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e8a4a2696fecb398b0288c43c0e0dbb91e265bb2 Mon Sep 17 00:00:00 2001 -From: Tahsin Erdogan -Date: Mon, 4 May 2015 21:15:31 -0700 -Subject: [PATCH] x86/spinlocks: Fix regression in spinlock contention - detection - -A spinlock is regarded as contended when there is at least one waiter. -Currently, the code that checks whether there are any waiters rely on -tail value being greater than head. However, this is not true if tail -reaches the max value and wraps back to zero, so arch_spin_is_contended() -incorrectly returns 0 (not contended) when tail is smaller than head. - -The original code (before regression) handled this case by casting the -(tail - head) to an unsigned value. This change simply restores that -behavior. - -Fixes: d6abfdb20223 ("x86/spinlocks/paravirt: Fix memory corruption on unlock") -Signed-off-by: Tahsin Erdogan -Cc: peterz@infradead.org -Cc: Waiman.Long@hp.com -Cc: borntraeger@de.ibm.com -Cc: oleg@redhat.com -Cc: raghavendra.kt@linux.vnet.ibm.com -Cc: stable@vger.kernel.org -Link: http://lkml.kernel.org/r/1430799331-20445-1-git-send-email-tahsin@google.com -Signed-off-by: Thomas Gleixner ---- - arch/x86/include/asm/spinlock.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h -index cf87de3..64b6117 100644 ---- a/arch/x86/include/asm/spinlock.h -+++ b/arch/x86/include/asm/spinlock.h -@@ -169,7 +169,7 @@ static inline int arch_spin_is_contended(arch_spinlock_t *lock) - struct __raw_tickets tmp = READ_ONCE(lock->tickets); - - tmp.head &= ~TICKET_SLOWPATH_FLAG; -- return (tmp.tail - tmp.head) > TICKET_LOCK_INC; -+ return (__ticket_t)(tmp.tail - tmp.head) > TICKET_LOCK_INC; - } - #define arch_spin_is_contended arch_spin_is_contended - --- -2.3.2 - diff --git a/kernel/kernel/pspec.xml b/kernel/kernel/pspec.xml index 31f0d150..8414ec38 100644 --- a/kernel/kernel/pspec.xml +++ b/kernel/kernel/pspec.xml @@ -29,12 +29,68 @@ i patches/linux/patch-4.1.xz - - - - - - + patches/mageia/x86-pci-toshiba-equium-a60-assign-busses.patch + patches/mageia/x86-boot-video-80x25-if-break.patch + patches/mageia/x86-default_poweroff_up_machines.patch + patches/mageia/x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch + patches/mageia/pci-add-ALI-M5229-ide-compatibility-mode-quirk.patch + patches/mageia/pci-quirks-drop-devinit-exit.patch + patches/mageia/acpi-CLEVO-M360S-disable_acpi_irq.patch + patches/mageia/acpi-processor-M720SR-limit-to-C2.patch + patches/mageia/scsi-ppscsi-2.6.2.patch + patches/mageia/scsi-ppscsi_fixes.patch + patches/mageia/scsi-ppscsi-sg-helper-update.patch + patches/mageia/scsi-ppscsi-update-for-scsi_data_buffer.patch + patches/mageia/scsi-ppscsi-mdvbz45393.patch + patches/mageia/scsi-ppscsi-3.0-buildfix.patch + patches/mageia/scsi-megaraid-new-sysfs-name.patch + patches/mageia/ide-pci-sis5513-965.patch + patches/mageia/mpt-vmware-fix.patch + patches/mageia/dm-raid-aliases.patch + patches/mageia/block-floppy-disable-pnp-modalias.patch + patches/mageia/ata-prefer-ata-drivers-over-ide-drivers-when-both-are-built.patch + patches/mageia/ata-jmicron-disable-broken-async_suspend.patch + patches/mageia/firewire-ieee1394-module-aliases.patch + patches/mageia/char-agp-intel-new-Q57-id.patch + patches/mageia/gpu-drm-mach64.patch + patches/mageia/gpu-drm-mach64-fixes.patch + patches/mageia/gpu-drm-mach64-2.6.31.patch + patches/mageia/gpu-drm-mach64-fix-for-changed-drm_pci_alloc.patch + patches/mageia/gpu-drm-mach64-fix-for-changed-drm_ioctl.patch + patches/mageia/gpu-drm-mach64-2.6.36-buildfix.patch + patches/mageia/gpu-drm-mach64-2.6.37-buildfix.patch + patches/mageia/gpu-drm-mach64-3.0-buildfix.patch + patches/mageia/gpu-drm-mach64-include-module.h.patch + patches/mageia/gpu-drm-mach64-3.3-buildfix.patch + patches/mageia/gpu-drm-mach64-3.6-buildfix.patch + patches/mageia/gpu-drm-mach64-3.7-buildfix.patch + patches/mageia/gpu-drm-mach64-3.12-buildfix.patch + patches/mageia/gpu-drm-mach64-restore-mach64_PCI_IDS.patch + patches/mageia/gpu-drm-mach64-linux-3.14-buildfix.patch + patches/mageia/gpu-drm-mach64-3.17-buildfix.patch + patches/mageia/gpu-drm-mach64-3.18-buildfix.patch + patches/mageia/input-i8042-quirks-for-Fujitsu-Lifebook-A544-and-Lif.patch + patches/mageia/net-sis190-fix-list-usage.patch + patches/mageia/net-netfilter-IFWLOG.patch + patches/mageia/net-netfilter-IFWLOG-mdv.patch + patches/mageia/net-netfilter-IFWLOG-2.6.35-buildfix.patch + patches/mageia/net-netfilter-IFWLOG-2.6.37-buildfix.patch + patches/mageia/net-ipv4-netfilter-ipt_IFWLOG-3.6-buildfix.patch + patches/mageia/net-netfilter-IFWLOG-3.7-buildfix.patch + patches/mageia/net-netfilter-psd.patch + patches/mageia/net-netfilter-psd-mdv.patch + patches/mageia/net-netfilter-psd-2.6.35-buildfix.patch + patches/mageia/platform-x86-add-shuttle-wmi-driver.patch + patches/mageia/platform-x86-shuttle-wmi-drop-devinit-exit.patch + patches/mageia/include-kbuild-export-pci_ids.patch + patches/mageia/hid-usbhid-IBM-BladeCenterHS20-quirk.patch + patches/mageia/usb-storage-unusual_devs-add-id.patch + patches/mageia/usb-storage-unusual_devs-add-id-2.6.37-buildfix.patch + patches/mageia/media-usb-pwc-lie-in-proc-usb-devices.patch + patches/mageia/3rd-3rdparty-1.0-tree.patch + patches/mageia/3rd-3rdparty-merge.patch + patches/mageia/3rd-acerhk-0.5.35.patch patches/mageia/3rd-acerhk-kbuild.patch patches/mageia/3rd-acerhk-extra-cflags.patch patches/mageia/3rd-acerhk-proc_dir_entry-owner.patch @@ -53,10 +109,25 @@ i patches/mageia/3rd-viahss-module-license.patch patches/mageia/3rd-viahss-2.6.35-buildfix.patch patches/mageia/3rd-viahss-3.0-buildfix.patch + patches/mageia/3rd-rtl8723bs.patch patches/mageia/3rd-rtl8723bs-buildfix.patch patches/mageia/3rd-rtl8723bs-updates.patch - patches/mageia/3rd-rtl8723bs-revert-4.0-changes.patch--> + + patches/mageia/Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch + + patches/mageia/pci-acs-quirks-for-Intel-9-series-PCH-root-ports.patch + + patches/mageia/ata-revert-Disabling-the-async-PM-for-JMicron-chip-363-361.patch + + patches/mageia/media-Fix-regression-in-some-more-dib0700-based-devi.patch + + patches/mageia/3rd-ndiswrapper-4.0-buildfix.patch + patches/mageia/block-Make-CFQ-default-to-IOPS-mode-on-SSDs.patch + patches/mageia/block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch + patches/mageia/fs-aufs4.patch + patches/mageia/fs-aufs4-modular.patch + diff --git a/kernel/tools/cpupowertools/files/patches/linux/patch-4.0.6.xz b/kernel/tools/cpupowertools/files/patches/linux/patch-4.0.6.xz new file mode 100644 index 00000000..97f74bc2 Binary files /dev/null and b/kernel/tools/cpupowertools/files/patches/linux/patch-4.0.6.xz differ diff --git a/kernel/tools/cpupowertools/pspec.xml b/kernel/tools/cpupowertools/pspec.xml index 2f0fd009..3b05d982 100644 --- a/kernel/tools/cpupowertools/pspec.xml +++ b/kernel/tools/cpupowertools/pspec.xml @@ -18,7 +18,7 @@ - patches/linux/patch-4.0.5.xz + patches/linux/patch-4.0.6.xz @@ -44,6 +44,13 @@ --> + + 2015-06-24 + 4.0.6 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2015-06-16 4.0.5 diff --git a/pisi-index.xml b/pisi-index.xml index 7587304c..1c672f19 100644 --- a/pisi-index.xml +++ b/pisi-index.xml @@ -561,7 +561,7 @@ xmlto - patches/linux/patch-4.0.5.xz + patches/linux/patch-4.0.6.xz patches/pisilinux_aufs4-standalone.patch kernel/kernel/pspec.xml @@ -621,6 +621,14 @@ + + security + 2015-06-23 + 4.0.6 + Version bump to 4.0.6 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.0.6 + Ertuğrul Erata + ertugrulerata@gmail.com + security 2015-05-14 @@ -2792,6 +2800,7 @@ kernel-module-headers + patch/linux-40.patch patch/linux-recent.patch patch/license.patch patch/gcc.patch @@ -3398,7 +3407,6 @@ help2man texinfo freetype-devel - freetype zlib-devel ncurses-devel xz-devel @@ -10181,289 +10189,6 @@ - - - udev - http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html - - PisiLinux Community - admins@pisilinux.org - - GPLv2 - app:console - system.base - Linux dynamic and persistent device naming support - Linux dinamik ve sürekli aygıt isimlendirme desteği (kernel dışındaki devfs) - udev permet aux utilisateurs Linux d'avoir un répertoire /dev dynamique et donne la possibilité d'avoir des noms de périphériques persistants. - udev allows Linux users to have a dynamic /dev directory and it provides the ability to have persistent device names. - udev linux kullanıcılarının dinamik /dev dizinine sahip olmalarına olanek verir ve tutarlı cihaz isimleri almasını sağlar. - udev ermöglicht Linux Benutzern ein dynamisches /dev Verzeichnis und beständige Gerätenamen - http://www.freedesktop.org/software/systemd/systemd-214.tar.xz - - glib2-devel - gperf - acl-devel - libkmod-devel - libutil-linux-devel - - system/base/udev/pspec.xml - - - udev - - libudev - acl - libkmod - libutil-linux - util-linux - - - /bin - /sbin - /usr/bin - /usr/sbin - /lib/udev - /lib - /usr/lib - /etc - /usr/lib/tmpfiles.d/udev.conf - /run/udev - /lib/systemd - /etc/udev/rules.d - /lib/udev/rules.d - /usr/share/dbus-1/services - /usr/share/bash-completion/completions - /usr/share/doc - /usr/share/man - - - System.Package - - - tmpfiles.conf - - - - udev-devel - Development files for udev - system.devel - - udev - - - /usr/include/systemd/sd-daemon.h - /usr/lib32/pkgconfig/libsystemd-daemon.pc - /usr/lib/pkgconfig/libsystemd-daemon.pc - /usr/share/pkgconfig/udev.pc - - - - libudev - Dynamic library to access udev device information - udev aygıt bilgilerini sunan kitaplık - - /usr/lib/libudev* - /lib/libudev* - - - udev - - - - libudev-devel - Development files for libudev - libudev için geliştirme dosyaları - system.devel - - udev - libudev - - - /usr/include/libudev.h - /usr/lib/pkgconfig/libudev.pc - /usr/lib32/pkgconfig/libudev.pc - /usr/share/gtk-doc/html/libudev - - - - libgudev1 - Libraries for adding libudev support to applications that use glib - glib kullanan uygulamalara libudev desteği eklemek için kullanılan kitaplık - - glib2 - libudev - - - /usr/lib/libgudev* - - - - libgudev1-devel - Development files for libgudev1 - libgudev1 için geliştirme dosyaları - system.devel - - libudev-devel - libgudev1 - - - /usr/include/gudev-1.0 - /usr/lib/pkgconfig/gudev-1.0* - /usr/lib32/pkgconfig/gudev-1.0* - /usr/share/gir-1.0/GUdev-1.0.gir - /usr/share/gtk-doc/html/gudev - - - - libudev-32bit - 32-bit shared libraries for libudev - udev için 32-bit paylaşımlı kitaplıklar - emul32 - emul32 - - libkmod-32bit - libutil-linux-32bit - - - libudev - - - /usr/lib32/libudev* - /lib32/libudev* - - - - libgudev1-32bit - 32-bit shared libraries for libgudev1 - emul32 - emul32 - - glib2-32bit - - - libgudev1 - libudev-32bit - glib2-32bit - - - /usr/lib32/libgudev* - - - - - 2015-05-01 - 214 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-05-11 - 212 - Add upstream patches. - Marcin Bojara - marcin@pisilinux.org - - - 2014-03-28 - 212 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-03-12 - 211 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-03-07 - 210 - Rebuild. - Marcin Bojara - marcin@pisilinux.org - - - 2014-02-26 - 210 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-02-20 - 209 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-01-11 - 208 - Add tmpfiles.conf, git updates. - Marcin Bojara - marcin@pisilinux.org - - - 2013-10-30 - 208 - Version bump. - Serdar Soytetir - kaptan@pisilinux.org - - - 2013-09-10 - 206 - Add /run/udev directory. - Marcin Bojara - marcin@pisilinux.org - - - 2013-08-13 - 206 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-07-28 - 204 - Fix pc files for emul32. - Marcin Bojara - marcin@pisilinux.org - - - 2013-06-13 - 204 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-03-30 - 200 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-01-24 - 197 - Version bump, add emul32 - Marcin Bojara - marcin@pisilinux.org - - - 2012-10-11 - 194 - First release - Erdem Artan - admins@pisilinux.org - - - bc @@ -18007,7 +17732,7 @@ Python için C eklentileri Cython is a language that makes writing C extensions for the Python language as easy as Python itself. Cython, Python için C eklentileri yazmayı kolaylaştıran bir dildir. - http://www.cython.org/release/Cython-0.22.tar.gz + http://www.cython.org/release/Cython-0.22.1.tar.gz python-devel @@ -18025,6 +17750,13 @@ + + 2015-06-22 + 0.22.1 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2015-02-16 0.22 @@ -22435,6 +22167,7 @@ Development files for freetype freetype için geliştirme dosyaları + freetype zlib-devel libpng-devel diff --git a/pisi-index.xml.sha1sum b/pisi-index.xml.sha1sum index 0b32182c..e223a64c 100644 --- a/pisi-index.xml.sha1sum +++ b/pisi-index.xml.sha1sum @@ -1 +1 @@ -e5677470550b4aa950a602fdcf0c4c7696e70647 \ No newline at end of file +7bd92798e90fd0447b579d2cc0a9c88c5d2eb811 \ No newline at end of file diff --git a/pisi-index.xml.xz b/pisi-index.xml.xz index 8cd86eb4..48bccd21 100644 Binary files a/pisi-index.xml.xz and b/pisi-index.xml.xz differ diff --git a/pisi-index.xml.xz.sha1sum b/pisi-index.xml.xz.sha1sum index f3b513d1..57918d70 100644 --- a/pisi-index.xml.xz.sha1sum +++ b/pisi-index.xml.xz.sha1sum @@ -1 +1 @@ -c10f657c464b0f3ff3cbc607920689be3f937af2 \ No newline at end of file +893dd8496029b27aa345b268994cab48b1936f74 \ No newline at end of file diff --git a/system/base/glibc/pspec.xml b/system/base/glibc/pspec.xml index e800ec97..c0f0bad4 100644 --- a/system/base/glibc/pspec.xml +++ b/system/base/glibc/pspec.xml @@ -65,7 +65,7 @@ glibc-devel system.devel - glibc + glibc /usr/include diff --git a/system/base/libidn/pspec.xml b/system/base/libidn/pspec.xml index ce45c4b3..a8885877 100644 --- a/system/base/libidn/pspec.xml +++ b/system/base/libidn/pspec.xml @@ -38,7 +38,7 @@ glibc-32bit - libidn + libidn /usr/include diff --git a/system/base/udev/actions.py b/system/base/udev/actions.py deleted file mode 100644 index e188082f..00000000 --- a/system/base/udev/actions.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Licensed under the GNU General Public License, version 3. -# See the file http://www.gnu.org/licenses/gpl.txt - -from pisi.actionsapi import get -from pisi.actionsapi import libtools -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools -from pisi.actionsapi import shelltools - -suffix = "32" if get.buildTYPE() == "emul32" else "" - -def setup(): - pisitools.flags.add("-fno-lto") - #shelltools.echo("docs/gtk-doc.make", "EXTRA_DIST=") - autotools.autoreconf("-fi") - libtools.libtoolize("--force") - - options = " ac_cv_header_sys_capability_h=yes \ - --bindir=/sbin%s \ - --sbindir=/sbin%s \ - --docdir=/usr/share/doc/udev \ - --libdir=/usr/lib%s \ - --libexecdir=/lib%s/udev \ - --with-firmware-path=/lib%s/firmware/updates:/lib%s/firmware \ - --with-html-dir=/usr/share/doc/udev/html \ - --with-rootlibdir=/lib%s \ - --with-rootprefix= \ - --without-python \ - --disable-xz \ - --disable-nls \ - --disable-pam \ - --disable-dbus \ - --disable-audit \ - --disable-gcrypt \ - --disable-gnutls \ - --disable-logind \ - --disable-polkit \ - --disable-seccomp \ - --disable-selinux \ - --disable-qrencode \ - --disable-readahead \ - --disable-microhttpd \ - --disable-myhostname \ - --disable-quotacheck \ - --disable-python-devel \ - --disable-libcryptsetup \ - --enable-gudev \ - --enable-split-usr \ - " % ((suffix, )*7) - - options += "\ - --disable-acl \ - --disable-kmod \ - --disable-static \ - --disable-manpages \ - --disable-gtk-doc \ - --disable-introspection \ - " if get.buildTYPE() == "emul32" else \ - "\ - --enable-acl \ - --enable-kmod \ - --enable-static \ - --enable-introspection \ - " - - shelltools.system("sed -i -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' configure") - autotools.configure(options) - -def build(): - shelltools.echo("Makefile.extra", "BUILT_SOURCES: $(BUILT_SOURCES)") - pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ") - autotools.make("-f Makefile -f Makefile.extra") - - targets = " \ - libudev.la \ - libgudev-1.0.la \ - systemd-udevd \ - udevadm \ - ata_id \ - cdrom_id \ - collect \ - scsi_id \ - v4l_id \ - accelerometer \ - mtd_probe \ - " - - autotools.make(targets) - - autotools.make("-C docs/libudev") - autotools.make("-C docs/gudev") - -#~ def check(): - #~ autotools.make("check") -#~ - -def install(): - targets = " install-libLTLIBRARIES \ - install-includeHEADERS \ - install-libgudev_includeHEADERS \ - install-rootbinPROGRAMS \ - install-rootlibexecPROGRAMS \ - install-udevlibexecPROGRAMS \ - install-dist_udevconfDATA \ - install-dist_udevrulesDATA \ - install-girDATA \ - install-pkgconfiglibDATA \ - install-sharepkgconfigDATA \ - install-typelibsDATA \ - install-dist_docDATA \ - libudev-install-hook \ - install-directories-hook \ - install-dist_bashcompletionDATA \ - install-dist_networkDATA \ - rootlibexec_PROGRAMS='systemd-udevd' \ - rootbin_PROGRAMS='udevadm' \ - lib_LTLIBRARIES='libudev.la \ - libgudev-1.0.la' \ - pkgconfiglib_DATA='src/libudev/libudev.pc \ - src/gudev/gudev-1.0.pc' \ - dist_bashcompletion_DATA='shell-completion/bash/udevadm' \ - dist_network_DATA='network/99-default.link' \ - pkginclude_HEADERS='src/libudev/libudev.h' \ - " - - autotools.make("-j1 DESTDIR=%s%s %s" % (get.installDIR(), suffix, targets)) - if get.buildTYPE() == "emul32": - shelltools.move("%s%s/lib%s" % (get.installDIR(), suffix, suffix), "%s/lib%s" % (get.installDIR(), suffix)) - shelltools.move("%s%s/usr/lib%s" % (get.installDIR(), suffix, suffix), "%s/usr/lib%s" % (get.installDIR(), suffix)) - for f in shelltools.ls("%s/usr/lib32/pkgconfig" % get.installDIR()): - pisitools.dosed("%s/usr/lib32/pkgconfig/%s" % (get.installDIR(), f), "emul32", "usr") - #shelltools.unlinkDir("%s%s" % (get.installDIR(), suffix)) - return - # Create needed directories - #for d in ("", "net", "pts", "shm", "hugepages"): - #pisitools.dodir("/lib/udev/devices/%s" % d) - - # Create vol_id and scsi_id symlinks in /sbin probably needed by multipath-tools - pisitools.dosym("/lib/udev/scsi_id", "/sbin/scsi_id") - - # Create /sbin/systemd-udevd -> /sbin/udevd sysmlink, we need it for MUDUR, do not touch this sysmlink. - pisitools.dosym("/sbin/systemd-udevd", "/sbin/udevd") - pisitools.dosym("/lib/systemd/systemd-udevd", "/sbin/systemd-udevd") - # Mudur needs this symlink as well - pisitools.dosym("/bin/udevadm", "/sbin/udevadm") - - # Create /etc/udev/rules.d for backward compatibility - pisitools.dodir("/etc/udev/rules.d") - - pisitools.dodir("/run/udev") - pisitools.dodoc("README", "TODO") - - # Add man files - pisitools.doman("man/systemd.link.5", "man/udev.7", "man/udevadm.8", "man/systemd-udevd.service.8") diff --git a/system/base/udev/comar/package.py b/system/base/udev/comar/package.py deleted file mode 100644 index e8190333..00000000 --- a/system/base/udev/comar/package.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python - -import os - -def createNode(mode, uid, gid, minor, major, path): - os.system("/bin/mknod --mode=%d %s c %d %d" % (mode, path, minor, major)) - os.system("/bin/chown %s:%s %s" % (uid, gid, path)) - -def postInstall(fromVersion, fromRelease, toVersion, toRelease): - createNode(600, "root", "root", 1, 11, "/lib/udev/devices/kmsg") - createNode(666, "root", "root", 1, 3, "/lib/udev/devices/null") - createNode(666, "root", "root", 1, 5, "/lib/udev/devices/zero") - createNode(600, "root", "root", 10, 130, "/lib/udev/devices/watchdog") - createNode(666, "root", "root", 10, 229, "/lib/udev/devices/fuse") - createNode(600, "root", "tty", 5, 1, "/lib/udev/devices/console") - createNode(666, "root", "tty", 5, 2, "/lib/udev/devices/ptmx") - createNode(666, "root", "tty", 5, 0, "/lib/udev/devices/tty") - createNode(620, "root", "tty", 4, 1, "/lib/udev/devices/tty1") - createNode(600, "root", "root", 10, 200, "/lib/udev/devices/net/tun") - createNode(600, "root", "root", 36, 0, "/lib/udev/devices/route") - createNode(600, "root", "root", 10, 200, "/lib/udev/devices/skip") - createNode(660, "root", "dialout", 108, 0, "/lib/udev/devices/ppp") - - if os.path.exists("/lib/udev/devices/rtc"): - os.unlink("/lib/udev/devices/rtc") - - # Migrate UDEV database - if fromVersion and int(fromVersion) < 165: - os.system("/sbin/udevadm info --convert-db &> /dev/null") diff --git a/system/base/udev/files/tmpfiles.conf b/system/base/udev/files/tmpfiles.conf deleted file mode 100644 index 9a7ad93d..00000000 --- a/system/base/udev/files/tmpfiles.conf +++ /dev/null @@ -1 +0,0 @@ -D /run/udev 0755 root root diff --git a/system/base/udev/pspec.xml b/system/base/udev/pspec.xml deleted file mode 100644 index ffb1ae86..00000000 --- a/system/base/udev/pspec.xml +++ /dev/null @@ -1,284 +0,0 @@ - - - - - udev - http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html - - PisiLinux Community - admins@pisilinux.org - - GPLv2 - app:console - Linux dynamic and persistent device naming support - udev allows Linux users to have a dynamic /dev directory and it provides the ability to have persistent device names. - http://www.freedesktop.org/software/systemd/systemd-214.tar.xz - - glib2-devel - gperf - acl-devel - libkmod-devel - libutil-linux-devel - - - - - udev - - libudev - acl - libkmod - libutil-linux - util-linux - - - /bin - /sbin - /usr/bin - /usr/sbin - /lib/udev - /lib - /usr/lib - /etc - /usr/lib/tmpfiles.d/udev.conf - /run/udev - /lib/systemd - /etc/udev/rules.d - /lib/udev/rules.d - /usr/share/dbus-1/services - /usr/share/bash-completion/completions - /usr/share/doc - /usr/share/man - - - tmpfiles.conf - - - - System.Package - - - - - udev-devel - system.devel - Development files for udev - - udev - - - /usr/include/systemd/sd-daemon.h - /usr/lib32/pkgconfig/libsystemd-daemon.pc - /usr/lib/pkgconfig/libsystemd-daemon.pc - /usr/share/pkgconfig/udev.pc - - - - - libudev - Dynamic library to access udev device information - - udev - - - /usr/lib/libudev* - /lib/libudev* - - - - - libudev-devel - system.devel - Development files for libudev - - udev - libudev - - - /usr/include/libudev.h - /usr/lib/pkgconfig/libudev.pc - /usr/lib32/pkgconfig/libudev.pc - /usr/share/gtk-doc/html/libudev - - - - - libgudev1 - Libraries for adding libudev support to applications that use glib - - glib2 - libudev - > - - /usr/lib/libgudev* - - - - - libgudev1-devel - system.devel - Development files for libgudev1 - - libudev-devel - libgudev1 - - - /usr/include/gudev-1.0 - /usr/lib/pkgconfig/gudev-1.0* - /usr/lib32/pkgconfig/gudev-1.0* - /usr/share/gir-1.0/GUdev-1.0.gir - /usr/share/gtk-doc/html/gudev - - - - - libudev-32bit - emul32 - 32-bit shared libraries for libudev - emul32 - - libkmod-32bit - libutil-linux-32bit - - - libudev - - - /usr/lib32/libudev* - /lib32/libudev* - - - - - libgudev1-32bit - emul32 - 32-bit shared libraries for libgudev1 - emul32 - - glib2-32bit - - - libgudev1 - libudev-32bit - glib2-32bit - - - /usr/lib32/libgudev* - - - - - - 2015-05-01 - 214 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-05-11 - 212 - Add upstream patches. - Marcin Bojara - marcin@pisilinux.org - - - 2014-03-28 - 212 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-03-12 - 211 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-03-07 - 210 - Rebuild. - Marcin Bojara - marcin@pisilinux.org - - - 2014-02-26 - 210 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-02-20 - 209 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-01-11 - 208 - Add tmpfiles.conf, git updates. - Marcin Bojara - marcin@pisilinux.org - - - 2013-10-30 - 208 - Version bump. - Serdar Soytetir - kaptan@pisilinux.org - - - 2013-09-10 - 206 - Add /run/udev directory. - Marcin Bojara - marcin@pisilinux.org - - - 2013-08-13 - 206 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-07-28 - 204 - Fix pc files for emul32. - Marcin Bojara - marcin@pisilinux.org - - - 2013-06-13 - 204 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-03-30 - 200 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-01-24 - 197 - Version bump, add emul32 - Marcin Bojara - marcin@pisilinux.org - - - 2012-10-11 - 194 - First release - Erdem Artan - admins@pisilinux.org - - - diff --git a/system/base/udev/translations.xml b/system/base/udev/translations.xml deleted file mode 100644 index 5535e582..00000000 --- a/system/base/udev/translations.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - udev - Linux dinamik ve sürekli aygıt isimlendirme desteği (kernel dışındaki devfs) - udev linux kullanıcılarının dinamik /dev dizinine sahip olmalarına olanek verir ve tutarlı cihaz isimleri almasını sağlar. - udev permet aux utilisateurs Linux d'avoir un répertoire /dev dynamique et donne la possibilité d'avoir des noms de périphériques persistants. - udev ermöglicht Linux Benutzern ein dynamisches /dev Verzeichnis und beständige Gerätenamen - - - - libudev - udev aygıt bilgilerini sunan kitaplık - - - - libudev-32bit - udev için 32-bit paylaşımlı kitaplıklar - - - - libudev-devel - libudev için geliştirme dosyaları - - - - libgudev1 - glib kullanan uygulamalara libudev desteği eklemek için kullanılan kitaplık - - - - libgudev1-devel - libgudev1 için geliştirme dosyaları - - diff --git a/system/base/util-linux/pspec.xml.new b/system/base/util-linux/pspec.xml.new deleted file mode 100644 index aefea02f..00000000 --- a/system/base/util-linux/pspec.xml.new +++ /dev/null @@ -1,236 +0,0 @@ - - - - - util-linux - http://userweb.kernel.org/~kzak/util-linux-ng/ - - PisiLinux Community - admins@pisilinux.org - - GPLv2 - app:console - library - Various useful Linux utilities - The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. - https://www.kernel.org/pub/linux/utils/util-linux/v2.26/util-linux-2.26.1.tar.xz - - zlib-devel - udev-devel - python-devel - libudev-devel - shadow - ncurses-devel - libcap-ng-devel - glibc-32bit - - - - - - upstream/util-linux-ng-2.21-login-lastlog.patch - - - - - util-linux - - libuuid - libblkid - zlib - perl - python - ncurses - libudev - - libcap-ng - - - /etc - /bin - /sbin - /usr/bin - /usr/sbin - /usr/share/doc - /usr/share/man - /usr/share/info - /usr/share/misc - /usr/share/getopt - /usr/share/bash-completion/completions - /usr/share/locale - /usr/include - /usr/lib - /lib - - - - - - uuidd - service - app:console - util.misc - Helper daemon to guarantee uniqueness of time-based UUIDs - - libuuid - - - - /usr/bin/uuidgen - /usr/sbin/uuidd - /usr/lib/tmpfiles.d/uuidd.conf - /usr/share/man/man1/uuidgen.1 - /usr/share/man/man8/uuidd.8 - - - uuidd.tmpfiles - - - - - libuuid - library - A library for UUID processing - - /usr/share/man/man3/uuid* - /lib/libuuid.* - /usr/lib/libuuid.so - - - - - libuuid-devel - header - system.devel - libuuid header files - - libuuid - - - /usr/include/uuid/* - /usr/lib/pkgconfig/ - /usr/lib32/pkgconfig/uuid.pc - - - - - libblkid - library - A library for block device identifying - - libuuid - - - /usr/share/man/man3/libblkid* - /usr/share/man/man8/blkid* - /lib/libblkid.* - /usr/lib/libblkid.so - - - - - libblkid-devel - header - system.devel - libblkid header files - - libblkid - - - /usr/include/blkid/* - /usr/lib/pkgconfig/blkid.pc - /usr/lib32/pkgconfig/blkid.pc - - - - - libuuid-32bit - emul32 - 32-bit shared libraries for libuuid - emul32 - - glibc-32bit - - - /usr/lib32/libuuid.* - - - - - libblkid-32bit - emul32 - 32-bit shared libraries for libblkid - emul32 - - libblkid - libuuid-32bit - libuuid - glibc-32bit - - - /usr/lib32/libblkid.* - - - - - - 2015-04-01 - 2.26.1 - Version bump. - Ertuğrul Erata - ertugrulerata@gmail.com - - - 2014-05-11 - 2.24.1 - Release bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-04-08 - 2.24.1 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2014-01-20 - 2.24 - Version bump. - Marcin Bojara - marcin@pisilinux.org - - - 2013-07-27 - 2.22.2 - Move pc files to devel pack, rebuild - PisiLinux Community - admins@pisilinux.org - - - 2013-07-26 - 2.22.2 - Release bump for rebuild. - PisiLinux Community - admins@pisilinux.org - - - 2013-01-14 - 2.22.2 - New release - PisiLinux Community - admins@pisilinux.org - - - 2012-11-17 - 2.22.1 - First release - Marcin Bojara - marcin@pisilinux.org - - - diff --git a/system/boot/grub2/pspec.xml b/system/boot/grub2/pspec.xml index df0979b5..248fbd26 100644 --- a/system/boot/grub2/pspec.xml +++ b/system/boot/grub2/pspec.xml @@ -26,7 +26,6 @@ help2man texinfo freetype-devel - freetype zlib-devel ncurses-devel xz-devel diff --git a/system/devel/libseccomp/pspec.xml b/system/devel/libseccomp/pspec.xml index c5dfdf76..ce747645 100755 --- a/system/devel/libseccomp/pspec.xml +++ b/system/devel/libseccomp/pspec.xml @@ -28,6 +28,10 @@ libseccomp-devel + Development files for libseccomp + + libseccomp + /usr/include diff --git a/system/devel/python-setuptools/pspec.xml b/system/devel/python-setuptools/pspec.xml index 208a5f6d..b98cfba2 100644 --- a/system/devel/python-setuptools/pspec.xml +++ b/system/devel/python-setuptools/pspec.xml @@ -12,7 +12,7 @@ library Python setuptools python-setuptools is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages. - http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz + http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz @@ -25,7 +25,7 @@ - + 2014-05-11 0.6.49 Release bump.