Codebase list pseudo / upstream/1.9.0+git20180920
also make sure inodes are 64-bit values to SQL bind_int doesn't handle 64-bit ints on most targets, we need bind_int64, and weren't using it. What a silly bug. Caught and fixed by <Jack.Fewx@dell.com>. Signed-off-by: seebs <seebs@seebs.net> Seebs 5 years ago
2 changed file(s) with 12 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
11 * (seebs) coerce inodes to signed int64_t range when shoving
22 them into sqlite.
33 * (seebs) add another /*fallthrough*/ comment to make gcc7 happy.
4 * (seebs) also make sure inodes are handled as 64-bit, not
5 32-bit, which probably matters more. Thanks to <Jack.Fewx@dell.com>
6 for catching this.
47
58 2018-04-13:
69 * (seebs) Reduce spamminess of path mismatches.
15351535 }
15361536 }
15371537 sqlite3_bind_int(delete, 1, msg->dev);
1538 sqlite3_bind_int(delete, 2, signed_ino(msg->ino));
1538 sqlite3_bind_int64(delete, 2, signed_ino(msg->ino));
15391539 sqlite3_bind_int(delete, 3, msg->dev);
1540 sqlite3_bind_int(delete, 4, signed_ino(msg->ino));
1540 sqlite3_bind_int64(delete, 4, signed_ino(msg->ino));
15411541 rc = sqlite3_step(delete);
15421542 if (rc != SQLITE_DONE) {
15431543 dberr(file_db, "delete of unused xattrs may have failed");
15721572 }
15731573 }
15741574 sqlite3_bind_int(copy, 1, msg->dev);
1575 sqlite3_bind_int(copy, 2, signed_ino(msg->ino));
1575 sqlite3_bind_int64(copy, 2, signed_ino(msg->ino));
15761576 sqlite3_bind_int(copy, 3, oldmsg->dev);
1577 sqlite3_bind_int(copy, 4, signed_ino(oldmsg->ino));
1577 sqlite3_bind_int64(copy, 4, signed_ino(oldmsg->ino));
15781578 rc = sqlite3_step(copy);
15791579 if (rc != SQLITE_DONE) {
15801580 dberr(file_db, "copy of xattrs may have failed");
16041604 }
16051605 int existing;
16061606 sqlite3_bind_int(scan, 1, msg->dev);
1607 sqlite3_bind_int(scan, 2, signed_ino(msg->ino));
1607 sqlite3_bind_int64(scan, 2, signed_ino(msg->ino));
16081608 rc = sqlite3_step(scan);
16091609 if (rc == SQLITE_ROW) {
16101610 existing = (int) sqlite3_column_int64(scan, 0);
24942494 }
24952495 pseudo_debug(PDBGF_XATTR, "requested xattr named '%s' for ino %lld\n", *value, (long long) msg->ino);
24962496 sqlite3_bind_int(select, 1, msg->dev);
2497 sqlite3_bind_int(select, 2, signed_ino(msg->ino));
2497 sqlite3_bind_int64(select, 2, signed_ino(msg->ino));
24982498 rc = sqlite3_bind_text(select, 3, *value, -1, SQLITE_STATIC);
24992499 if (rc) {
25002500 dberr(file_db, "couldn't bind xattr name to SELECT.");
25562556 }
25572557 }
25582558 sqlite3_bind_int(select, 1, msg->dev);
2559 sqlite3_bind_int(select, 2, signed_ino(msg->ino));
2559 sqlite3_bind_int64(select, 2, signed_ino(msg->ino));
25602560 do {
25612561 rc = sqlite3_step(select);
25622562 if (rc == SQLITE_ROW) {
26102610 }
26112611 }
26122612 sqlite3_bind_int(delete, 1, msg->dev);
2613 sqlite3_bind_int(delete, 2, signed_ino(msg->ino));
2613 sqlite3_bind_int64(delete, 2, signed_ino(msg->ino));
26142614 rc = sqlite3_bind_text(delete, 3, value, len, SQLITE_STATIC);
26152615 if (rc) {
26162616 dberr(file_db, "couldn't bind xattr name to DELETE.");
26512651 }
26522652 }
26532653 sqlite3_bind_int(select, 1, msg->dev);
2654 sqlite3_bind_int(select, 2, signed_ino(msg->ino));
2654 sqlite3_bind_int64(select, 2, signed_ino(msg->ino));
26552655 rc = sqlite3_bind_text(select, 3, value, -1, SQLITE_STATIC);
26562656 if (rc) {
26572657 dberr(file_db, "couldn't bind xattr name to SELECT.");