diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-06-25 08:48:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:19 -0400 |
commit | a4d27e75ffb7b8ecb7eed0c7db0df975525f3fd7 (patch) | |
tree | 2353706a33196438547ed4651afd9f2d81dd96e8 /Documentation | |
parent | f9a2842e5612b93fa20a624a8baa6c2a7ecea504 (diff) |
[PATCH] fuse: add request interruption
Add synchronous request interruption. This is needed for file locking
operations which have to be interruptible. However filesystem may implement
interruptibility of other operations (e.g. like NFS 'intr' mount option).
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/fuse.txt | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/Documentation/filesystems/fuse.txt b/Documentation/filesystems/fuse.txt index 324df27704cc..a584f05403a4 100644 --- a/Documentation/filesystems/fuse.txt +++ b/Documentation/filesystems/fuse.txt | |||
@@ -124,6 +124,46 @@ For each connection the following files exist within this directory: | |||
124 | 124 | ||
125 | Only the owner of the mount may read or write these files. | 125 | Only the owner of the mount may read or write these files. |
126 | 126 | ||
127 | Interrupting filesystem operations | ||
128 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
129 | |||
130 | If a process issuing a FUSE filesystem request is interrupted, the | ||
131 | following will happen: | ||
132 | |||
133 | 1) If the request is not yet sent to userspace AND the signal is | ||
134 | fatal (SIGKILL or unhandled fatal signal), then the request is | ||
135 | dequeued and returns immediately. | ||
136 | |||
137 | 2) If the request is not yet sent to userspace AND the signal is not | ||
138 | fatal, then an 'interrupted' flag is set for the request. When | ||
139 | the request has been successfully transfered to userspace and | ||
140 | this flag is set, an INTERRUPT request is queued. | ||
141 | |||
142 | 3) If the request is already sent to userspace, then an INTERRUPT | ||
143 | request is queued. | ||
144 | |||
145 | INTERRUPT requests take precedence over other requests, so the | ||
146 | userspace filesystem will receive queued INTERRUPTs before any others. | ||
147 | |||
148 | The userspace filesystem may ignore the INTERRUPT requests entirely, | ||
149 | or may honor them by sending a reply to the _original_ request, with | ||
150 | the error set to EINTR. | ||
151 | |||
152 | It is also possible that there's a race between processing the | ||
153 | original request and it's INTERRUPT request. There are two possibilities: | ||
154 | |||
155 | 1) The INTERRUPT request is processed before the original request is | ||
156 | processed | ||
157 | |||
158 | 2) The INTERRUPT request is processed after the original request has | ||
159 | been answered | ||
160 | |||
161 | If the filesystem cannot find the original request, it should wait for | ||
162 | some timeout and/or a number of new requests to arrive, after which it | ||
163 | should reply to the INTERRUPT request with an EAGAIN error. In case | ||
164 | 1) the INTERRUPT request will be requeued. In case 2) the INTERRUPT | ||
165 | reply will be ignored. | ||
166 | |||
127 | Aborting a filesystem connection | 167 | Aborting a filesystem connection |
128 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 168 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
129 | 169 | ||
@@ -351,10 +391,10 @@ but is caused by a pagefault. | |||
351 | 391 | ||
352 | Solution is basically the same as above. | 392 | Solution is basically the same as above. |
353 | 393 | ||
354 | An additional problem is that while the write buffer is being | 394 | An additional problem is that while the write buffer is being copied |
355 | copied to the request, the request must not be interrupted. This | 395 | to the request, the request must not be interrupted/aborted. This is |
356 | is because the destination address of the copy may not be valid | 396 | because the destination address of the copy may not be valid after the |
357 | after the request is interrupted. | 397 | request has returned. |
358 | 398 | ||
359 | This is solved with doing the copy atomically, and allowing abort | 399 | This is solved with doing the copy atomically, and allowing abort |
360 | while the page(s) belonging to the write buffer are faulted with | 400 | while the page(s) belonging to the write buffer are faulted with |