lkml.org 
[lkml]   [2009]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 5/9] vfs: Introduce basic infrastructure for revoking a file
Hi, Eric,

One little thing I noticed as I was looking at this...

> +int fops_substitute(struct file *file, const struct file_operations *f_op,
> + struct vm_operations_struct *vm_ops)
> +{

[...]

> + /*
> + * Wait until there are no more callers in the original
> + * file_operations methods.
> + */
> + while (atomic_long_read(&file->f_use) > 0)
> + schedule_timeout_interruptible(1);

You use an interruptible sleep here, but there's no signal check to get you
out of the loop. So it's not really interruptible. If f_use never goes to
zero (a distressingly likely possibility, I fear), this code will create
the equivalent of an unkillable D-wait state without ever actually showing
up that way in "ps".

Actually, now that I look, once you've got a signal pending you'll stay
in TASK_RUNNING, so the above could turn into a busy-wait.

Unless I've missed something...?

I have no idea what the right thing to do in the face of a signal would
be. Perhaps the wait-for-zero and release() call stuff should be dumped
into a workqueue and done asynchronously? OTOH, I can see a need to know
when the revoke operation is really done...

jon


\
 
 \ /
  Last update: 2009-04-15 00:15    [W:0.486 / U:10.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site