diff options
author | Louis Rilling <louis.rilling@kerlabs.com> | 2008-06-23 14:16:17 +0200 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-08-01 01:21:12 +0200 |
commit | 4768e9b18dc63719209c68920d4ae52dc49b6161 (patch) | |
tree | ee9e805c405ea6a6cdf44ba30fd66047bc522b1b /fs/configfs/configfs_internal.h | |
parent | [PATCH] configfs: Include linux/err.h in linux/configfs.h (diff) | |
download | linux-4768e9b18dc63719209c68920d4ae52dc49b6161.tar.xz linux-4768e9b18dc63719209c68920d4ae52dc49b6161.zip |
[PATCH] configfs: Fix symlink() to a removing item
The rule for configfs symlinks is that symlinks always point to valid
config_items, and prevent the target from being removed. However,
configfs_symlink() only checks that it can grab a reference on the target item,
without ensuring that it remains alive until the symlink is correctly attached.
This patch makes configfs_symlink() fail whenever the target is being removed,
using the CONFIGFS_USET_DROPPING flag set by configfs_detach_prep() and
protected by configfs_dirent_lock.
This patch introduces a similar (weird?) behavior as with mkdir failures making
rmdir fail: if symlink() races with rmdir() of the parent directory (or its
youngest user-created ancestor if parent is a default group) or rmdir() of the
target directory, and then fails in configfs_create(), this can make the racing
rmdir() fail despite the concerned directory having no user-created entry (resp.
no symlink pointing to it or one of its default groups) in the end.
This behavior is fixed in later patches.
Signed-off-by: Louis Rilling <louis.rilling@kerlabs.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/configfs/configfs_internal.h')
0 files changed, 0 insertions, 0 deletions