[oe-commits] [openembedded-core] 02/23: pseudo: backport a patch to fix renameat()

git at git.openembedded.org git at git.openembedded.org
Thu Oct 6 21:45:39 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 91717e9ee519c56eed87ee1333b8232a820b27dc
Author: Joshua Lock <joshua.g.lock at intel.com>
AuthorDate: Thu Oct 6 16:45:20 2016 +0100

    pseudo: backport a patch to fix renameat()
    
    renameat calls under pseudo were losing extended attributes.
    Backport the fix for this from pseudo upstream.
    
    [YOCTO '10349]
    
    Signed-off-by: Joshua Lock <joshua.g.lock at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...nameat-parallel-to-previous-fix-to-rename.patch | 64 ++++++++++++++++++++++
 meta/recipes-devtools/pseudo/pseudo_1.8.1.bb       |  1 +
 2 files changed, 65 insertions(+)

diff --git a/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch b/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch
new file mode 100644
index 0000000..739c03e
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch
@@ -0,0 +1,64 @@
+From d9ab3a0acc94151048498b1ea4d69e7707df1526 Mon Sep 17 00:00:00 2001
+From: Seebs <seebs at seebs.net>
+Date: Fri, 30 Sep 2016 10:56:35 -0500
+Subject: [PATCH 3/3] Fix renameat (parallel to previous fix to rename)
+
+There was a bug in rename(), which was duplicated when renameat() was
+implemented, and which got fixed two years ago for rename(), but no
+one ever uses renameat() so it didn't get fixed there. Thanks
+to Anton Gerasimov <anton at advancedtelematic.com> for the bug report
+and patch.
+
+Signed-off-by: Seebs <seebs at seebs.net>
+
+Upstream-Status: Backport
+Signed-off-by: Joshua Lock <joshua.g.lock at intel.com>
+
+---
+ ChangeLog.txt              | 4 ++++
+ ports/unix/guts/renameat.c | 7 ++++++-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index 65b9759..ca04cc0 100644
+--- a/ChangeLog.txt
++++ b/ChangeLog.txt
+@@ -1,3 +1,7 @@
++2016-09-30:
++	* (seebs) Fix rename at, matching fix from ee00f63d for rename. Bug
++	  and fix provided by Anton Gerasimov <anton at advancedtelematic.com>.
++
+ 2016-09-28:
+ 	* (seebs) Send errors to log when daemonizing, but do that a lot
+ 	  sooner to prevent startup messages which can show up spuriously
+diff --git a/ports/unix/guts/renameat.c b/ports/unix/guts/renameat.c
+index ade0509..d5e36fa 100644
+--- a/ports/unix/guts/renameat.c
++++ b/ports/unix/guts/renameat.c
+@@ -11,6 +11,7 @@
+ 	int oldrc, newrc;
+ 	int save_errno;
+ 	int old_db_entry = 0;
++	int may_unlinked = 0;
+ 
+ 	pseudo_debug(PDBGF_FILE, "renameat: %d,%s->%d,%s\n",
+ 		olddirfd, oldpath ? oldpath : "<nil>",
+@@ -44,10 +45,14 @@
+ 	/* as with unlink, we have to mark that the file may get deleted */
+ 	msg = pseudo_client_op(OP_MAY_UNLINK, 0, -1, newdirfd, newpath, newrc ? NULL : &newbuf);
+ 	if (msg && msg->result == RESULT_SUCCEED)
++		may_unlinked = 1;
++	msg = pseudo_client_op(OP_STAT, 0, -1, olddirfd, oldpath, oldrc ? NULL : &oldbuf);
++	if (msg && msg->result == RESULT_SUCCEED)
+ 		old_db_entry = 1;
++
+ 	rc = real_renameat(olddirfd, oldpath, newdirfd, newpath);
+ 	save_errno = errno;
+-	if (old_db_entry) {
++	if (may_unlinked) {
+ 		if (rc == -1) {
+ 			/* since we failed, that wasn't really unlinked -- put
+ 			 * it back.
+-- 
+2.7.4
+
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
index 67eb298..fb70034 100644
--- a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
@@ -9,6 +9,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz
            file://0001-Don-t-send-SIGUSR1-to-init.patch \
            file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \
            file://0002-Use-correct-file-descriptor.patch \
+           file://0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch \
            "
 
 SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list