From 0d31d2c85eea418137cbbc9509e10820fb6571fe Mon Sep 17 00:00:00 2001 From: zab Date: Sun, 5 Oct 2003 16:29:37 +0000 Subject: [PATCH] b=2030 Queue IO in writepage when dirty pages first arrive there. Previously it was assumed that commit_write() was involved, which isn't the case for writes via mmap(). mmap() still isn't correct across the cluster, but at least pages won't get lost in writeback. In the process of adding a sanity test for this some mmap() operations are added to multiop and sanity gets a helper to find the page size. --- lustre/llite/llite_internal.h | 2 ++ lustre/tests/multiop.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 35d69be..50dfaea 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -96,6 +96,8 @@ void ll_complete_writepage_26(struct obd_client_page *ocp, int rc); #endif int ll_sync_page(struct page *page); int ll_ocp_update_obdo(struct obd_client_page *ocp, int cmd, struct obdo *oa); +int ll_ocp_set_io_ready(struct obd_client_page *ocp, int cmd); +int ll_ocp_update_io_args(struct obd_client_page *ocp, int cmd); void ll_removepage(struct page *page); int ll_readpage(struct file *file, struct page *page); diff --git a/lustre/tests/multiop.c b/lustre/tests/multiop.c index 9dc6cc2..6436190 100755 --- a/lustre/tests/multiop.c +++ b/lustre/tests/multiop.c @@ -22,7 +22,7 @@ char usage[] = " u unlink\n" " U munmap\n" " m mknod\n" -" M mmap to EOF (must open and stat prior)\n" +" M rw mmap to EOF (must open and stat prior)\n" " c close\n" " _ wait for signal\n" " R reference entire mmap-ed region\n" @@ -32,6 +32,7 @@ char usage[] = " t fchmod\n" " T ftruncate to zero\n" " w write\n" +" W write entire mmap-ed region\n" " z seek to zero\n"; void null_handler(int unused) { } @@ -79,8 +80,8 @@ int main(int argc, char **argv) break; case 'M': mmap_len = st.st_size; - mmap_ptr = mmap(NULL, mmap_len, PROT_READ, MAP_SHARED, - fd, 0); + mmap_ptr = mmap(NULL, mmap_len, PROT_WRITE | PROT_READ, + MAP_SHARED, fd, 0); if (mmap_ptr == MAP_FAILED) { perror("mmap"); exit(1); @@ -153,6 +154,10 @@ int main(int argc, char **argv) exit(1); } break; + case 'W': + for (i = 0; i < mmap_len && mmap_ptr; i += 4096) + mmap_ptr[i] += junk++; + break; case 'z': if (lseek(fd, 0, SEEK_SET) == -1) { perror("lseek"); -- 1.8.3.1