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