Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kvack.org/~bcrl/aio-fixes

Pull aio fix from Ben LaHaise:
"Dirty page accounting fix for aio"

* git://git.kvack.org/~bcrl/aio-fixes:
aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer

+14 -7
+14 -7
fs/aio.c
··· 165 165 static const struct file_operations aio_ring_fops; 166 166 static const struct address_space_operations aio_ctx_aops; 167 167 168 + /* Backing dev info for aio fs. 169 + * -no dirty page accounting or writeback happens 170 + */ 171 + static struct backing_dev_info aio_fs_backing_dev_info = { 172 + .name = "aiofs", 173 + .state = 0, 174 + .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK | BDI_CAP_MAP_COPY, 175 + }; 176 + 168 177 static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) 169 178 { 170 179 struct qstr this = QSTR_INIT("[aio]", 5); ··· 185 176 186 177 inode->i_mapping->a_ops = &aio_ctx_aops; 187 178 inode->i_mapping->private_data = ctx; 179 + inode->i_mapping->backing_dev_info = &aio_fs_backing_dev_info; 188 180 inode->i_size = PAGE_SIZE * nr_pages; 189 181 190 182 path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this); ··· 229 219 aio_mnt = kern_mount(&aio_fs); 230 220 if (IS_ERR(aio_mnt)) 231 221 panic("Failed to create aio fs mount."); 222 + 223 + if (bdi_init(&aio_fs_backing_dev_info)) 224 + panic("Failed to init aio fs backing dev info."); 232 225 233 226 kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC); 234 227 kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC); ··· 293 280 static const struct file_operations aio_ring_fops = { 294 281 .mmap = aio_ring_mmap, 295 282 }; 296 - 297 - static int aio_set_page_dirty(struct page *page) 298 - { 299 - return 0; 300 - } 301 283 302 284 #if IS_ENABLED(CONFIG_MIGRATION) 303 285 static int aio_migratepage(struct address_space *mapping, struct page *new, ··· 365 357 #endif 366 358 367 359 static const struct address_space_operations aio_ctx_aops = { 368 - .set_page_dirty = aio_set_page_dirty, 360 + .set_page_dirty = __set_page_dirty_no_writeback, 369 361 #if IS_ENABLED(CONFIG_MIGRATION) 370 362 .migratepage = aio_migratepage, 371 363 #endif ··· 420 412 pr_debug("pid(%d) page[%d]->count=%d\n", 421 413 current->pid, i, page_count(page)); 422 414 SetPageUptodate(page); 423 - SetPageDirty(page); 424 415 unlock_page(page); 425 416 426 417 ctx->ring_pages[i] = page;