Skip to content

Pass host inode numbers through the gofer client - #16469

Merged
copybara-service[bot] merged 1 commit into
google:masterfrom
ayushr2:gofer-ino-passthrough
Oct 29, 2026
Merged

copybara-service[bot] merged 1 commit into
google:masterfrom
ayushr2:gofer-ino-passthrough

Conversation

@ayushr2

@ayushr2 ayushr2 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

@EtiennePerot EtiennePerot added this to the Lightspeed milestone Oct 27, 2026
@ayushr2
ayushr2 force-pushed the gofer-ino-passthrough branch 2 times, most recently from aa69c5a to d2ab214 Compare October 28, 2026 00:04
@ayushr2
ayushr2 marked this pull request as ready for review October 28, 2026 03:44
Comment thread pkg/sentry/fsimpl/gofer/gofer.go Resolved
Comment thread runsc/config/flags.go Resolved
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 271e52f
PiperOrigin-RevId: 1008619002
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 271e52f
PiperOrigin-RevId: 1008619002
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 271e52f
PiperOrigin-RevId: 1008619002
@EtiennePerot

Copy link
Copy Markdown
Collaborator

Build failure: runsc/container/container_save_restore_test.go:1129:37: cannot use false (untyped bool constant) as sandbox.DirectIO value in argument to cont2.Restore

The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes google#6665
Fixes google#10047
Fixes google#16197
@ayushr2
ayushr2 force-pushed the gofer-ino-passthrough branch from 271e52f to 8ead67b Compare October 28, 2026 19:08
@ayushr2

ayushr2 commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

@EtiennePerot done

copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 271e52f
PiperOrigin-RevId: 1008751258
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 8ead67b
PiperOrigin-RevId: 1009090814
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 8ead67b
PiperOrigin-RevId: 1009090814
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 8ead67b
PiperOrigin-RevId: 1009090814
copybara-service Bot pushed a commit that referenced this pull request Oct 28, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 8ead67b
PiperOrigin-RevId: 1009090814
copybara-service Bot pushed a commit that referenced this pull request Oct 29, 2026
The gofer client assigns every file an inode number from a map keyed by
the file's host device and inode numbers. The map gains an entry for every
file the sandbox has ever looked up or listed and is never pruned, so
sentry memory grows with the number of files seen: about 100 B of RSS per
file, or 100 MiB for the life of the sandbox after a find over 1M files.
Workspaces on host tmpfs never reuse inode numbers, so long-running
sandboxes grow without bound. The key also makes getdents(2) stat(2) every
entry to learn its device number.

Report host inode numbers as is instead, and map host device numbers to
sandbox-private device numbers, as Linux overlayfs does. Synthetic files
keep sequential inode numbers on the filesystem's own device number, so
they cannot collide with host files. getdents(2) no longer stats entries,
neither on directfs nor in the gofer process.

Across checkpoint/restore, inode numbers follow the host files, and the
device number saved for a host device is reused for the device on which
restored files are found. Device and inode numbers are therefore stable
across restore when the backing files are unchanged, for all files rather
than only those with an open FD. Conversely, inode numbers of files with an
open FD may change if the backing filesystem changed, as they already do for
other files.

--inode-numbers=virtual keeps the previous behavior.

Fixes #6665
Fixes #10047
Fixes #16197

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16469 from ayushr2:gofer-ino-passthrough 8ead67b
PiperOrigin-RevId: 1009090814
@copybara-service
copybara-service Bot merged commit b24cc97 into google:master Oct 29, 2026
14 checks passed
@ayushr2
ayushr2 deleted the gofer-ino-passthrough branch November 12, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants