bfs: don't try to create indices when there's no indices root.

During partition initialization, the indices root is always created
unless `VOLUME_NO_INDICES` is passed in the `initialize_parameters`.

Due to stricter vnode checks, a BFS volume with `VOLUME_NO_INDICES` was
trying to create an index despite there being no index root, which seems
to have been silently swallowed in the past.

Now, when attempting to create an index, do a similar check as other
index operations to ensure an index root node exists, or fail.

Fixes #20083.

Change-Id: Ida317743b865a27498d8be11a18c06f3b7579dd7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10971
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jessica Hamilton
2026-05-11 16:06:12 +00:00
committed by waddlesplash
parent bd2396297e
commit a76c4f11d5
@@ -2172,6 +2172,10 @@ bfs_create_index(fs_volume* _volume, const char* name, uint32 type,
if (geteuid() != 0)
return B_NOT_ALLOWED;
Inode* indices = volume->IndicesNode();
if (indices == NULL)
return B_UNSUPPORTED;
Transaction transaction(volume, volume->Indices());
Index index(volume);