Mazen hassan commented on a discussion: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5487#note_148228


Hi @somil, I've submitted a fix for the same-file case (`mv a a`) by evaluating 
the destination path without `RTEMS_FS_EXCLUSIVE` first, then comparing 
`node_access` pointers of both locations. If they point to the same filesystem 
node, we return 0 immediately as POSIX requires.

You're correct that the overwrite case (`mv a b` where `b` already exists) is 
not addressed here — that requires removing `RTEMS_FS_EXCLUSIVE` from the 
general path and handling the overwrite logic inside each filesystem's 
`rename_h` implementation (like `IMFS_rename`), which is a broader change. I've 
left a FIXME comment in the code acknowledging this so it's clear to reviewers 
that the overwrite case is known and intentionally out of scope for this MR.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5487#note_148228
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to