Skip to content

Fixed size blocks refactor + chown support#46

Open
NorSomething wants to merge 8 commits into
acmpesuecc:devfrom
NorSomething:fixed-size-blocks-refactor
Open

Fixed size blocks refactor + chown support#46
NorSomething wants to merge 8 commits into
acmpesuecc:devfrom
NorSomething:fixed-size-blocks-refactor

Conversation

@NorSomething

@NorSomething NorSomething commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Fixed size blocks refactor + chown support #26 #29

Context

The file system now uses block-based allocation (4 KBs each) strategy instead of a contiguous byte slice.
The file system now also supports chown support with UIDs and GIDs.

Description

The write, read and setattr functions of file.go have been modified to enable use of block-based allocations.
The attributes of both the file and the dir struct have been modified to have UID and GID fields in them enable ownership features in them.
fuse.AllowOther() has been added to main.go's mount code so felicitate chown support.

Tests

CRUD is tested to be working as intended.
chown test:
image
chown working as intended - only sudo users have the permission to change ownership.

Additional info

To have functioning chown support, I added fuse.AllowOther(), this allows any user to access the mount point. With this, anyone can change ownership. This issue is now handled by this validation code in dir.go's setattr :

if req.Header.Uid != 0 && req.Uid != req.Header.Uid {
    return syscall.EPERM
}

Here uid=0 is root. So if the user isn'tt root and is trying to chown something that is not in its UID then we throw permission error, otherwise we allow the change in ownership.

Important

As mentioned fuse.AllowOther() is being used here., but by default fuse will not recognize this and throw an error. To fix this, the user has to edit ~/etc/fuse.conf with elevated permissions and un-comment the line user_allow_other.

@Delta18-Git Delta18-Git left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these changes make more sense, pending further discussion with @NorSomething and @Prana-vvb

Merging blocked due to conflict hell

Comment thread internal/fs/dir.go
Comment thread internal/fs/dir.go
Comment thread internal/fs/file.go
@Delta18-Git Delta18-Git self-requested a review June 22, 2026 13:29

@Delta18-Git Delta18-Git left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending merge conflict resolution; might be best to push merging to after ART merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants