X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/7b8a1bcad75628f9add4590db2bb9b8e418ee8eb..0765e7c133eb393d8cd0292af444543c2edf8ccc:/lunaix-os/kernel/fs/mount.c diff --git a/lunaix-os/kernel/fs/mount.c b/lunaix-os/kernel/fs/mount.c index 96cc741..2b996d4 100644 --- a/lunaix-os/kernel/fs/mount.c +++ b/lunaix-os/kernel/fs/mount.c @@ -63,6 +63,8 @@ __vfs_do_unmount(struct v_mount* mnt) mnt_chillax(mnt->parent); + mnt->mnt_point->mnt = mnt->parent; + vfs_sb_free(sb); atomic_fetch_sub(&mnt->mnt_point->ref_count, 1); vfree(mnt); @@ -249,6 +251,11 @@ __DEFINE_LXSYSCALL4(int, goto done; } + if (mnt->mnt->mnt_point == mnt) { + errno = EBUSY; + goto done; + } + // By our convention. // XXX could we do better? struct device* device = NULL;