From 0c04a53f8896123e9c6fd8c6c571e1672c44d8fe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 May 2014 12:15:38 +0900 Subject: [PATCH] 3.4-stable patches added patches: don-t-bother-with-get-put-_write_access-on-non-regular-files.patch parisc-fix-epoll_pwait-syscall-on-compat-kernel.patch --- ...t-_write_access-on-non-regular-files.patch | 96 +++++++++++++++++++ ...epoll_pwait-syscall-on-compat-kernel.patch | 30 ++++++ queue-3.4/series | 1 + 3 files changed, 127 insertions(+) create mode 100644 queue-3.4/don-t-bother-with-get-put-_write_access-on-non-regular-files.patch create mode 100644 queue-3.4/parisc-fix-epoll_pwait-syscall-on-compat-kernel.patch diff --git a/queue-3.4/don-t-bother-with-get-put-_write_access-on-non-regular-files.patch b/queue-3.4/don-t-bother-with-get-put-_write_access-on-non-regular-files.patch new file mode 100644 index 00000000000..74ece02ff35 --- /dev/null +++ b/queue-3.4/don-t-bother-with-get-put-_write_access-on-non-regular-files.patch @@ -0,0 +1,96 @@ +From dd20908a8a06b22c171f6c3fcdbdbd65bed07505 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Fri, 14 Mar 2014 10:56:20 -0400 +Subject: don't bother with {get,put}_write_access() on non-regular files + +From: Al Viro + +commit dd20908a8a06b22c171f6c3fcdbdbd65bed07505 upstream. + +it's pointless and actually leads to wrong behaviour in at least one +moderately convoluted case (pipe(), close one end, try to get to +another via /proc/*/fd and run into ETXTBUSY). + +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman + +diff --git a/fs/file_table.c b/fs/file_table.c +index 5b24008ea4f6..79ecae62209a 100644 +--- a/fs/file_table.c ++++ b/fs/file_table.c +@@ -209,10 +209,10 @@ static void drop_file_write_access(struct file *file) + struct dentry *dentry = file->f_path.dentry; + struct inode *inode = dentry->d_inode; + +- put_write_access(inode); +- + if (special_file(inode->i_mode)) + return; ++ ++ put_write_access(inode); + if (file_check_writeable(file) != 0) + return; + __mnt_drop_write(mnt); +diff --git a/fs/open.c b/fs/open.c +index b9ed8b25c108..2ed7325f713e 100644 +--- a/fs/open.c ++++ b/fs/open.c +@@ -641,23 +641,12 @@ out: + static inline int __get_file_write_access(struct inode *inode, + struct vfsmount *mnt) + { +- int error; +- error = get_write_access(inode); ++ int error = get_write_access(inode); + if (error) + return error; +- /* +- * Do not take mount writer counts on +- * special files since no writes to +- * the mount itself will occur. +- */ +- if (!special_file(inode->i_mode)) { +- /* +- * Balanced in __fput() +- */ +- error = __mnt_want_write(mnt); +- if (error) +- put_write_access(inode); +- } ++ error = __mnt_want_write(mnt); ++ if (error) ++ put_write_access(inode); + return error; + } + +@@ -690,12 +679,11 @@ static int do_dentry_open(struct file *f, + + path_get(&f->f_path); + inode = f->f_inode = f->f_path.dentry->d_inode; +- if (f->f_mode & FMODE_WRITE) { ++ if (f->f_mode & FMODE_WRITE && !special_file(inode->i_mode)) { + error = __get_file_write_access(inode, f->f_path.mnt); + if (error) + goto cleanup_file; +- if (!special_file(inode->i_mode)) +- file_take_write(f); ++ file_take_write(f); + } + + f->f_mapping = inode->i_mapping; +@@ -742,7 +730,6 @@ static int do_dentry_open(struct file *f, + cleanup_all: + fops_put(f->f_op); + if (f->f_mode & FMODE_WRITE) { +- put_write_access(inode); + if (!special_file(inode->i_mode)) { + /* + * We don't consider this a real +@@ -750,6 +737,7 @@ cleanup_all: + * because it all happenend right + * here, so just reset the state. + */ ++ put_write_access(inode); + file_reset_write(f); + __mnt_drop_write(f->f_path.mnt); + } diff --git a/queue-3.4/parisc-fix-epoll_pwait-syscall-on-compat-kernel.patch b/queue-3.4/parisc-fix-epoll_pwait-syscall-on-compat-kernel.patch new file mode 100644 index 00000000000..b47f3b768c3 --- /dev/null +++ b/queue-3.4/parisc-fix-epoll_pwait-syscall-on-compat-kernel.patch @@ -0,0 +1,30 @@ +From ab3e55b119c9653b19ea4edffb86f04db867ac98 Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Sun, 13 Apr 2014 00:03:55 +0200 +Subject: parisc: fix epoll_pwait syscall on compat kernel + +From: Helge Deller + +commit ab3e55b119c9653b19ea4edffb86f04db867ac98 upstream. + +This bug was detected with the libio-epoll-perl debian package where the +test case IO-Ppoll-compat.t failed. + +Signed-off-by: Helge Deller +Signed-off-by: Greg Kroah-Hartman + +--- + arch/parisc/kernel/syscall_table.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/parisc/kernel/syscall_table.S ++++ b/arch/parisc/kernel/syscall_table.S +@@ -395,7 +395,7 @@ + ENTRY_COMP(vmsplice) + ENTRY_COMP(move_pages) /* 295 */ + ENTRY_SAME(getcpu) +- ENTRY_SAME(epoll_pwait) ++ ENTRY_COMP(epoll_pwait) + ENTRY_COMP(statfs64) + ENTRY_COMP(fstatfs64) + ENTRY_COMP(kexec_load) /* 300 */ diff --git a/queue-3.4/series b/queue-3.4/series index 0ca9bb31de0..eecc345db6b 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1 +1,2 @@ parisc-fix-epoll_pwait-syscall-on-compat-kernel.patch +don-t-bother-with-get-put-_write_access-on-non-regular-files.patch -- 2.47.3