login
Header Space

 
 

Re: [PATCH] Rewrite proc seq operations via seq_list_xxx ones

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pavel Emelyanov <xemul@...>
Cc: Jens Axboe <jens.axboe@...>, Linux Kernel Mailing List <linux-kernel@...>, <devel@...>
Date: Wednesday, October 10, 2007 - 11:10 am

* Pavel Emelyanov (xemul@openvz.org) wrote:

The problem is that the list can change between two consecutive reads.
And yes, all proc files using lists are affected, but changing every
proc file users is a quite large task.

A problematic sequence would be:

1st procfs read()
*_start()
- mutex down
- seq list start

*_next()
- seq list next

*_stop()
- mutex up
end of 1st procfs read()

mutex down
-> Removing a list entry
mutex up

2nd procfs read()
*_start()
- mutex down
... we now skip a list entry depending on the relative position of our
iterator and the deletion.

The mutex is taken/released at each and every read, therefore not
protecting against modifications across reads.

Mathieu



-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Rewrite proc seq operations via seq_list_xxx ones, Pavel Emelyanov, (Wed Oct 10, 7:10 am)
Re: [PATCH] Rewrite proc seq operations via seq_list_xxx ones, Mathieu Desnoyers, (Wed Oct 10, 10:45 am)
Re: [PATCH] Rewrite proc seq operations via seq_list_xxx ones, Pavel Emelyanov, (Wed Oct 10, 10:56 am)
Re: [PATCH] Rewrite proc seq operations via seq_list_xxx ones, Mathieu Desnoyers, (Wed Oct 10, 11:10 am)
speck-geostationary