Pull orangefs updates from Mike Marshall: "A fix and two cleanups. Fix: - Christoph Hellwig noticed that some logic I added to orangefs_file_read_iter introduced a race condition, so he sent a reversion patch. I had to modify his patch since reverting at this point broke Orangefs. Cleanups: - Christoph Hellwig noticed that we were doing some unnecessary work in orangefs_flush, so he sent in a patch that removed the un-needed code. - Al Viro told me he had trouble building Orangefs. Orangefs should be easy to build, even for Al :-). I looked back at the test server build notes in orangefs.txt, just in case that's where the trouble really is, and found a couple of typos and made a couple of clarifications" * tag 'for-linus-5.7-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: clarify build steps for test server in orangefs.txt orangefs: don't mess with I_DIRTY_TIMES in orangefs_flush orangefs: get rid of knob code...
Unified · Split
| @@ -41,16 +41,6 @@ Documentation · 40 unmodified lines | ||
| 41 | 41 | |
| 42 | 42 | http://www.orangefs.org/documentation/ |
| 43 | 43 | |
| 44 | − | |
| 45 | −Userspace Filesystem Source | |
| 46 | −=========================== | |
| 47 | − | |
| 48 | −http://www.orangefs.org/download | |
| 49 | − | |
| 50 | −Orangefs versions prior to 2.9.3 would not be compatible with the | |
| 51 | −upstream version of the kernel client. | |
| 52 | − | |
| 53 | − | |
| 54 | 44 | Running ORANGEFS On a Single Server |
| 55 | 45 | =================================== |
| 56 | 46 | |
| @@ -94,6 +84,14 @@ Mount the filesystem:: · 37 unmodified lines | ||
| 94 | 84 | |
| 95 | 85 | mount -t pvfs2 tcp://localhost:3334/orangefs /pvfsmnt |
| 96 | 86 | |
| 87 | +Userspace Filesystem Source | |
| 88 | +=========================== | |
| 89 | + | |
| 90 | +http://www.orangefs.org/download | |
| 91 | + | |
| 92 | +Orangefs versions prior to 2.9.3 would not be compatible with the | |
| 93 | +upstream version of the kernel client. | |
| 94 | + | |
| 97 | 95 | |
| 98 | 96 | Building ORANGEFS on a Single Server |
| 99 | 97 | ==================================== |
| @@ -107,18 +105,24 @@ default, we will probably be changing the default to LMDB soon. · 7 unmodified lines | ||
| 107 | 105 | |
| 108 | 106 | :: |
| 109 | 107 | |
| 110 | − ./configure --prefix=/opt/ofs --with-db-backend=lmdb | |
| 108 | + ./configure --prefix=/opt/ofs --with-db-backend=lmdb --disable-usrint | |
| 111 | 109 | |
| 112 | 110 | make |
| 113 | 111 | |
| 114 | 112 | make install |
| 115 | 113 | |
| 116 | −Create an orangefs config file:: | |
| 114 | +Create an orangefs config file by running pvfs2-genconfig and | |
| 115 | +specifying a target config file. Pvfs2-genconfig will prompt you | |
| 116 | +through. Generally it works fine to take the defaults, but you | |
| 117 | +should use your server's hostname, rather than "localhost" when | |
| 118 | +it comes to that question:: | |
| 117 | 119 | |
| 118 | 120 | /opt/ofs/bin/pvfs2-genconfig /etc/pvfs2.conf |
| 119 | 121 | |
| 120 | 122 | Create an /etc/pvfs2tab file:: |
| 121 | 123 | |
| 124 | +Localhost is fine for your pvfs2tab file: | |
| 125 | + | |
| 122 | 126 | echo tcp://localhost:3334/orangefs /pvfsmnt pvfs2 defaults,noauto 0 0 > \ |
| 123 | 127 | /etc/pvfs2tab |
| 124 | 128 | |
| @@ -132,7 +136,7 @@ Bootstrap the server:: · 7 unmodified lines | ||
| 132 | 136 | |
| 133 | 137 | Start the server:: |
| 134 | 138 | |
| 135 | − /opt/osf/sbin/pvfs2-server /etc/pvfs2.conf | |
| 139 | + /opt/ofs/sbin/pvfs2-server /etc/pvfs2.conf | |
| 136 | 140 | |
| 137 | 141 | Now the server should be running. Pvfs2-ls is a simple |
| 138 | 142 | test to verify that the server is running:: |
| @@ -142,11 +146,11 @@ test to verify that the server is running:: · 3 unmodified lines | ||
| 142 | 146 | If stuff seems to be working, load the kernel module and |
| 143 | 147 | turn on the client core:: |
| 144 | 148 | |
| 145 | − /opt/ofs/sbin/pvfs2-client -p /opt/osf/sbin/pvfs2-client-core | |
| 149 | + /opt/ofs/sbin/pvfs2-client -p /opt/ofs/sbin/pvfs2-client-core | |
| 146 | 150 | |
| 147 | 151 | Mount your filesystem:: |
| 148 | 152 | |
| 149 | − mount -t pvfs2 tcp://localhost:3334/orangefs /pvfsmnt | |
| 153 | + mount -t pvfs2 tcp://`hostname`:3334/orangefs /pvfsmnt | |
| 150 | 154 | |
| 151 | 155 | |
| 152 | 156 | Running xfstests |
| @@ -346,23 +346,8 @@ static ssize_t orangefs_file_read_iter(struct kiocb *iocb, · 345 unmodified lines | ||
| 346 | 346 | struct iov_iter *iter) |
| 347 | 347 | { |
| 348 | 348 | int ret; |
| 349 | − struct orangefs_read_options *ro; | |
| 350 | − | |
| 351 | 349 | orangefs_stats.reads++; |
| 352 | 350 | |
| 353 | − /* | |
| 354 | − * Remember how they set "count" in read(2) or pread(2) or whatever - | |
| 355 | − * users can use count as a knob to control orangefs io size and later | |
| 356 | − * we can try to help them fill as many pages as possible in readpage. | |
| 357 | − */ | |
| 358 | − if (!iocb->ki_filp->private_data) { | |
| 359 | − iocb->ki_filp->private_data = kmalloc(sizeof *ro, GFP_KERNEL); | |
| 360 | − if (!iocb->ki_filp->private_data) | |
| 361 | − return(ENOMEM); | |
| 362 | − ro = iocb->ki_filp->private_data; | |
| 363 | − ro->blksiz = iter->count; | |
| 364 | − } | |
| 365 | − | |
| 366 | 351 | down_read(&file_inode(iocb->ki_filp)->i_rwsem); |
| 367 | 352 | ret = orangefs_revalidate_mapping(file_inode(iocb->ki_filp)); |
| 368 | 353 | if (ret) |
| @@ -650,12 +635,6 @@ static int orangefs_lock(struct file *filp, int cmd, struct file_lock *fl) · 281 unmodified lines | ||
| 650 | 635 | return rc; |
| 651 | 636 | } |
| 652 | 637 | |
| 653 | −static int orangefs_file_open(struct inode * inode, struct file *file) | |
| 654 | −{ | |
| 655 | − file->private_data = NULL; | |
| 656 | − return generic_file_open(inode, file); | |
| 657 | −} | |
| 658 | − | |
| 659 | 638 | static int orangefs_flush(struct file *file, fl_owner_t id) |
| 660 | 639 | { |
| 661 | 640 | /* |
| @@ -666,19 +645,8 @@ static int orangefs_flush(struct file *file, fl_owner_t id) · 4 unmodified lines | ||
| 666 | 645 | * on an explicit fsync call. This duplicates historical OrangeFS |
| 667 | 646 | * behavior. |
| 668 | 647 | */ |
| 669 | − struct inode *inode = file->f_mapping->host; | |
| 670 | 648 | int r; |
| 671 | 649 | |
| 672 | − kfree(file->private_data); | |
| 673 | − file->private_data = NULL; | |
| 674 | − | |
| 675 | − if (inode->i_state & I_DIRTY_TIME) { | |
| 676 | − spin_lock(&inode->i_lock); | |
| 677 | − inode->i_state &= ~I_DIRTY_TIME; | |
| 678 | − spin_unlock(&inode->i_lock); | |
| 679 | − mark_inode_dirty_sync(inode); | |
| 680 | − } | |
| 681 | − | |
| 682 | 650 | r = filemap_write_and_wait_range(file->f_mapping, 0, LLONG_MAX); |
| 683 | 651 | if (r > 0) |
| 684 | 652 | return 0; |
| @@ -694,7 +662,7 @@ const struct file_operations orangefs_file_operations = { · 9 unmodified lines | ||
| 694 | 662 | .lock = orangefs_lock, |
| 695 | 663 | .unlocked_ioctl = orangefs_ioctl, |
| 696 | 664 | .mmap = orangefs_file_mmap, |
| 697 | − .open = orangefs_file_open, | |
| 665 | + .open = generic_file_open, | |
| 698 | 666 | .flush = orangefs_flush, |
| 699 | 667 | .release = orangefs_file_release, |
| 700 | 668 | .fsync = orangefs_fsync, |
| @@ -259,46 +259,19 @@ static int orangefs_readpage(struct file *file, struct page *page) · 258 unmodified lines | ||
| 259 | 259 | pgoff_t index; /* which page */ |
| 260 | 260 | struct page *next_page; |
| 261 | 261 | char *kaddr; |
| 262 | − struct orangefs_read_options *ro = file->private_data; | |
| 263 | 262 | loff_t read_size; |
| 264 | − loff_t roundedup; | |
| 265 | 263 | int buffer_index = -1; /* orangefs shared memory slot */ |
| 266 | 264 | int slot_index; /* index into slot */ |
| 267 | 265 | int remaining; |
| 268 | 266 | |
| 269 | 267 | /* |
| 270 | − * If they set some miniscule size for "count" in read(2) | |
| 271 | − * (for example) then let's try to read a page, or the whole file | |
| 272 | − * if it is smaller than a page. Once "count" goes over a page | |
| 273 | − * then lets round up to the highest page size multiple that is | |
| 274 | − * less than or equal to "count" and do that much orangefs IO and | |
| 275 | − * try to fill as many pages as we can from it. | |
| 276 | − * | |
| 277 | − * "count" should be represented in ro->blksiz. | |
| 278 | − * | |
| 279 | − * inode->i_size = file size. | |
| 268 | + * Get up to this many bytes from Orangefs at a time and try | |
| 269 | + * to fill them into the page cache at once. Tests with dd made | |
| 270 | + * this seem like a reasonable static number, if there was | |
| 271 | + * interest perhaps this number could be made setable through | |
| 272 | + * sysfs... | |
| 280 | 273 | */ |
| 281 | − if (ro) { | |
| 282 | − if (ro->blksiz < PAGE_SIZE) { | |
| 283 | − if (inode->i_size < PAGE_SIZE) | |
| 284 | − read_size = inode->i_size; | |
| 285 | − else | |
| 286 | − read_size = PAGE_SIZE; | |
| 287 | − } else { | |
| 288 | − roundedup = ((PAGE_SIZE - 1) & ro->blksiz) ? | |
| 289 | − ((ro->blksiz + PAGE_SIZE) & ~(PAGE_SIZE -1)) : | |
| 290 | − ro->blksiz; | |
| 291 | − if (roundedup > inode->i_size) | |
| 292 | − read_size = inode->i_size; | |
| 293 | − else | |
| 294 | − read_size = roundedup; | |
| 295 | − | |
| 296 | − } | |
| 297 | − } else { | |
| 298 | − read_size = PAGE_SIZE; | |
| 299 | − } | |
| 300 | − if (!read_size) | |
| 301 | − read_size = PAGE_SIZE; | |
| 274 | + read_size = 524288; | |
| 302 | 275 | |
| 303 | 276 | if (PageDirty(page)) |
| 304 | 277 | orangefs_launder_page(page); |
| @@ -239,10 +239,6 @@ struct orangefs_write_range { · 238 unmodified lines | ||
| 239 | 239 | kgid_t gid; |
| 240 | 240 | }; |
| 241 | 241 | |
| 242 | −struct orangefs_read_options { | |
| 243 | − ssize_t blksiz; | |
| 244 | −}; | |
| 245 | − | |
| 246 | 242 | extern struct orangefs_stats orangefs_stats; |
| 247 | 243 | |
| 248 | 244 | /* |