diff options
| -rw-r--r-- | fs/ceph/addr.c | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 23bb0ceabe31..ce8ef6107727 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
| @@ -919,6 +919,10 @@ static int context_is_writeable_or_written(struct inode *inode, | |||
| 919 | /* | 919 | /* | 
| 920 | * We are only allowed to write into/dirty the page if the page is | 920 | * We are only allowed to write into/dirty the page if the page is | 
| 921 | * clean, or already dirty within the same snap context. | 921 | * clean, or already dirty within the same snap context. | 
| 922 | * | ||
| 923 | * called with page locked. | ||
| 924 | * return success with page locked, | ||
| 925 | * or any failure (incl -EAGAIN) with page unlocked. | ||
| 922 | */ | 926 | */ | 
| 923 | static int ceph_update_writeable_page(struct file *file, | 927 | static int ceph_update_writeable_page(struct file *file, | 
| 924 | loff_t pos, unsigned len, | 928 | loff_t pos, unsigned len, | 
| @@ -961,9 +965,11 @@ retry_locked: | |||
| 961 | snapc = ceph_get_snap_context((void *)page->private); | 965 | snapc = ceph_get_snap_context((void *)page->private); | 
| 962 | unlock_page(page); | 966 | unlock_page(page); | 
| 963 | ceph_queue_writeback(inode); | 967 | ceph_queue_writeback(inode); | 
| 964 | wait_event_interruptible(ci->i_cap_wq, | 968 | r = wait_event_interruptible(ci->i_cap_wq, | 
| 965 | context_is_writeable_or_written(inode, snapc)); | 969 | context_is_writeable_or_written(inode, snapc)); | 
| 966 | ceph_put_snap_context(snapc); | 970 | ceph_put_snap_context(snapc); | 
| 971 | if (r == -ERESTARTSYS) | ||
| 972 | return r; | ||
| 967 | return -EAGAIN; | 973 | return -EAGAIN; | 
| 968 | } | 974 | } | 
| 969 | 975 | ||
| @@ -1035,7 +1041,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping, | |||
| 1035 | int r; | 1041 | int r; | 
| 1036 | 1042 | ||
| 1037 | do { | 1043 | do { | 
| 1038 | /* get a page*/ | 1044 | /* get a page */ | 
| 1039 | page = grab_cache_page_write_begin(mapping, index, 0); | 1045 | page = grab_cache_page_write_begin(mapping, index, 0); | 
| 1040 | if (!page) | 1046 | if (!page) | 
| 1041 | return -ENOMEM; | 1047 | return -ENOMEM; | 
