diff options
author | Sage Weil <sage@newdream.net> | 2010-03-01 12:57:54 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-03-01 18:28:00 -0500 |
commit | 195d3ce2cc9a8ec69827f6369c41b269345b9988 (patch) | |
tree | 9ef91489d379ac612895b6ab3118535969aba152 /fs/ceph/file.c | |
parent | 6f863e712d4114e8ae2f02de64ebeac0546ebaa0 (diff) |
ceph: return EBADF if waiting for caps on closed file
Verify the file is actually open for the given caps when we are
waiting for caps. This ensures we will wake up and return EBADF
if another thread closes the file out from under us.
Note that EBADF is also the correct return code from write(2)
when called on a file handle opened for reading (although the
vfs should catch that).
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 88932c9145e9..5d2af8464f6a 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -262,6 +262,9 @@ int ceph_release(struct inode *inode, struct file *file) | |||
262 | kfree(cf->dir_info); | 262 | kfree(cf->dir_info); |
263 | dput(cf->dentry); | 263 | dput(cf->dentry); |
264 | kmem_cache_free(ceph_file_cachep, cf); | 264 | kmem_cache_free(ceph_file_cachep, cf); |
265 | |||
266 | /* wake up anyone waiting for caps on this inode */ | ||
267 | wake_up(&ci->i_cap_wq); | ||
265 | return 0; | 268 | return 0; |
266 | } | 269 | } |
267 | 270 | ||