diff options
author | Joshua Lock <joshua.g.lock@intel.com> | 2016-10-06 16:45:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-07 16:43:57 +0100 |
commit | 0623259559f3160ce426ca9eecfd145711bfd016 (patch) | |
tree | 1aec8eaf16f9d17b995dea78fb33335667cc72cb /meta | |
parent | e96af0c0b9a11234cd1f0c75ebe1dfec3e59c183 (diff) | |
download | poky-0623259559f3160ce426ca9eecfd145711bfd016.tar.gz |
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]
(From OE-Core rev: 16f6b020ebea49f012f2e65997a8d464f94d6605)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch | 64 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo_1.8.1.bb | 1 |
2 files changed, 65 insertions, 0 deletions
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 0000000000..739c03ee6e --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From d9ab3a0acc94151048498b1ea4d69e7707df1526 Mon Sep 17 00:00:00 2001 | ||
2 | From: Seebs <seebs@seebs.net> | ||
3 | Date: Fri, 30 Sep 2016 10:56:35 -0500 | ||
4 | Subject: [PATCH 3/3] Fix renameat (parallel to previous fix to rename) | ||
5 | |||
6 | There was a bug in rename(), which was duplicated when renameat() was | ||
7 | implemented, and which got fixed two years ago for rename(), but no | ||
8 | one ever uses renameat() so it didn't get fixed there. Thanks | ||
9 | to Anton Gerasimov <anton@advancedtelematic.com> for the bug report | ||
10 | and patch. | ||
11 | |||
12 | Signed-off-by: Seebs <seebs@seebs.net> | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> | ||
16 | |||
17 | --- | ||
18 | ChangeLog.txt | 4 ++++ | ||
19 | ports/unix/guts/renameat.c | 7 ++++++- | ||
20 | 2 files changed, 10 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
23 | index 65b9759..ca04cc0 100644 | ||
24 | --- a/ChangeLog.txt | ||
25 | +++ b/ChangeLog.txt | ||
26 | @@ -1,3 +1,7 @@ | ||
27 | +2016-09-30: | ||
28 | + * (seebs) Fix rename at, matching fix from ee00f63d for rename. Bug | ||
29 | + and fix provided by Anton Gerasimov <anton@advancedtelematic.com>. | ||
30 | + | ||
31 | 2016-09-28: | ||
32 | * (seebs) Send errors to log when daemonizing, but do that a lot | ||
33 | sooner to prevent startup messages which can show up spuriously | ||
34 | diff --git a/ports/unix/guts/renameat.c b/ports/unix/guts/renameat.c | ||
35 | index ade0509..d5e36fa 100644 | ||
36 | --- a/ports/unix/guts/renameat.c | ||
37 | +++ b/ports/unix/guts/renameat.c | ||
38 | @@ -11,6 +11,7 @@ | ||
39 | int oldrc, newrc; | ||
40 | int save_errno; | ||
41 | int old_db_entry = 0; | ||
42 | + int may_unlinked = 0; | ||
43 | |||
44 | pseudo_debug(PDBGF_FILE, "renameat: %d,%s->%d,%s\n", | ||
45 | olddirfd, oldpath ? oldpath : "<nil>", | ||
46 | @@ -44,10 +45,14 @@ | ||
47 | /* as with unlink, we have to mark that the file may get deleted */ | ||
48 | msg = pseudo_client_op(OP_MAY_UNLINK, 0, -1, newdirfd, newpath, newrc ? NULL : &newbuf); | ||
49 | if (msg && msg->result == RESULT_SUCCEED) | ||
50 | + may_unlinked = 1; | ||
51 | + msg = pseudo_client_op(OP_STAT, 0, -1, olddirfd, oldpath, oldrc ? NULL : &oldbuf); | ||
52 | + if (msg && msg->result == RESULT_SUCCEED) | ||
53 | old_db_entry = 1; | ||
54 | + | ||
55 | rc = real_renameat(olddirfd, oldpath, newdirfd, newpath); | ||
56 | save_errno = errno; | ||
57 | - if (old_db_entry) { | ||
58 | + if (may_unlinked) { | ||
59 | if (rc == -1) { | ||
60 | /* since we failed, that wasn't really unlinked -- put | ||
61 | * it back. | ||
62 | -- | ||
63 | 2.7.4 | ||
64 | |||
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb index 67eb298b22..fb70034b4c 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 | |||
9 | file://0001-Don-t-send-SIGUSR1-to-init.patch \ | 9 | file://0001-Don-t-send-SIGUSR1-to-init.patch \ |
10 | file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \ | 10 | file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \ |
11 | file://0002-Use-correct-file-descriptor.patch \ | 11 | file://0002-Use-correct-file-descriptor.patch \ |
12 | file://0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7" | 15 | SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7" |