Revision 28f4821b1b53e0649706912e810c6c232fc506f9 authored by Joseph Qi on 17 October 2022, 13:02:27 UTC, committed by Andrew Morton on 21 October 2022, 04:27:22 UTC
In ocfs2_mknod(), if error occurs after dinode successfully allocated,
ocfs2 i_links_count will not be 0.

So even though we clear inode i_nlink before iput in error handling, it
still won't wipe inode since we'll refresh inode from dinode during inode
lock.  So just like clear inode i_nlink, we clear ocfs2 i_links_count as
well.  Also do the same change for ocfs2_symlink().

Link: https://lkml.kernel.org/r/20221017130227.234480-2-joseph.qi@linux.alibaba.com
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reported-by: Yan Wang <wangyan122@huawei.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 759a7c6
History
File Mode Size
apparmor
bpf
integrity
keys
landlock
loadpin
lockdown
safesetid
selinux
smack
tomoyo
yama
Kconfig -rw-r--r-- 9.6 KB
Kconfig.hardening -rw-r--r-- 14.1 KB
Makefile -rw-r--r-- 892 bytes
commoncap.c -rw-r--r-- 43.0 KB
device_cgroup.c -rw-r--r-- 21.1 KB
inode.c -rw-r--r-- 10.6 KB
lsm_audit.c -rw-r--r-- 10.8 KB
min_addr.c -rw-r--r-- 1.3 KB
security.c -rw-r--r-- 66.9 KB

back to top