]> git.baikalelectronics.ru Git - kernel.git/commit
sysv: use BUILD_BUG_ON instead of runtime check
authorPavel Skripkin <paskripkin@gmail.com>
Tue, 9 Nov 2021 02:35:25 +0000 (18:35 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Nov 2021 18:02:52 +0000 (10:02 -0800)
commit18d249cddf2476d5cb3f1a2e807656b2e334a688
tree5a1fe1a7d9ba50d3ba07f41c2f864b1b3ef3e17b
parent0a67a9cdba8dc39aaba5b9e98e5eead946359cc7
sysv: use BUILD_BUG_ON instead of runtime check

There were runtime checks about sizes of struct v7_super_block and struct
sysv_inode.  If one of these checks fail the kernel will panic.  Since
these values are known at compile time let's use BUILD_BUG_ON(), because
it's a standard mechanism for validation checking at build time

Link: https://lkml.kernel.org/r/20210813123020.22971-1-paskripkin@gmail.com
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/sysv/super.c