Hi Michael, On Wednesday, 24 June 2026 07:02:50 CEST Michael Tokarev wrote: > From: Christian Schoenebeck <[email protected]> > > Add a new, shared helper function check_name() that consolidates the name > validation logic (illegal name check and "." / ".." rejection) currently > spread over multiple 9p handlers, unnecessarily duplicating code. > > This is pure refactoring with no behavior change. The existing error code > semantics are preserved: rename operations return -EISDIR, create > operations return -EEXIST.
Note that this particular patch is actually not a fix. It is just code deduplication. So my expecation was that this patch would not go to the stable branches, therefore I intentionally omitted to CC qemu-stable on this patch. /Christian > Note: These current error codes actually differ from native Linux system > calls (e.g. rename() returns -EBUSY, open(O_CREAT) returns -EISDIR). The 9P > protocol does not mandate specific error codes for these validation errors. > Hence consolidating to a single error code (e.g., -EINVAL) for all cases > could be considered in the future for simplicity reason. > > This change reduces code duplication across 9 functions: > > - v9fs_lcreate > - v9fs_create > - v9fs_symlink > - v9fs_link > - v9fs_rename > - v9fs_renameat > - v9fs_wstat > - v9fs_mknod > - v9fs_mkdir > > Link: > https://lore.kernel.org/qemu-devel/0573103880129eb543f07b68c77e86f2f572f6bf > [email protected] Signed-off-by: Christian Schoenebeck > <[email protected]> > (cherry picked from commit 116db2986b11c914217bbd1547815b6c7efb944a) > Signed-off-by: Michael Tokarev <[email protected]>
