Re: [PATCH ?] iprune_sem

From: Hugh Dickins
Date: Mon Aug 11 2003 - 11:25:57 EST


On Sun, 10 Aug 2003, Frederick, Fabian wrote:
>
> Someone could tell me why we don't use iprune_sem in get_new_inode
> like this ?
> http://fabian.unixtech.be/kernel/inode060803.diff

1. iprune_sem was introduced for a specific umount versus prune race,
see the comment upon it: no bearing on get_new_inode whatsoever.
2. How would downing a semaphore just before the spin_lock,
upping it just after the spin_unlock, serve any purpose?
3. If it were useful, it should be upped on the exceptional path too.
4. Don't change "locked inode" comment to "inode unlocked": I_LOCK is set.
5. But worst of all, you remove the whole point of the old = find_inode.

I think you're trying to say, a semaphore (not placed where you have it)
could be used to prevent two tasks from allocating the same inode at the
same time. Yes, but would single-thread inode allocation disastrously:
much more efficient for both to try and check - as get_new_inode does.

Hugh

-
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/