summaryrefslogtreecommitdiffstats
path: root/include/linux/ptrace.h
diff options
context:
space:
mode:
authorLouis Rilling2008-06-16 19:01:01 +0200
committerMark Fasheh2008-07-14 22:57:16 +0200
commitb3e76af87441fc36eef3516d73ab2314e7b2d911 (patch)
tree36c6c6a21ac16b609302845a7dcb91749a972e4c /include/linux/ptrace.h
parentconfigfs: Make configfs_new_dirent() return error code instead of NULL (diff)
downloadkernel-qcow2-linux-b3e76af87441fc36eef3516d73ab2314e7b2d911.tar.gz
kernel-qcow2-linux-b3e76af87441fc36eef3516d73ab2314e7b2d911.tar.xz
kernel-qcow2-linux-b3e76af87441fc36eef3516d73ab2314e7b2d911.zip
configfs: Fix deadlock with racing rmdir() and rename()
This patch fixes the deadlock between racing sys_rename() and configfs_rmdir(). The idea is to avoid locking i_mutexes of default groups in configfs_detach_prep(), and rely instead on the new configfs_dirent_lock to protect against configfs_dirent's linkage mutations. To ensure that an mkdir() racing with rmdir() will not create new items in a to-be-removed default group, we make configfs_new_dirent() check for the CONFIGFS_USET_DROPPING flag right before linking the new dirent, and return error if the flag is set. This makes racing mkdir()/symlink()/dir_open() fail in places where errors could already happen, resp. in (attach_item()|attach_group())/create_link()/new_dirent(). configfs_depend() remains safe since it locks all the path from configfs root, and is thus mutually exclusive with rmdir(). An advantage of this is that now detach_groups() unconditionnaly takes the default groups i_mutex, which makes it more consistent with populate_groups(). Signed-off-by: Louis Rilling <Louis.Rilling@kerlabs.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'include/linux/ptrace.h')
0 files changed, 0 insertions, 0 deletions