summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch117
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_1.8.1.bb1
2 files changed, 118 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch b/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch
new file mode 100644
index 0000000000..4e072e6c40
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch
@@ -0,0 +1,117 @@
1From 0d9071f3090bbd7880558f3b488b236ac19b44fc Mon Sep 17 00:00:00 2001
2From: seebs <seebs@seebs.net>
3Date: Thu, 28 Jul 2016 14:02:12 -0500
4Subject: [PATCH 1/2] Fix xattr performance
5
6When deleting files, we *do* know the inode and attribute, most of the
7time, so we pass those in whenever possible. The full purge of unmatched
8xattrs should not happen when the correct dev/ino are believed to be known.
9
10Signed-off-by: Seebs <seebs@seebs.net>
11
12[YOCTO #9929]
13Upstream-Status: Backport (0d9071f3090bbd7880558f3b488b236ac19b44fc)
14Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
15---
16 ChangeLog.txt | 3 +++
17 pseudo.c | 11 ++++++++---
18 pseudo_db.c | 15 +++++++++------
19 pseudo_db.h | 2 +-
20 4 files changed, 21 insertions(+), 10 deletions(-)
21
22diff --git a/ChangeLog.txt b/ChangeLog.txt
23index 131f163..d6359ca 100644
24--- a/ChangeLog.txt
25+++ b/ChangeLog.txt
26@@ -1,3 +1,6 @@
27+2016-07-28:
28+ * (seebs) Fix performance issue on deletion with xattr changes.
29+
30 2016-07-08:
31 * (RP) release 1.8.1
32 * (joshuagl) Fix log table creation issue
33diff --git a/pseudo.c b/pseudo.c
34index 52f649f..db1c400 100644
35--- a/pseudo.c
36+++ b/pseudo.c
37@@ -600,7 +600,12 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
38 if (by_path.deleting != 0) {
39 pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n",
40 msg->path);
41- pdb_did_unlink_file(msg->path, by_path.deleting);
42+ /* in this case, we don't trust the
43+ * existing entries, so we will do the
44+ * more expensive sweep for stray
45+ * xattrs.
46+ */
47+ pdb_did_unlink_file(msg->path, NULL, by_path.deleting);
48 } else {
49 pseudo_diag("inode mismatch: '%s' ino %llu in db, %llu in request.\n",
50 msg->path,
51@@ -698,7 +703,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
52 if (by_ino.deleting != 0) {
53 pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n",
54 msg->path);
55- pdb_did_unlink_file(path_by_ino, by_ino.deleting);
56+ pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting);
57 } else {
58 pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
59 msg->nlink,
60@@ -930,7 +935,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
61 }
62 break;
63 case OP_DID_UNLINK:
64- pdb_did_unlink_file(msg->path, msg->client);
65+ pdb_did_unlink_file(msg->path, msg, msg->client);
66 break;
67 case OP_CANCEL_UNLINK:
68 pdb_cancel_unlink_file(msg);
69diff --git a/pseudo_db.c b/pseudo_db.c
70index 289bb29..e7dd193 100644
71--- a/pseudo_db.c
72+++ b/pseudo_db.c
73@@ -1848,7 +1848,7 @@ pdb_did_unlink_files(int deleting) {
74
75 /* confirm deletion of a specific file by a given client */
76 int
77-pdb_did_unlink_file(char *path, int deleting) {
78+pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting) {
79 static sqlite3_stmt *delete_exact;
80 int rc, exact;
81 char *sql_delete_exact = "DELETE FROM files WHERE path = ? AND deleting = ?;";
82@@ -1878,11 +1878,14 @@ pdb_did_unlink_file(char *path, int deleting) {
83 exact = sqlite3_changes(file_db);
84 pseudo_debug(PDBGF_DB, "(exact %d)\n", exact);
85 sqlite3_reset(delete_exact);
86- sqlite3_clear_bindings(delete_exact);
87- /* we have to clean everything because we don't know for sure the
88- * device/inode...
89- */
90- pdb_clear_unused_xattrs();
91+ if (msg) {
92+ pdb_clear_xattrs(msg);
93+ } else {
94+ /* we have to clean everything because we don't know for sure the
95+ * device/inode...
96+ */
97+ pdb_clear_unused_xattrs();
98+ }
99 return rc != SQLITE_DONE;
100 }
101
102diff --git a/pseudo_db.h b/pseudo_db.h
103index a54f3c1..1b2599c 100644
104--- a/pseudo_db.h
105+++ b/pseudo_db.h
106@@ -39,7 +39,7 @@ typedef struct {
107
108 extern int pdb_maybe_backup(void);
109 extern int pdb_cancel_unlink_file(pseudo_msg_t *msg);
110-extern int pdb_did_unlink_file(char *path, int deleting);
111+extern int pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting);
112 extern int pdb_did_unlink_files(int deleting);
113 extern int pdb_link_file(pseudo_msg_t *msg);
114 extern int pdb_may_unlink_file(pseudo_msg_t *msg, int deleting);
115--
1162.7.4
117
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
index 3381df0301..f45912a711 100644
--- a/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb
@@ -5,6 +5,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz
5 file://fallback-passwd \ 5 file://fallback-passwd \
6 file://fallback-group \ 6 file://fallback-group \
7 file://moreretries.patch \ 7 file://moreretries.patch \
8 file://Fix-xattr-performance.patch \
8 " 9 "
9 10
10SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7" 11SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7"