Obviously, using mknod is not going to be as a common situation as
the ln issues will be. However, if you truely want to lock a device for
exclusive access, it must be absolute locking and that can only be
done by locking the major/minor codes.
Phil Burr
>1. swapon
>
>People complain to me that under recent kernels it is
>possible to do "swapon foo" on the same file twice,
>and twice some amount is added to the available swap.
>
>No, this is not a bug in the swapon which I maintain;
>it is a kernel bug present in 2.1.87 but not in 2.0.33.
>
>I wondered how to fix it but was not sure how to express
>the property of not being in use under the 2.1.* regime.
>In the good old days, testing i_count = 1 would suffice.
>Today, testing d_count = 1 is not enough, because two
>names can refer to the same file, and
> ln foo bar; swapon foo; swapon bar
>would succeed incorrectly.
>On the other hand, testing i_count = 1 is no good either.
>Indeed, i_count has become next to meaningless: there can
>always be dentries that refer to the inode. Thus,
> ln foo bar; swapon foo
>would fail because two dentries refer to the inode of foo.
>
>How does one express that a file is not in use?
>
>(In case anyone answers, cc to aeb@cwi.nl; I do not read linux-kernel.)
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu