bugGNU patch - Bugs: bug #37380, patch-2.7 corrupt on different...

 
 

bug #37380: patch-2.7 corrupt on different patch concat

Submitter:  Andrey Volkov <xiff>
Submitted:  Tue 18 Sep 2012 05:49:47 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 18 Sep 2012 11:11:57 AM UTC, comment #1: 

Thanks for the bug report; I could reproduce, find, and fix the bug.  The fix is in the git repository as well as in:

  ftp://alpha.gnu.org/gnu/patch/patch-2.7.0.12-99f2.tar.gz

Andreas Gruenbacher <agruen>
Group administrator
Tue 18 Sep 2012 05:49:47 AM UTC, original submission:  

I've got unexpected (bogus) result patching Linux kernel with concat unified diff files and patch-2.7:

cat aufs3-fix-export-__devcgroup_inode_permission.patch aufs3-fix-export.patch | patch -p2

Got unexpected end of file:
=======================================================
--- device_cgroup.c-orig 2012-09-18 10:58:15.000000000 +0600
+++ device_cgroup.c 2012-09-18 11:24:58.000000000 +0600
@@ -7,12 +7,14 @@
 #include <linux/device_cgroup.h>
 #include <linux/cgroup.h>
 #include <linux/ctype.h>
+#include <linux/export.h>
 #include <linux/list.h>
 #include <linux/uaccess.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/rcupdate.h>
 #include <linux/mutex.h>
+#include <linux/export.h>
 
 #define ACC_MKNOD 1
 #define ACC_READ  2
@@ -493,6 +495,7 @@
 
  return -EPERM;
 }
+EXPORT_SYMBOL(__devcgroup_inode_permission);
 
 int devcgroup_inode_mknod(int mode, dev_t dev)
 {
@@ -521,11 +524,4 @@
  if (!(wh->access & ACC_MKNOD))
  continue;
 found:
- rcu_read_unlock();
- return 0;
- }
-
- rcu_read_unlock();
-
- return -EPERM;
-}
+ rcu
\ No newline at end of file
=======================================================

patch-2.6 works as expected:
=======================================================
--- device_cgroup.c-orig 2012-09-18 11:33:34.000000000 +0600
+++ device_cgroup.c 2012-09-18 10:37:03.000000000 +0600
@@ -7,12 +7,14 @@
 #include <linux/device_cgroup.h>
 #include <linux/cgroup.h>
 #include <linux/ctype.h>
+#include <linux/export.h>
 #include <linux/list.h>
 #include <linux/uaccess.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/rcupdate.h>
 #include <linux/mutex.h>
+#include <linux/export.h>
 
 #define ACC_MKNOD 1
 #define ACC_READ  2
@@ -493,6 +495,7 @@
 
  return -EPERM;
 }
+EXPORT_SYMBOL(__devcgroup_inode_permission);
 
 int devcgroup_inode_mknod(int mode, dev_t dev)
 {
=======================================================

Bug details:

patch -v
GNU patch 2.7

CFLAGS="-O2 -march=corei7-avx -pipe"

OS Gentoo ~amd64
glibc-2.15, gcc-4.6.3

Compiled gentoo portage: sys-devel/patch-2.7.ebuild

Andrey Volkov <xiff>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #26571:  device_cgroup.c added by xiff (11KiB - application/octet-stream - Source files)
file #26573:  aufs3-fix-export.patch added by xiff (231B - text/plain - Source files)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by agruen (Posted a comment)
  • -email is unavailable- added by xiff (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-18 agruen StatusNone Fixed
        Open/ClosedOpen Closed
    2012-09-18 xiff Attached File- Added device_cgroup.c, #26571
        Attached File- Added aufs3-fix-export-__devcgroup_inode_permission.patch, #26572
        Attached File- Added aufs3-fix-export.patch, #26573

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code