Re: [PATCH -mm 1/9] unshare system call : system call handler function sys_unshare

From: Al Viro
Date: Tue Dec 13 2005 - 08:44:25 EST


On Mon, Dec 12, 2005 at 09:59:50PM -0500, JANAK DESAI wrote:
> + task_lock(current);
> +
> + if (new_fs) {
> + fs = current->fs;
> + current->fs = new_fs;
> + put_fs_struct(fs);

Nope. You can't drop those under a spinlock; leave the pointer e.g. in
new_fs and drop everything after task_unlock(). Incidentally, it allows
to merge cleanup for normal and failure exits.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/