On Tue, Nov 5, 2019 at 9:16 PM akpm@linux-foundation.org wrote:
From: Shuning Zhang sunny.s.zhang@oracle.com Subject: ocfs2: protect extent tree in ocfs2_prepare_inode_for_write()
When the extent tree is modified, it should be protected by inode cluster lock and ip_alloc_sem.
The extent tree is accessed and modified in the ocfs2_prepare_inode_for_write, but isn't protected by ip_alloc_sem.
This patch results in a new warning for me:
fs/ocfs2/file.c:2101:12: warning: ‘ocfs2_prepare_inode_for_refcount’ defined but not used [-Wunused-function] 2101 | static int ocfs2_prepare_inode_for_refcount(struct inode *inode, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and I'm wondering why nobody seems to have noticed that or fixed things? Because it does look like this removed the only use of that function, and everybody who compiled this should have seen this warning?
Was this not tested at all?
Linus