vfs: fix MS_REMOUNT, mount validation, blockdev locking, and resource leaks
High-severity fixes:
- MS_REMOUNT: pass full flags to VFS, store flags & ~MS_REMOUNT in remount branch
- Reject mount replacement with -EBUSY (except with MS_REMOUNT)
- Fix init_mount_fs leak: call kill_sb on failure after fst->mount
- Add MS_RDONLY check in SYSCALL_FTRUNCATE via f->mount_root
Medium-severity fixes:
- Centralize read-only check in vfs_link with vfs_require_writable_path
- Validate mountpoint in init_mount_fs and kconsole mount (must exist and be directory)
- Add spinlock to g_blockdevs with irqsave/irqrestore protection
- Remove const from blockdev_claim/release API (block_device_t* instead of const*)
Files modified:
- src/kernel/syscall.c: MS_REMOUNT fix, ftruncate readonly check
- src/kernel/fs.c: mount replacement rejection, vfs_link readonly check, bdev const removal
- src/kernel/init.c: mountpoint validation, init_mount_fs leak fix, blockdev_init_lock call
- src/kernel/kconsole.c: mountpoint validation
- include/blockdev.h: spinlock include, const removal from API
- src/kernel/blockdev.c: spinlock implementation, const removal from functions
- include/fs.h: const removal from bdev, mount function signatures
- include/ext2.h: const removal from bdev, mount signature
- include/fat.h: const removal from bdev, mount signature
- src/kernel/ext2.c: const removal from mount signature
- src/kernel/fat.c: const removal from mount signature
- src/drivers/virtio_blk.c: const removal from ops functions
- include/kernel/init.h: const removal from init_mount_fs signature
Test results:
- Smoke test: 119/119 PASS
- cppcheck: style-level warnings only (no errors)