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

Merge tag 'for_v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull quota, ext2, reiserfs updates from Jan Kara:

- support for path (instead of device) based quotactl syscall
(quotactl_path(2))

- ext2 conversion to kmap_local()

- other minor cleanups & fixes

* tag 'for_v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
fs/reiserfs/journal.c: delete useless variables
fs/ext2: Replace kmap() with kmap_local_page()
ext2: Match up ext2_put_page() with ext2_dotdot() and ext2_find_entry()
fs/ext2/: fix misspellings using codespell tool
quota: report warning limits for realtime space quotas
quota: wire up quotactl_path
quota: Add mountpath based quota support

+168 -62
+1
arch/alpha/kernel/syscalls/syscall.tbl
··· 482 482 550 common process_madvise sys_process_madvise 483 483 551 common epoll_pwait2 sys_epoll_pwait2 484 484 552 common mount_setattr sys_mount_setattr 485 + 553 common quotactl_path sys_quotactl_path
+1
arch/arm/tools/syscall.tbl
··· 456 456 440 common process_madvise sys_process_madvise 457 457 441 common epoll_pwait2 sys_epoll_pwait2 458 458 442 common mount_setattr sys_mount_setattr 459 + 443 common quotactl_path sys_quotactl_path
+1 -1
arch/arm64/include/asm/unistd.h
··· 38 38 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5) 39 39 #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800) 40 40 41 - #define __NR_compat_syscalls 443 41 + #define __NR_compat_syscalls 444 42 42 #endif 43 43 44 44 #define __ARCH_WANT_SYS_CLONE
+2
arch/arm64/include/asm/unistd32.h
··· 893 893 __SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2) 894 894 #define __NR_mount_setattr 442 895 895 __SYSCALL(__NR_mount_setattr, sys_mount_setattr) 896 + #define __NR_quotactl_path 443 897 + __SYSCALL(__NR_quotactl_path, sys_quotactl_path) 896 898 897 899 /* 898 900 * Please add new compat syscalls above this comment and update
+1
arch/ia64/kernel/syscalls/syscall.tbl
··· 363 363 440 common process_madvise sys_process_madvise 364 364 441 common epoll_pwait2 sys_epoll_pwait2 365 365 442 common mount_setattr sys_mount_setattr 366 + 443 common quotactl_path sys_quotactl_path
+1
arch/m68k/kernel/syscalls/syscall.tbl
··· 442 442 440 common process_madvise sys_process_madvise 443 443 441 common epoll_pwait2 sys_epoll_pwait2 444 444 442 common mount_setattr sys_mount_setattr 445 + 443 common quotactl_path sys_quotactl_path
+1
arch/microblaze/kernel/syscalls/syscall.tbl
··· 448 448 440 common process_madvise sys_process_madvise 449 449 441 common epoll_pwait2 sys_epoll_pwait2 450 450 442 common mount_setattr sys_mount_setattr 451 + 443 common quotactl_path sys_quotactl_path
+1
arch/mips/kernel/syscalls/syscall_n32.tbl
··· 381 381 440 n32 process_madvise sys_process_madvise 382 382 441 n32 epoll_pwait2 compat_sys_epoll_pwait2 383 383 442 n32 mount_setattr sys_mount_setattr 384 + 443 n32 quotactl_path sys_quotactl_path
+1
arch/mips/kernel/syscalls/syscall_n64.tbl
··· 357 357 440 n64 process_madvise sys_process_madvise 358 358 441 n64 epoll_pwait2 sys_epoll_pwait2 359 359 442 n64 mount_setattr sys_mount_setattr 360 + 443 n64 quotactl_path sys_quotactl_path
+1
arch/mips/kernel/syscalls/syscall_o32.tbl
··· 430 430 440 o32 process_madvise sys_process_madvise 431 431 441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 432 432 442 o32 mount_setattr sys_mount_setattr 433 + 443 o32 quotactl_path sys_quotactl_path
+1
arch/parisc/kernel/syscalls/syscall.tbl
··· 440 440 440 common process_madvise sys_process_madvise 441 441 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 442 442 442 common mount_setattr sys_mount_setattr 443 + 443 common quotactl_path sys_quotactl_path
+1
arch/powerpc/kernel/syscalls/syscall.tbl
··· 522 522 440 common process_madvise sys_process_madvise 523 523 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 524 524 442 common mount_setattr sys_mount_setattr 525 + 443 common quotactl_path sys_quotactl_path
+1
arch/s390/kernel/syscalls/syscall.tbl
··· 445 445 440 common process_madvise sys_process_madvise sys_process_madvise 446 446 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 447 447 442 common mount_setattr sys_mount_setattr sys_mount_setattr 448 + 443 common quotactl_path sys_quotactl_path sys_quotactl_path
+1
arch/sh/kernel/syscalls/syscall.tbl
··· 445 445 440 common process_madvise sys_process_madvise 446 446 441 common epoll_pwait2 sys_epoll_pwait2 447 447 442 common mount_setattr sys_mount_setattr 448 + 443 common quotactl_path sys_quotactl_path
+1
arch/sparc/kernel/syscalls/syscall.tbl
··· 488 488 440 common process_madvise sys_process_madvise 489 489 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 490 490 442 common mount_setattr sys_mount_setattr 491 + 443 common quotactl_path sys_quotactl_path
+1
arch/x86/entry/syscalls/syscall_32.tbl
··· 447 447 440 i386 process_madvise sys_process_madvise 448 448 441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 449 449 442 i386 mount_setattr sys_mount_setattr 450 + 443 i386 quotactl_path sys_quotactl_path
+1
arch/x86/entry/syscalls/syscall_64.tbl
··· 364 364 440 common process_madvise sys_process_madvise 365 365 441 common epoll_pwait2 sys_epoll_pwait2 366 366 442 common mount_setattr sys_mount_setattr 367 + 443 common quotactl_path sys_quotactl_path 367 368 368 369 # 369 370 # Due to a historical design error, certain syscalls are numbered differently
+1
arch/xtensa/kernel/syscalls/syscall.tbl
··· 413 413 440 common process_madvise sys_process_madvise 414 414 441 common epoll_pwait2 sys_epoll_pwait2 415 415 442 common mount_setattr sys_mount_setattr 416 + 443 common quotactl_path sys_quotactl_path
+60 -34
fs/ext2/dir.c
··· 190 190 return false; 191 191 } 192 192 193 + /* 194 + * Calls to ext2_get_page()/ext2_put_page() must be nested according to the 195 + * rules documented in kmap_local_page()/kunmap_local(). 196 + * 197 + * NOTE: ext2_find_entry() and ext2_dotdot() act as a call to ext2_get_page() 198 + * and should be treated as a call to ext2_get_page() for nesting purposes. 199 + */ 193 200 static struct page * ext2_get_page(struct inode *dir, unsigned long n, 194 - int quiet) 201 + int quiet, void **page_addr) 195 202 { 196 203 struct address_space *mapping = dir->i_mapping; 197 204 struct page *page = read_mapping_page(mapping, n, NULL); 198 205 if (!IS_ERR(page)) { 199 - kmap(page); 206 + *page_addr = kmap_local_page(page); 200 207 if (unlikely(!PageChecked(page))) { 201 208 if (PageError(page) || !ext2_check_page(page, quiet)) 202 209 goto fail; ··· 212 205 return page; 213 206 214 207 fail: 215 - ext2_put_page(page); 208 + ext2_put_page(page, *page_addr); 216 209 return ERR_PTR(-EIO); 217 210 } 218 211 ··· 283 276 for ( ; n < npages; n++, offset = 0) { 284 277 char *kaddr, *limit; 285 278 ext2_dirent *de; 286 - struct page *page = ext2_get_page(inode, n, 0); 279 + struct page *page = ext2_get_page(inode, n, 0, (void **)&kaddr); 287 280 288 281 if (IS_ERR(page)) { 289 282 ext2_error(sb, __func__, ··· 292 285 ctx->pos += PAGE_SIZE - offset; 293 286 return PTR_ERR(page); 294 287 } 295 - kaddr = page_address(page); 296 288 if (unlikely(need_revalidate)) { 297 289 if (offset) { 298 290 offset = ext2_validate_entry(kaddr, offset, chunk_mask); ··· 306 300 if (de->rec_len == 0) { 307 301 ext2_error(sb, __func__, 308 302 "zero-length directory entry"); 309 - ext2_put_page(page); 303 + ext2_put_page(page, kaddr); 310 304 return -EIO; 311 305 } 312 306 if (de->inode) { ··· 318 312 if (!dir_emit(ctx, de->name, de->name_len, 319 313 le32_to_cpu(de->inode), 320 314 d_type)) { 321 - ext2_put_page(page); 315 + ext2_put_page(page, kaddr); 322 316 return 0; 323 317 } 324 318 } 325 319 ctx->pos += ext2_rec_len_from_disk(de->rec_len); 326 320 } 327 - ext2_put_page(page); 321 + ext2_put_page(page, kaddr); 328 322 } 329 323 return 0; 330 324 } ··· 338 332 * Entry is guaranteed to be valid. 339 333 * 340 334 * On Success ext2_put_page() should be called on *res_page. 335 + * 336 + * NOTE: Calls to ext2_get_page()/ext2_put_page() must be nested according to 337 + * the rules documented in kmap_local_page()/kunmap_local(). 338 + * 339 + * ext2_find_entry() and ext2_dotdot() act as a call to ext2_get_page() and 340 + * should be treated as a call to ext2_get_page() for nesting purposes. 341 341 */ 342 342 struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, 343 - const struct qstr *child, struct page **res_page) 343 + const struct qstr *child, struct page **res_page, 344 + void **res_page_addr) 344 345 { 345 346 const char *name = child->name; 346 347 int namelen = child->len; ··· 357 344 struct page *page = NULL; 358 345 struct ext2_inode_info *ei = EXT2_I(dir); 359 346 ext2_dirent * de; 347 + void *page_addr; 360 348 361 349 if (npages == 0) 362 350 goto out; 363 351 364 352 /* OFFSET_CACHE */ 365 353 *res_page = NULL; 354 + *res_page_addr = NULL; 366 355 367 356 start = ei->i_dir_start_lookup; 368 357 if (start >= npages) ··· 372 357 n = start; 373 358 do { 374 359 char *kaddr; 375 - page = ext2_get_page(dir, n, 0); 360 + page = ext2_get_page(dir, n, 0, &page_addr); 376 361 if (IS_ERR(page)) 377 362 return ERR_CAST(page); 378 363 379 - kaddr = page_address(page); 364 + kaddr = page_addr; 380 365 de = (ext2_dirent *) kaddr; 381 366 kaddr += ext2_last_byte(dir, n) - reclen; 382 367 while ((char *) de <= kaddr) { 383 368 if (de->rec_len == 0) { 384 369 ext2_error(dir->i_sb, __func__, 385 370 "zero-length directory entry"); 386 - ext2_put_page(page); 371 + ext2_put_page(page, page_addr); 387 372 goto out; 388 373 } 389 374 if (ext2_match(namelen, name, de)) 390 375 goto found; 391 376 de = ext2_next_entry(de); 392 377 } 393 - ext2_put_page(page); 378 + ext2_put_page(page, page_addr); 394 379 395 380 if (++n >= npages) 396 381 n = 0; ··· 408 393 409 394 found: 410 395 *res_page = page; 396 + *res_page_addr = page_addr; 411 397 ei->i_dir_start_lookup = n; 412 398 return de; 413 399 } ··· 418 402 * (as a parameter - p). 419 403 * 420 404 * On Success ext2_put_page() should be called on *p. 405 + * 406 + * NOTE: Calls to ext2_get_page()/ext2_put_page() must be nested according to 407 + * the rules documented in kmap_local_page()/kunmap_local(). 408 + * 409 + * ext2_find_entry() and ext2_dotdot() act as a call to ext2_get_page() and 410 + * should be treated as a call to ext2_get_page() for nesting purposes. 421 411 */ 422 - struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) 412 + struct ext2_dir_entry_2 *ext2_dotdot(struct inode *dir, struct page **p, 413 + void **pa) 423 414 { 424 - struct page *page = ext2_get_page(dir, 0, 0); 415 + void *page_addr; 416 + struct page *page = ext2_get_page(dir, 0, 0, &page_addr); 425 417 ext2_dirent *de = NULL; 426 418 427 419 if (!IS_ERR(page)) { 428 - de = ext2_next_entry((ext2_dirent *) page_address(page)); 420 + de = ext2_next_entry((ext2_dirent *) page_addr); 429 421 *p = page; 422 + *pa = page_addr; 430 423 } 431 424 return de; 432 425 } ··· 444 419 { 445 420 struct ext2_dir_entry_2 *de; 446 421 struct page *page; 422 + void *page_addr; 447 423 448 - de = ext2_find_entry(dir, child, &page); 424 + de = ext2_find_entry(dir, child, &page, &page_addr); 449 425 if (IS_ERR(de)) 450 426 return PTR_ERR(de); 451 427 452 428 *ino = le32_to_cpu(de->inode); 453 - ext2_put_page(page); 429 + ext2_put_page(page, page_addr); 454 430 return 0; 455 431 } 456 432 ··· 460 434 return __block_write_begin(page, pos, len, ext2_get_block); 461 435 } 462 436 463 - /* Releases the page */ 464 437 void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, 465 - struct page *page, struct inode *inode, int update_times) 438 + struct page *page, void *page_addr, struct inode *inode, 439 + int update_times) 466 440 { 467 441 loff_t pos = page_offset(page) + 468 - (char *) de - (char *) page_address(page); 442 + (char *) de - (char *) page_addr; 469 443 unsigned len = ext2_rec_len_from_disk(de->rec_len); 470 444 int err; 471 445 ··· 475 449 de->inode = cpu_to_le32(inode->i_ino); 476 450 ext2_set_de_type(de, inode); 477 451 err = ext2_commit_chunk(page, pos, len); 478 - ext2_put_page(page); 479 452 if (update_times) 480 453 dir->i_mtime = dir->i_ctime = current_time(dir); 481 454 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; ··· 493 468 unsigned reclen = EXT2_DIR_REC_LEN(namelen); 494 469 unsigned short rec_len, name_len; 495 470 struct page *page = NULL; 471 + void *page_addr = NULL; 496 472 ext2_dirent * de; 497 473 unsigned long npages = dir_pages(dir); 498 474 unsigned long n; 499 - char *kaddr; 500 475 loff_t pos; 501 476 int err; 502 477 ··· 506 481 * to protect that region. 507 482 */ 508 483 for (n = 0; n <= npages; n++) { 484 + char *kaddr; 509 485 char *dir_end; 510 486 511 - page = ext2_get_page(dir, n, 0); 487 + page = ext2_get_page(dir, n, 0, &page_addr); 512 488 err = PTR_ERR(page); 513 489 if (IS_ERR(page)) 514 490 goto out; 515 491 lock_page(page); 516 - kaddr = page_address(page); 492 + kaddr = page_addr; 517 493 dir_end = kaddr + ext2_last_byte(dir, n); 518 494 de = (ext2_dirent *)kaddr; 519 495 kaddr += PAGE_SIZE - reclen; ··· 545 519 de = (ext2_dirent *) ((char *) de + rec_len); 546 520 } 547 521 unlock_page(page); 548 - ext2_put_page(page); 522 + ext2_put_page(page, page_addr); 549 523 } 550 524 BUG(); 551 525 return -EINVAL; 552 526 553 527 got_it: 554 528 pos = page_offset(page) + 555 - (char*)de - (char*)page_address(page); 529 + (char *)de - (char *)page_addr; 556 530 err = ext2_prepare_chunk(page, pos, rec_len); 557 531 if (err) 558 532 goto out_unlock; ··· 572 546 mark_inode_dirty(dir); 573 547 /* OFFSET_CACHE */ 574 548 out_put: 575 - ext2_put_page(page); 549 + ext2_put_page(page, page_addr); 576 550 out: 577 551 return err; 578 552 out_unlock: ··· 582 556 583 557 /* 584 558 * ext2_delete_entry deletes a directory entry by merging it with the 585 - * previous entry. Page is up-to-date. Releases the page. 559 + * previous entry. Page is up-to-date. 586 560 */ 587 561 int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) 588 562 { ··· 620 594 EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL; 621 595 mark_inode_dirty(inode); 622 596 out: 623 - ext2_put_page(page); 624 597 return err; 625 598 } 626 599 ··· 669 644 */ 670 645 int ext2_empty_dir (struct inode * inode) 671 646 { 647 + void *page_addr = NULL; 672 648 struct page *page = NULL; 673 649 unsigned long i, npages = dir_pages(inode); 674 650 int dir_has_error = 0; ··· 677 651 for (i = 0; i < npages; i++) { 678 652 char *kaddr; 679 653 ext2_dirent * de; 680 - page = ext2_get_page(inode, i, dir_has_error); 654 + page = ext2_get_page(inode, i, dir_has_error, &page_addr); 681 655 682 656 if (IS_ERR(page)) { 683 657 dir_has_error = 1; 684 658 continue; 685 659 } 686 660 687 - kaddr = page_address(page); 661 + kaddr = page_addr; 688 662 de = (ext2_dirent *)kaddr; 689 663 kaddr += ext2_last_byte(inode, i) - EXT2_DIR_REC_LEN(1); 690 664 ··· 710 684 } 711 685 de = ext2_next_entry(de); 712 686 } 713 - ext2_put_page(page); 687 + ext2_put_page(page, page_addr); 714 688 } 715 689 return 1; 716 690 717 691 not_empty: 718 - ext2_put_page(page); 692 + ext2_put_page(page, page_addr); 719 693 return 0; 720 694 } 721 695
+7 -5
fs/ext2/ext2.h
··· 738 738 extern int ext2_inode_by_name(struct inode *dir, 739 739 const struct qstr *child, ino_t *ino); 740 740 extern int ext2_make_empty(struct inode *, struct inode *); 741 - extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **); 741 + extern struct ext2_dir_entry_2 *ext2_find_entry(struct inode *, const struct qstr *, 742 + struct page **, void **res_page_addr); 742 743 extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); 743 744 extern int ext2_empty_dir (struct inode *); 744 - extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); 745 - extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int); 746 - static inline void ext2_put_page(struct page *page) 745 + extern struct ext2_dir_entry_2 *ext2_dotdot(struct inode *dir, struct page **p, void **pa); 746 + extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, void *, 747 + struct inode *, int); 748 + static inline void ext2_put_page(struct page *page, void *page_addr) 747 749 { 748 - kunmap(page); 750 + kunmap_local(page_addr); 749 751 put_page(page); 750 752 } 751 753
+22 -12
fs/ext2/namei.c
··· 281 281 struct inode * inode = d_inode(dentry); 282 282 struct ext2_dir_entry_2 * de; 283 283 struct page * page; 284 + void *page_addr; 284 285 int err; 285 286 286 287 err = dquot_initialize(dir); 287 288 if (err) 288 289 goto out; 289 290 290 - de = ext2_find_entry(dir, &dentry->d_name, &page); 291 + de = ext2_find_entry(dir, &dentry->d_name, &page, &page_addr); 291 292 if (IS_ERR(de)) { 292 293 err = PTR_ERR(de); 293 294 goto out; 294 295 } 295 296 296 297 err = ext2_delete_entry (de, page); 298 + ext2_put_page(page, page_addr); 297 299 if (err) 298 300 goto out; 299 301 ··· 330 328 struct inode * old_inode = d_inode(old_dentry); 331 329 struct inode * new_inode = d_inode(new_dentry); 332 330 struct page * dir_page = NULL; 331 + void *dir_page_addr; 333 332 struct ext2_dir_entry_2 * dir_de = NULL; 334 333 struct page * old_page; 334 + void *old_page_addr; 335 335 struct ext2_dir_entry_2 * old_de; 336 336 int err; 337 337 ··· 348 344 if (err) 349 345 goto out; 350 346 351 - old_de = ext2_find_entry(old_dir, &old_dentry->d_name, &old_page); 347 + old_de = ext2_find_entry(old_dir, &old_dentry->d_name, &old_page, 348 + &old_page_addr); 352 349 if (IS_ERR(old_de)) { 353 350 err = PTR_ERR(old_de); 354 351 goto out; ··· 357 352 358 353 if (S_ISDIR(old_inode->i_mode)) { 359 354 err = -EIO; 360 - dir_de = ext2_dotdot(old_inode, &dir_page); 355 + dir_de = ext2_dotdot(old_inode, &dir_page, &dir_page_addr); 361 356 if (!dir_de) 362 357 goto out_old; 363 358 } 364 359 365 360 if (new_inode) { 361 + void *page_addr; 366 362 struct page *new_page; 367 363 struct ext2_dir_entry_2 *new_de; 368 364 ··· 371 365 if (dir_de && !ext2_empty_dir (new_inode)) 372 366 goto out_dir; 373 367 374 - new_de = ext2_find_entry(new_dir, &new_dentry->d_name, &new_page); 368 + new_de = ext2_find_entry(new_dir, &new_dentry->d_name, 369 + &new_page, &page_addr); 375 370 if (IS_ERR(new_de)) { 376 371 err = PTR_ERR(new_de); 377 372 goto out_dir; 378 373 } 379 - ext2_set_link(new_dir, new_de, new_page, old_inode, 1); 374 + ext2_set_link(new_dir, new_de, new_page, page_addr, old_inode, 1); 375 + ext2_put_page(new_page, page_addr); 380 376 new_inode->i_ctime = current_time(new_inode); 381 377 if (dir_de) 382 378 drop_nlink(new_inode); ··· 398 390 old_inode->i_ctime = current_time(old_inode); 399 391 mark_inode_dirty(old_inode); 400 392 401 - ext2_delete_entry (old_de, old_page); 393 + ext2_delete_entry(old_de, old_page); 402 394 403 395 if (dir_de) { 404 396 if (old_dir != new_dir) 405 - ext2_set_link(old_inode, dir_de, dir_page, new_dir, 0); 406 - else 407 - ext2_put_page(dir_page); 397 + ext2_set_link(old_inode, dir_de, dir_page, 398 + dir_page_addr, new_dir, 0); 399 + 400 + ext2_put_page(dir_page, dir_page_addr); 408 401 inode_dec_link_count(old_dir); 409 402 } 410 - return 0; 411 403 404 + ext2_put_page(old_page, old_page_addr); 405 + return 0; 412 406 413 407 out_dir: 414 408 if (dir_de) 415 - ext2_put_page(dir_page); 409 + ext2_put_page(dir_page, dir_page_addr); 416 410 out_old: 417 - ext2_put_page(old_page); 411 + ext2_put_page(old_page, old_page_addr); 418 412 out: 419 413 return err; 420 414 }
+1 -1
fs/ext2/super.c
··· 1104 1104 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); 1105 1105 spin_lock_init(&sbi->s_next_gen_lock); 1106 1106 1107 - /* per fileystem reservation list head & lock */ 1107 + /* per filesystem reservation list head & lock */ 1108 1108 spin_lock_init(&sbi->s_rsv_window_lock); 1109 1109 sbi->s_rsv_window_root = RB_ROOT; 1110 1110 /*
+47 -3
fs/quota/quota.c
··· 17 17 #include <linux/capability.h> 18 18 #include <linux/quotaops.h> 19 19 #include <linux/types.h> 20 + #include <linux/mount.h> 20 21 #include <linux/writeback.h> 21 22 #include <linux/nospec.h> 22 23 #include "compat.h" ··· 472 471 fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit; 473 472 fqs->qs_bwarnlimit = state.s_state[type].spc_warnlimit; 474 473 fqs->qs_iwarnlimit = state.s_state[type].ino_warnlimit; 474 + fqs->qs_rtbwarnlimit = state.s_state[type].rt_spc_warnlimit; 475 475 476 476 /* Inodes may be allocated even if inactive; copy out if present */ 477 477 if (state.s_state[USRQUOTA].ino) { ··· 829 827 } 830 828 } 831 829 832 - #ifdef CONFIG_BLOCK 833 - 834 830 /* Return 1 if 'cmd' will block on frozen filesystem */ 835 831 static int quotactl_cmd_write(int cmd) 836 832 { ··· 850 850 } 851 851 return 1; 852 852 } 853 - #endif /* CONFIG_BLOCK */ 854 853 855 854 /* Return true if quotactl command is manipulating quota on/off state */ 856 855 static bool quotactl_cmd_onoff(int cmd) ··· 965 966 out: 966 967 if (pathp && !IS_ERR(pathp)) 967 968 path_put(pathp); 969 + return ret; 970 + } 971 + 972 + SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *, 973 + mountpoint, qid_t, id, void __user *, addr) 974 + { 975 + struct super_block *sb; 976 + struct path mountpath; 977 + unsigned int cmds = cmd >> SUBCMDSHIFT; 978 + unsigned int type = cmd & SUBCMDMASK; 979 + int ret; 980 + 981 + if (type >= MAXQUOTAS) 982 + return -EINVAL; 983 + 984 + ret = user_path_at(AT_FDCWD, mountpoint, 985 + LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, &mountpath); 986 + if (ret) 987 + return ret; 988 + 989 + sb = mountpath.mnt->mnt_sb; 990 + 991 + if (quotactl_cmd_write(cmds)) { 992 + ret = mnt_want_write(mountpath.mnt); 993 + if (ret) 994 + goto out; 995 + } 996 + 997 + if (quotactl_cmd_onoff(cmds)) 998 + down_write(&sb->s_umount); 999 + else 1000 + down_read(&sb->s_umount); 1001 + 1002 + ret = do_quotactl(sb, type, cmds, id, addr, ERR_PTR(-EINVAL)); 1003 + 1004 + if (quotactl_cmd_onoff(cmds)) 1005 + up_write(&sb->s_umount); 1006 + else 1007 + up_read(&sb->s_umount); 1008 + 1009 + if (quotactl_cmd_write(cmds)) 1010 + mnt_drop_write(mountpath.mnt); 1011 + out: 1012 + path_put(&mountpath); 1013 + 968 1014 return ret; 969 1015 }
+2 -4
fs/reiserfs/journal.c
··· 461 461 b_blocknr_t * next_zero_bit) 462 462 { 463 463 struct reiserfs_journal *journal = SB_JOURNAL(sb); 464 - struct reiserfs_journal_cnode *cn; 465 464 struct reiserfs_list_bitmap *jb; 466 465 int i; 467 466 unsigned long bl; ··· 496 497 bl = bmap_nr * (sb->s_blocksize << 3) + bit_nr; 497 498 /* is it in any old transactions? */ 498 499 if (search_all 499 - && (cn = 500 - get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) { 500 + && (get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) { 501 501 return 1; 502 502 } 503 503 504 504 /* is it in the current transaction. This should never happen */ 505 - if ((cn = get_journal_hash_dev(sb, journal->j_hash_table, bl))) { 505 + if ((get_journal_hash_dev(sb, journal->j_hash_table, bl))) { 506 506 BUG(); 507 507 return 1; 508 508 }
+2
include/linux/syscalls.h
··· 483 483 /* fs/quota.c */ 484 484 asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, 485 485 qid_t id, void __user *addr); 486 + asmlinkage long sys_quotactl_path(unsigned int cmd, const char __user *mountpoint, 487 + qid_t id, void __user *addr); 486 488 487 489 /* fs/readdir.c */ 488 490 asmlinkage long sys_getdents64(unsigned int fd,
+3 -1
include/uapi/asm-generic/unistd.h
··· 863 863 __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2) 864 864 #define __NR_mount_setattr 442 865 865 __SYSCALL(__NR_mount_setattr, sys_mount_setattr) 866 + #define __NR_quotactl_path 443 867 + __SYSCALL(__NR_quotactl_path, sys_quotactl_path) 866 868 867 869 #undef __NR_syscalls 868 - #define __NR_syscalls 443 870 + #define __NR_syscalls 444 869 871 870 872 /* 871 873 * 32 bit systems traditionally used different
+4 -1
include/uapi/linux/dqblk_xfs.h
··· 219 219 __s32 qs_rtbtimelimit;/* limit for rt blks timer */ 220 220 __u16 qs_bwarnlimit; /* limit for num warnings */ 221 221 __u16 qs_iwarnlimit; /* limit for num warnings */ 222 - __u64 qs_pad2[8]; /* for future proofing */ 222 + __u16 qs_rtbwarnlimit;/* limit for rt blks warnings */ 223 + __u16 qs_pad3; 224 + __u32 qs_pad4; 225 + __u64 qs_pad2[7]; /* for future proofing */ 223 226 }; 224 227 225 228 #endif /* _LINUX_DQBLK_XFS_H */
+1
kernel/sys_ni.c
··· 99 99 100 100 /* fs/quota.c */ 101 101 COND_SYSCALL(quotactl); 102 + COND_SYSCALL(quotactl_path); 102 103 103 104 /* fs/readdir.c */ 104 105