From: Greg Kroah-Hartman Date: Sat, 19 Sep 2015 15:56:34 +0000 (-0700) Subject: 3.14-stable patches X-Git-Tag: v3.10.89~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=afaed87ece66dbc5fd36e3bcdb271b13c3081f4e;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: drivercore-fix-unregistration-path-of-platform-devices.patch hpfs-update-ctime-and-mtime-on-directory-modification.patch --- diff --git a/queue-3.14/drivercore-fix-unregistration-path-of-platform-devices.patch b/queue-3.14/drivercore-fix-unregistration-path-of-platform-devices.patch new file mode 100644 index 00000000000..c06547122fb --- /dev/null +++ b/queue-3.14/drivercore-fix-unregistration-path-of-platform-devices.patch @@ -0,0 +1,67 @@ +From 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 Mon Sep 17 00:00:00 2001 +From: Grant Likely +Date: Sun, 7 Jun 2015 15:20:11 +0100 +Subject: drivercore: Fix unregistration path of platform devices + +From: Grant Likely + +commit 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 upstream. + +The unregister path of platform_device is broken. On registration, it +will register all resources with either a parent already set, or +type==IORESOURCE_{IO,MEM}. However, on unregister it will release +everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There +are also cases where resources don't get registered in the first place, +like with devices created by of_platform_populate()*. + +Fix the unregister path to be symmetrical with the register path by +checking the parent pointer instead of the type field to decide which +resources to unregister. This is safe because the upshot of the +registration path algorithm is that registered resources have a parent +pointer, and non-registered resources do not. + +* It can be argued that of_platform_populate() should be registering + it's resources, and they argument has some merit. However, there are + quite a few platforms that end up broken if we try to do that due to + overlapping resources in the device tree. Until that is fixed, we need + to solve the immediate problem. + +Cc: Pantelis Antoniou +Cc: Wolfram Sang +Cc: Rob Herring +Cc: Greg Kroah-Hartman +Cc: Ricardo Ribalda Delgado +Signed-off-by: Grant Likely +Tested-by: Ricardo Ribalda Delgado +Tested-by: Wolfram Sang +Signed-off-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/base/platform.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -354,9 +354,7 @@ int platform_device_add(struct platform_ + + while (--i >= 0) { + struct resource *r = &pdev->resource[i]; +- unsigned long type = resource_type(r); +- +- if (type == IORESOURCE_MEM || type == IORESOURCE_IO) ++ if (r->parent) + release_resource(r); + } + +@@ -387,9 +385,7 @@ void platform_device_del(struct platform + + for (i = 0; i < pdev->num_resources; i++) { + struct resource *r = &pdev->resource[i]; +- unsigned long type = resource_type(r); +- +- if (type == IORESOURCE_MEM || type == IORESOURCE_IO) ++ if (r->parent) + release_resource(r); + } + } diff --git a/queue-3.14/hpfs-update-ctime-and-mtime-on-directory-modification.patch b/queue-3.14/hpfs-update-ctime-and-mtime-on-directory-modification.patch new file mode 100644 index 00000000000..3c4c6771196 --- /dev/null +++ b/queue-3.14/hpfs-update-ctime-and-mtime-on-directory-modification.patch @@ -0,0 +1,110 @@ +From f49a26e7718dd30b49e3541e3e25aecf5e7294e2 Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Wed, 2 Sep 2015 22:51:53 +0200 +Subject: hpfs: update ctime and mtime on directory modification + +From: Mikulas Patocka + +commit f49a26e7718dd30b49e3541e3e25aecf5e7294e2 upstream. + +Update ctime and mtime when a directory is modified. (though OS/2 doesn't +update them anyway) + +Signed-off-by: Mikulas Patocka +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/hpfs/namei.c | 25 ++++++++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +--- a/fs/hpfs/namei.c ++++ b/fs/hpfs/namei.c +@@ -8,6 +8,17 @@ + #include + #include "hpfs_fn.h" + ++static void hpfs_update_directory_times(struct inode *dir) ++{ ++ time_t t = get_seconds(); ++ if (t == dir->i_mtime.tv_sec && ++ t == dir->i_ctime.tv_sec) ++ return; ++ dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t; ++ dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0; ++ hpfs_write_inode_nolock(dir); ++} ++ + static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) + { + const unsigned char *name = dentry->d_name.name; +@@ -99,6 +110,7 @@ static int hpfs_mkdir(struct inode *dir, + result->i_mode = mode | S_IFDIR; + hpfs_write_inode_nolock(result); + } ++ hpfs_update_directory_times(dir); + d_instantiate(dentry, result); + hpfs_unlock(dir->i_sb); + return 0; +@@ -187,6 +199,7 @@ static int hpfs_create(struct inode *dir + result->i_mode = mode | S_IFREG; + hpfs_write_inode_nolock(result); + } ++ hpfs_update_directory_times(dir); + d_instantiate(dentry, result); + hpfs_unlock(dir->i_sb); + return 0; +@@ -262,6 +275,7 @@ static int hpfs_mknod(struct inode *dir, + insert_inode_hash(result); + + hpfs_write_inode_nolock(result); ++ hpfs_update_directory_times(dir); + d_instantiate(dentry, result); + brelse(bh); + hpfs_unlock(dir->i_sb); +@@ -340,6 +354,7 @@ static int hpfs_symlink(struct inode *di + insert_inode_hash(result); + + hpfs_write_inode_nolock(result); ++ hpfs_update_directory_times(dir); + d_instantiate(dentry, result); + hpfs_unlock(dir->i_sb); + return 0; +@@ -423,6 +438,8 @@ again: + out1: + hpfs_brelse4(&qbh); + out: ++ if (!err) ++ hpfs_update_directory_times(dir); + hpfs_unlock(dir->i_sb); + return err; + } +@@ -477,6 +494,8 @@ static int hpfs_rmdir(struct inode *dir, + out1: + hpfs_brelse4(&qbh); + out: ++ if (!err) ++ hpfs_update_directory_times(dir); + hpfs_unlock(dir->i_sb); + return err; + } +@@ -595,7 +614,7 @@ static int hpfs_rename(struct inode *old + goto end1; + } + +- end: ++end: + hpfs_i(i)->i_parent_dir = new_dir->i_ino; + if (S_ISDIR(i->i_mode)) { + inc_nlink(new_dir); +@@ -610,6 +629,10 @@ static int hpfs_rename(struct inode *old + brelse(bh); + } + end1: ++ if (!err) { ++ hpfs_update_directory_times(old_dir); ++ hpfs_update_directory_times(new_dir); ++ } + hpfs_unlock(i->i_sb); + return err; + } diff --git a/queue-3.14/series b/queue-3.14/series index 976cf23b21a..cffa3d16c23 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -25,3 +25,5 @@ doc-abi-testing-configfs-usb-gadget-sourcesink.patch auxdisplay-ks0108-fix-refcount.patch of-address-don-t-loop-forever-in-of_find_matching_node_by_address.patch arm-omap2-dra7-clockdomain-change-l4per2_7xx_clkdm-to-sw_wkup.patch +drivercore-fix-unregistration-path-of-platform-devices.patch +hpfs-update-ctime-and-mtime-on-directory-modification.patch