Re: [PATCH 04/23] vfs: Introduce infrastructure for revoking a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

On Tue, Jun 2, 2009 at 12:50 AM, Eric W. Biederman
<ebiederm@xxxxxxxxxxxx> wrote:
> +#ifdef CONFIG_FILE_HOTPLUG
> +
> +static bool file_in_use(struct file *file)
> +{
> +       struct task_struct *leader, *task;
> +       bool in_use = false;
> +       int i;
> +
> +       rcu_read_lock();
> +       do_each_thread(leader, task) {
> +               for (i = 0; i < MAX_FILE_HOTPLUG_LOCK_DEPTH; i++) {
> +                       if (task->file_hotplug_lock[i] == file) {
> +                               in_use = true;
> +                               goto found;
> +                       }
> +               }
> +       } while_each_thread(leader, task);
> +found:
> +       rcu_read_unlock();
> +       return in_use;
> +}

This seems rather heavy-weight. If we're going to use this
infrastructure for forced unmount, I think this will be a problem.

Can't we two this in two stages: (1) mark a bit that forces
file_hotplug_read_trylock to always fail and (2) block until the last
remaining in-kernel file_hotplug_read_unlock() has executed?

                        Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux