History

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

Linus Torvalds committed 5 years ago

Commit 767fcbc2 parents d2b6f8a a3cc75428 files · +168 −62Browse files

Unified · Split

28 files
  1. arch/alpha/kernel/syscalls/syscall.tbl +1 −0
  2. arch/arm/tools/syscall.tbl +1 −0
  3. arch/arm64/include/asm/unistd.h +1 −1
  4. arch/arm64/include/asm/unistd32.h +2 −0
  5. arch/ia64/kernel/syscalls/syscall.tbl +1 −0
  6. arch/m68k/kernel/syscalls/syscall.tbl +1 −0
  7. arch/microblaze/kernel/syscalls/syscall.tbl +1 −0
  8. arch/mips/kernel/syscalls/syscall_n32.tbl +1 −0
  9. arch/mips/kernel/syscalls/syscall_n64.tbl +1 −0
  10. arch/mips/kernel/syscalls/syscall_o32.tbl +1 −0
  11. arch/parisc/kernel/syscalls/syscall.tbl +1 −0
  12. arch/powerpc/kernel/syscalls/syscall.tbl +1 −0
  13. arch/s390/kernel/syscalls/syscall.tbl +1 −0
  14. arch/sh/kernel/syscalls/syscall.tbl +1 −0
  15. arch/sparc/kernel/syscalls/syscall.tbl +1 −0
  16. arch/x86/entry/syscalls/syscall_32.tbl +1 −0
  17. arch/x86/entry/syscalls/syscall_64.tbl +1 −0
  18. arch/xtensa/kernel/syscalls/syscall.tbl +1 −0
  19. fs/ext2/dir.c +60 −34
  20. fs/ext2/ext2.h +7 −5
  21. fs/ext2/namei.c +22 −12
  22. fs/ext2/super.c +1 −1
  23. fs/quota/quota.c +47 −3
  24. fs/reiserfs/journal.c +2 −4
  25. include/linux/syscalls.h +2 −0
  26. include/uapi/asm-generic/unistd.h +3 −1
  27. include/uapi/linux/dqblk_xfs.h +4 −1
  28. kernel/sys_ni.c +1 −0
arch/alpha/kernel/syscalls/syscall.tbl+1−0
@@ -482,3 +482,4 @@ · 481 unmodified lines
482482 550 common process_madvise sys_process_madvise
483483 551 common epoll_pwait2 sys_epoll_pwait2
484484 552 common mount_setattr sys_mount_setattr
485+553 common quotactl_path sys_quotactl_path
arch/arm/tools/syscall.tbl+1−0
@@ -456,3 +456,4 @@ · 455 unmodified lines
456456 440 common process_madvise sys_process_madvise
457457 441 common epoll_pwait2 sys_epoll_pwait2
458458 442 common mount_setattr sys_mount_setattr
459+443 common quotactl_path sys_quotactl_path
arch/arm64/include/asm/unistd.h+1−1
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
3939 #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
4040
41−#define __NR_compat_syscalls 443
41+#define __NR_compat_syscalls 444
4242 #endif
4343
4444 #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h+2−0
@@ -893,6 +893,8 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise) · 892 unmodified lines
893893 __SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
894894 #define __NR_mount_setattr 442
895895 __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
896+#define __NR_quotactl_path 443
897+__SYSCALL(__NR_quotactl_path, sys_quotactl_path)
896898
897899 /*
898900 * Please add new compat syscalls above this comment and update
arch/ia64/kernel/syscalls/syscall.tbl+1−0
@@ -363,3 +363,4 @@ · 362 unmodified lines
363363 440 common process_madvise sys_process_madvise
364364 441 common epoll_pwait2 sys_epoll_pwait2
365365 442 common mount_setattr sys_mount_setattr
366+443 common quotactl_path sys_quotactl_path
arch/m68k/kernel/syscalls/syscall.tbl+1−0
@@ -442,3 +442,4 @@ · 441 unmodified lines
442442 440 common process_madvise sys_process_madvise
443443 441 common epoll_pwait2 sys_epoll_pwait2
444444 442 common mount_setattr sys_mount_setattr
445+443 common quotactl_path sys_quotactl_path
arch/microblaze/kernel/syscalls/syscall.tbl+1−0
@@ -448,3 +448,4 @@ · 447 unmodified lines
448448 440 common process_madvise sys_process_madvise
449449 441 common epoll_pwait2 sys_epoll_pwait2
450450 442 common mount_setattr sys_mount_setattr
451+443 common quotactl_path sys_quotactl_path
arch/mips/kernel/syscalls/syscall_n32.tbl+1−0
@@ -381,3 +381,4 @@ · 380 unmodified lines
381381 440 n32 process_madvise sys_process_madvise
382382 441 n32 epoll_pwait2 compat_sys_epoll_pwait2
383383 442 n32 mount_setattr sys_mount_setattr
384+443 n32 quotactl_path sys_quotactl_path
arch/mips/kernel/syscalls/syscall_n64.tbl+1−0
@@ -357,3 +357,4 @@ · 356 unmodified lines
357357 440 n64 process_madvise sys_process_madvise
358358 441 n64 epoll_pwait2 sys_epoll_pwait2
359359 442 n64 mount_setattr sys_mount_setattr
360+443 n64 quotactl_path sys_quotactl_path
arch/mips/kernel/syscalls/syscall_o32.tbl+1−0
@@ -430,3 +430,4 @@ · 429 unmodified lines
430430 440 o32 process_madvise sys_process_madvise
431431 441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
432432 442 o32 mount_setattr sys_mount_setattr
433+443 o32 quotactl_path sys_quotactl_path
arch/parisc/kernel/syscalls/syscall.tbl+1−0
@@ -440,3 +440,4 @@ · 439 unmodified lines
440440 440 common process_madvise sys_process_madvise
441441 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442442 442 common mount_setattr sys_mount_setattr
443+443 common quotactl_path sys_quotactl_path
arch/powerpc/kernel/syscalls/syscall.tbl+1−0
@@ -522,3 +522,4 @@ · 521 unmodified lines
522522 440 common process_madvise sys_process_madvise
523523 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
524524 442 common mount_setattr sys_mount_setattr
525+443 common quotactl_path sys_quotactl_path
arch/s390/kernel/syscalls/syscall.tbl+1−0
@@ -445,3 +445,4 @@ · 444 unmodified lines
445445 440 common process_madvise sys_process_madvise sys_process_madvise
446446 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
447447 442 common mount_setattr sys_mount_setattr sys_mount_setattr
448+443 common quotactl_path sys_quotactl_path sys_quotactl_path
arch/sh/kernel/syscalls/syscall.tbl+1−0
@@ -445,3 +445,4 @@ · 444 unmodified lines
445445 440 common process_madvise sys_process_madvise
446446 441 common epoll_pwait2 sys_epoll_pwait2
447447 442 common mount_setattr sys_mount_setattr
448+443 common quotactl_path sys_quotactl_path
arch/sparc/kernel/syscalls/syscall.tbl+1−0
@@ -488,3 +488,4 @@ · 487 unmodified lines
488488 440 common process_madvise sys_process_madvise
489489 441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
490490 442 common mount_setattr sys_mount_setattr
491+443 common quotactl_path sys_quotactl_path
arch/x86/entry/syscalls/syscall_32.tbl+1−0
@@ -447,3 +447,4 @@ · 446 unmodified lines
447447 440 i386 process_madvise sys_process_madvise
448448 441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
449449 442 i386 mount_setattr sys_mount_setattr
450+443 i386 quotactl_path sys_quotactl_path
arch/x86/entry/syscalls/syscall_64.tbl+1−0
@@ -364,6 +364,7 @@ · 363 unmodified lines
364364 440 common process_madvise sys_process_madvise
365365 441 common epoll_pwait2 sys_epoll_pwait2
366366 442 common mount_setattr sys_mount_setattr
367+443 common quotactl_path sys_quotactl_path
367368
368369 #
369370 # Due to a historical design error, certain syscalls are numbered differently
arch/xtensa/kernel/syscalls/syscall.tbl+1−0
@@ -413,3 +413,4 @@ · 412 unmodified lines
413413 440 common process_madvise sys_process_madvise
414414 441 common epoll_pwait2 sys_epoll_pwait2
415415 442 common mount_setattr sys_mount_setattr
416+443 common quotactl_path sys_quotactl_path
fs/ext2/dir.c+60−34
@@ -190,13 +190,20 @@ fail: · 189 unmodified lines
190190 return false;
191191 }
192192
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+ */
193200 static struct page * ext2_get_page(struct inode *dir, unsigned long n,
194− int quiet)
201+ int quiet, void **page_addr)
195202 {
196203 struct address_space *mapping = dir->i_mapping;
197204 struct page *page = read_mapping_page(mapping, n, NULL);
198205 if (!IS_ERR(page)) {
199− kmap(page);
206+ *page_addr = kmap_local_page(page);
200207 if (unlikely(!PageChecked(page))) {
201208 if (PageError(page) || !ext2_check_page(page, quiet))
202209 goto fail;
@@ -205,7 +212,7 @@ static struct page * ext2_get_page(struct inode *dir, unsigned long n, · 2 unmodified lines
205212 return page;
206213
207214 fail:
208− ext2_put_page(page);
215+ ext2_put_page(page, *page_addr);
209216 return ERR_PTR(-EIO);
210217 }
211218
@@ -276,7 +283,7 @@ ext2_readdir(struct file *file, struct dir_context *ctx) · 64 unmodified lines
276283 for ( ; n < npages; n++, offset = 0) {
277284 char *kaddr, *limit;
278285 ext2_dirent *de;
279− struct page *page = ext2_get_page(inode, n, 0);
286+ struct page *page = ext2_get_page(inode, n, 0, (void **)&kaddr);
280287
281288 if (IS_ERR(page)) {
282289 ext2_error(sb, __func__,
@@ -285,7 +292,6 @@ ext2_readdir(struct file *file, struct dir_context *ctx) · 2 unmodified lines
285292 ctx->pos += PAGE_SIZE - offset;
286293 return PTR_ERR(page);
287294 }
288− kaddr = page_address(page);
289295 if (unlikely(need_revalidate)) {
290296 if (offset) {
291297 offset = ext2_validate_entry(kaddr, offset, chunk_mask);
@@ -300,7 +306,7 @@ ext2_readdir(struct file *file, struct dir_context *ctx) · 8 unmodified lines
300306 if (de->rec_len == 0) {
301307 ext2_error(sb, __func__,
302308 "zero-length directory entry");
303− ext2_put_page(page);
309+ ext2_put_page(page, kaddr);
304310 return -EIO;
305311 }
306312 if (de->inode) {
@@ -312,13 +318,13 @@ ext2_readdir(struct file *file, struct dir_context *ctx) · 5 unmodified lines
312318 if (!dir_emit(ctx, de->name, de->name_len,
313319 le32_to_cpu(de->inode),
314320 d_type)) {
315− ext2_put_page(page);
321+ ext2_put_page(page, kaddr);
316322 return 0;
317323 }
318324 }
319325 ctx->pos += ext2_rec_len_from_disk(de->rec_len);
320326 }
321− ext2_put_page(page);
327+ ext2_put_page(page, kaddr);
322328 }
323329 return 0;
324330 }
@@ -332,9 +338,16 @@ ext2_readdir(struct file *file, struct dir_context *ctx) · 7 unmodified lines
332338 * Entry is guaranteed to be valid.
333339 *
334340 * On Success ext2_put_page() should be called on *res_page.
341+ *
342+ * NOTE: Calls to ext2_get_page()/ext2_put_page() must be nested according to
343+ * the rules documented in kmap_local_page()/kunmap_local().
344+ *
345+ * ext2_find_entry() and ext2_dotdot() act as a call to ext2_get_page() and
346+ * should be treated as a call to ext2_get_page() for nesting purposes.
335347 */
336348 struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir,
337− const struct qstr *child, struct page **res_page)
349+ const struct qstr *child, struct page **res_page,
350+ void **res_page_addr)
338351 {
339352 const char *name = child->name;
340353 int namelen = child->len;
@@ -344,12 +357,14 @@ struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, · 3 unmodified lines
344357 struct page *page = NULL;
345358 struct ext2_inode_info *ei = EXT2_I(dir);
346359 ext2_dirent * de;
360+ void *page_addr;
347361
348362 if (npages == 0)
349363 goto out;
350364
351365 /* OFFSET_CACHE */
352366 *res_page = NULL;
367+ *res_page_addr = NULL;
353368
354369 start = ei->i_dir_start_lookup;
355370 if (start >= npages)
@@ -357,25 +372,25 @@ struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, · 1 unmodified line
357372 n = start;
358373 do {
359374 char *kaddr;
360− page = ext2_get_page(dir, n, 0);
375+ page = ext2_get_page(dir, n, 0, &page_addr);
361376 if (IS_ERR(page))
362377 return ERR_CAST(page);
363378
364− kaddr = page_address(page);
379+ kaddr = page_addr;
365380 de = (ext2_dirent *) kaddr;
366381 kaddr += ext2_last_byte(dir, n) - reclen;
367382 while ((char *) de <= kaddr) {
368383 if (de->rec_len == 0) {
369384 ext2_error(dir->i_sb, __func__,
370385 "zero-length directory entry");
371− ext2_put_page(page);
386+ ext2_put_page(page, page_addr);
372387 goto out;
373388 }
374389 if (ext2_match(namelen, name, de))
375390 goto found;
376391 de = ext2_next_entry(de);
377392 }
378− ext2_put_page(page);
393+ ext2_put_page(page, page_addr);
379394
380395 if (++n >= npages)
381396 n = 0;
@@ -393,6 +408,7 @@ out: · 11 unmodified lines
393408
394409 found:
395410 *res_page = page;
411+ *res_page_addr = page_addr;
396412 ei->i_dir_start_lookup = n;
397413 return de;
398414 }
@@ -402,15 +418,24 @@ found: · 3 unmodified lines
402418 * (as a parameter - p).
403419 *
404420 * On Success ext2_put_page() should be called on *p.
421+ *
422+ * NOTE: Calls to ext2_get_page()/ext2_put_page() must be nested according to
423+ * the rules documented in kmap_local_page()/kunmap_local().
424+ *
425+ * ext2_find_entry() and ext2_dotdot() act as a call to ext2_get_page() and
426+ * should be treated as a call to ext2_get_page() for nesting purposes.
405427 */
406−struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)
428+struct ext2_dir_entry_2 *ext2_dotdot(struct inode *dir, struct page **p,
429+ void **pa)
407430 {
408− struct page *page = ext2_get_page(dir, 0, 0);
431+ void *page_addr;
432+ struct page *page = ext2_get_page(dir, 0, 0, &page_addr);
409433 ext2_dirent *de = NULL;
410434
411435 if (!IS_ERR(page)) {
412− de = ext2_next_entry((ext2_dirent *) page_address(page));
436+ de = ext2_next_entry((ext2_dirent *) page_addr);
413437 *p = page;
438+ *pa = page_addr;
414439 }
415440 return de;
416441 }
@@ -419,13 +444,14 @@ int ext2_inode_by_name(struct inode *dir, const struct qstr *child, ino_t *ino) · 2 unmodified lines
419444 {
420445 struct ext2_dir_entry_2 *de;
421446 struct page *page;
447+ void *page_addr;
422448
423− de = ext2_find_entry(dir, child, &page);
449+ de = ext2_find_entry(dir, child, &page, &page_addr);
424450 if (IS_ERR(de))
425451 return PTR_ERR(de);
426452
427453 *ino = le32_to_cpu(de->inode);
428− ext2_put_page(page);
454+ ext2_put_page(page, page_addr);
429455 return 0;
430456 }
431457
@@ -434,12 +460,12 @@ static int ext2_prepare_chunk(struct page *page, loff_t pos, unsigned len) · 2 unmodified lines
434460 return __block_write_begin(page, pos, len, ext2_get_block);
435461 }
436462
437−/* Releases the page */
438463 void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
439− struct page *page, struct inode *inode, int update_times)
464+ struct page *page, void *page_addr, struct inode *inode,
465+ int update_times)
440466 {
441467 loff_t pos = page_offset(page) +
442− (char *) de - (char *) page_address(page);
468+ (char *) de - (char *) page_addr;
443469 unsigned len = ext2_rec_len_from_disk(de->rec_len);
444470 int err;
445471
@@ -449,7 +475,6 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, · 3 unmodified lines
449475 de->inode = cpu_to_le32(inode->i_ino);
450476 ext2_set_de_type(de, inode);
451477 err = ext2_commit_chunk(page, pos, len);
452− ext2_put_page(page);
453478 if (update_times)
454479 dir->i_mtime = dir->i_ctime = current_time(dir);
455480 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;
@@ -468,10 +493,10 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode) · 12 unmodified lines
468493 unsigned reclen = EXT2_DIR_REC_LEN(namelen);
469494 unsigned short rec_len, name_len;
470495 struct page *page = NULL;
496+ void *page_addr = NULL;
471497 ext2_dirent * de;
472498 unsigned long npages = dir_pages(dir);
473499 unsigned long n;
474− char *kaddr;
475500 loff_t pos;
476501 int err;
477502
@@ -481,14 +506,15 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode) · 3 unmodified lines
481506 * to protect that region.
482507 */
483508 for (n = 0; n <= npages; n++) {
509+ char *kaddr;
484510 char *dir_end;
485511
486− page = ext2_get_page(dir, n, 0);
512+ page = ext2_get_page(dir, n, 0, &page_addr);
487513 err = PTR_ERR(page);
488514 if (IS_ERR(page))
489515 goto out;
490516 lock_page(page);
491− kaddr = page_address(page);
517+ kaddr = page_addr;
492518 dir_end = kaddr + ext2_last_byte(dir, n);
493519 de = (ext2_dirent *)kaddr;
494520 kaddr += PAGE_SIZE - reclen;
@@ -519,14 +545,14 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode) · 24 unmodified lines
519545 de = (ext2_dirent *) ((char *) de + rec_len);
520546 }
521547 unlock_page(page);
522− ext2_put_page(page);
548+ ext2_put_page(page, page_addr);
523549 }
524550 BUG();
525551 return -EINVAL;
526552
527553 got_it:
528554 pos = page_offset(page) +
529− (char*)de - (char*)page_address(page);
555+ (char *)de - (char *)page_addr;
530556 err = ext2_prepare_chunk(page, pos, rec_len);
531557 if (err)
532558 goto out_unlock;
@@ -546,7 +572,7 @@ got_it: · 13 unmodified lines
546572 mark_inode_dirty(dir);
547573 /* OFFSET_CACHE */
548574 out_put:
549− ext2_put_page(page);
575+ ext2_put_page(page, page_addr);
550576 out:
551577 return err;
552578 out_unlock:
@@ -556,7 +582,7 @@ out_unlock: · 3 unmodified lines
556582
557583 /*
558584 * ext2_delete_entry deletes a directory entry by merging it with the
559− * previous entry. Page is up-to-date. Releases the page.
585+ * previous entry. Page is up-to-date.
560586 */
561587 int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )
562588 {
@@ -594,7 +620,6 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) · 31 unmodified lines
594620 EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL;
595621 mark_inode_dirty(inode);
596622 out:
597− ext2_put_page(page);
598623 return err;
599624 }
600625
@@ -644,6 +669,7 @@ fail: · 43 unmodified lines
644669 */
645670 int ext2_empty_dir (struct inode * inode)
646671 {
672+ void *page_addr = NULL;
647673 struct page *page = NULL;
648674 unsigned long i, npages = dir_pages(inode);
649675 int dir_has_error = 0;
@@ -651,14 +677,14 @@ int ext2_empty_dir (struct inode * inode) · 1 unmodified line
651677 for (i = 0; i < npages; i++) {
652678 char *kaddr;
653679 ext2_dirent * de;
654− page = ext2_get_page(inode, i, dir_has_error);
680+ page = ext2_get_page(inode, i, dir_has_error, &page_addr);
655681
656682 if (IS_ERR(page)) {
657683 dir_has_error = 1;
658684 continue;
659685 }
660686
661− kaddr = page_address(page);
687+ kaddr = page_addr;
662688 de = (ext2_dirent *)kaddr;
663689 kaddr += ext2_last_byte(inode, i) - EXT2_DIR_REC_LEN(1);
664690
@@ -684,12 +710,12 @@ int ext2_empty_dir (struct inode * inode) · 19 unmodified lines
684710 }
685711 de = ext2_next_entry(de);
686712 }
687− ext2_put_page(page);
713+ ext2_put_page(page, page_addr);
688714 }
689715 return 1;
690716
691717 not_empty:
692− ext2_put_page(page);
718+ ext2_put_page(page, page_addr);
693719 return 0;
694720 }
695721
fs/ext2/ext2.h+7−5
@@ -738,14 +738,16 @@ extern int ext2_add_link (struct dentry *, struct inode *); · 737 unmodified lines
738738 extern int ext2_inode_by_name(struct inode *dir,
739739 const struct qstr *child, ino_t *ino);
740740 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);
742743 extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
743744 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)
747749 {
748− kunmap(page);
750+ kunmap_local(page_addr);
749751 put_page(page);
750752 }
751753
fs/ext2/namei.c+22−12
@@ -281,19 +281,21 @@ static int ext2_unlink(struct inode * dir, struct dentry *dentry) · 280 unmodified lines
281281 struct inode * inode = d_inode(dentry);
282282 struct ext2_dir_entry_2 * de;
283283 struct page * page;
284+ void *page_addr;
284285 int err;
285286
286287 err = dquot_initialize(dir);
287288 if (err)
288289 goto out;
289290
290− de = ext2_find_entry(dir, &dentry->d_name, &page);
291+ de = ext2_find_entry(dir, &dentry->d_name, &page, &page_addr);
291292 if (IS_ERR(de)) {
292293 err = PTR_ERR(de);
293294 goto out;
294295 }
295296
296297 err = ext2_delete_entry (de, page);
298+ ext2_put_page(page, page_addr);
297299 if (err)
298300 goto out;
299301
@@ -328,8 +330,10 @@ static int ext2_rename (struct user_namespace * mnt_userns, · 28 unmodified lines
328330 struct inode * old_inode = d_inode(old_dentry);
329331 struct inode * new_inode = d_inode(new_dentry);
330332 struct page * dir_page = NULL;
333+ void *dir_page_addr;
331334 struct ext2_dir_entry_2 * dir_de = NULL;
332335 struct page * old_page;
336+ void *old_page_addr;
333337 struct ext2_dir_entry_2 * old_de;
334338 int err;
335339
@@ -344,7 +348,8 @@ static int ext2_rename (struct user_namespace * mnt_userns, · 8 unmodified lines
344348 if (err)
345349 goto out;
346350
347− old_de = ext2_find_entry(old_dir, &old_dentry->d_name, &old_page);
351+ old_de = ext2_find_entry(old_dir, &old_dentry->d_name, &old_page,
352+ &old_page_addr);
348353 if (IS_ERR(old_de)) {
349354 err = PTR_ERR(old_de);
350355 goto out;
@@ -352,12 +357,13 @@ static int ext2_rename (struct user_namespace * mnt_userns, · 1 unmodified line
352357
353358 if (S_ISDIR(old_inode->i_mode)) {
354359 err = -EIO;
355− dir_de = ext2_dotdot(old_inode, &dir_page);
360+ dir_de = ext2_dotdot(old_inode, &dir_page, &dir_page_addr);
356361 if (!dir_de)
357362 goto out_old;
358363 }
359364
360365 if (new_inode) {
366+ void *page_addr;
361367 struct page *new_page;
362368 struct ext2_dir_entry_2 *new_de;
363369
@@ -365,12 +371,14 @@ static int ext2_rename (struct user_namespace * mnt_userns, · 1 unmodified line
365371 if (dir_de && !ext2_empty_dir (new_inode))
366372 goto out_dir;
367373
368− new_de = ext2_find_entry(new_dir, &new_dentry->d_name, &new_page);
374+ new_de = ext2_find_entry(new_dir, &new_dentry->d_name,
375+ &new_page, &page_addr);
369376 if (IS_ERR(new_de)) {
370377 err = PTR_ERR(new_de);
371378 goto out_dir;
372379 }
373− ext2_set_link(new_dir, new_de, new_page, old_inode, 1);
380+ ext2_set_link(new_dir, new_de, new_page, page_addr, old_inode, 1);
381+ ext2_put_page(new_page, page_addr);
374382 new_inode->i_ctime = current_time(new_inode);
375383 if (dir_de)
376384 drop_nlink(new_inode);
@@ -390,23 +398,25 @@ static int ext2_rename (struct user_namespace * mnt_userns, · 13 unmodified lines
390398 old_inode->i_ctime = current_time(old_inode);
391399 mark_inode_dirty(old_inode);
392400
393− ext2_delete_entry (old_de, old_page);
401+ ext2_delete_entry(old_de, old_page);
394402
395403 if (dir_de) {
396404 if (old_dir != new_dir)
397− ext2_set_link(old_inode, dir_de, dir_page, new_dir, 0);
398− else
399− ext2_put_page(dir_page);
405+ ext2_set_link(old_inode, dir_de, dir_page,
406+ dir_page_addr, new_dir, 0);
407+
408+ ext2_put_page(dir_page, dir_page_addr);
400409 inode_dec_link_count(old_dir);
401410 }
402− return 0;
403411
412+ ext2_put_page(old_page, old_page_addr);
413+ return 0;
404414
405415 out_dir:
406416 if (dir_de)
407− ext2_put_page(dir_page);
417+ ext2_put_page(dir_page, dir_page_addr);
408418 out_old:
409− ext2_put_page(old_page);
419+ ext2_put_page(old_page, old_page_addr);
410420 out:
411421 return err;
412422 }
fs/ext2/super.c+1−1
@@ -1104,7 +1104,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) · 1103 unmodified lines
11041104 get_random_bytes(&sbi->s_next_generation, sizeof(u32));
11051105 spin_lock_init(&sbi->s_next_gen_lock);
11061106
1107− /* per fileystem reservation list head & lock */
1107+ /* per filesystem reservation list head & lock */
11081108 spin_lock_init(&sbi->s_rsv_window_lock);
11091109 sbi->s_rsv_window_root = RB_ROOT;
11101110 /*
fs/quota/quota.c+47−3
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/capability.h>
1818 #include <linux/quotaops.h>
1919 #include <linux/types.h>
20+#include <linux/mount.h>
2021 #include <linux/writeback.h>
2122 #include <linux/nospec.h>
2223 #include "compat.h"
@@ -471,6 +472,7 @@ static int quota_getstatev(struct super_block *sb, int type, · 448 unmodified lines
471472 fqs->qs_rtbtimelimit = state.s_state[type].rt_spc_timelimit;
472473 fqs->qs_bwarnlimit = state.s_state[type].spc_warnlimit;
473474 fqs->qs_iwarnlimit = state.s_state[type].ino_warnlimit;
475+ fqs->qs_rtbwarnlimit = state.s_state[type].rt_spc_warnlimit;
474476
475477 /* Inodes may be allocated even if inactive; copy out if present */
476478 if (state.s_state[USRQUOTA].ino) {
@@ -827,8 +829,6 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, · 350 unmodified lines
827829 }
828830 }
829831
830−#ifdef CONFIG_BLOCK
831−
832832 /* Return 1 if 'cmd' will block on frozen filesystem */
833833 static int quotactl_cmd_write(int cmd)
834834 {
@@ -850,7 +850,6 @@ static int quotactl_cmd_write(int cmd) · 15 unmodified lines
850850 }
851851 return 1;
852852 }
853−#endif /* CONFIG_BLOCK */
854853
855854 /* Return true if quotactl command is manipulating quota on/off state */
856855 static bool quotactl_cmd_onoff(int cmd)
@@ -968,3 +967,48 @@ out: · 111 unmodified lines
968967 path_put(pathp);
969968 return ret;
970969 }
970+
971+SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
972+ mountpoint, qid_t, id, void __user *, addr)
973+{
974+ struct super_block *sb;
975+ struct path mountpath;
976+ unsigned int cmds = cmd >> SUBCMDSHIFT;
977+ unsigned int type = cmd & SUBCMDMASK;
978+ int ret;
979+
980+ if (type >= MAXQUOTAS)
981+ return -EINVAL;
982+
983+ ret = user_path_at(AT_FDCWD, mountpoint,
984+ LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, &mountpath);
985+ if (ret)
986+ return ret;
987+
988+ sb = mountpath.mnt->mnt_sb;
989+
990+ if (quotactl_cmd_write(cmds)) {
991+ ret = mnt_want_write(mountpath.mnt);
992+ if (ret)
993+ goto out;
994+ }
995+
996+ if (quotactl_cmd_onoff(cmds))
997+ down_write(&sb->s_umount);
998+ else
999+ down_read(&sb->s_umount);
1000+
1001+ ret = do_quotactl(sb, type, cmds, id, addr, ERR_PTR(-EINVAL));
1002+
1003+ if (quotactl_cmd_onoff(cmds))
1004+ up_write(&sb->s_umount);
1005+ else
1006+ up_read(&sb->s_umount);
1007+
1008+ if (quotactl_cmd_write(cmds))
1009+ mnt_drop_write(mountpath.mnt);
1010+out:
1011+ path_put(&mountpath);
1012+
1013+ return ret;
1014+}
fs/reiserfs/journal.c+2−4
@@ -461,7 +461,6 @@ int reiserfs_in_journal(struct super_block *sb, · 460 unmodified lines
461461 b_blocknr_t * next_zero_bit)
462462 {
463463 struct reiserfs_journal *journal = SB_JOURNAL(sb);
464− struct reiserfs_journal_cnode *cn;
465464 struct reiserfs_list_bitmap *jb;
466465 int i;
467466 unsigned long bl;
@@ -497,13 +496,12 @@ int reiserfs_in_journal(struct super_block *sb, · 29 unmodified lines
497496 bl = bmap_nr * (sb->s_blocksize << 3) + bit_nr;
498497 /* is it in any old transactions? */
499498 if (search_all
500− && (cn =
501− get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) {
499+ && (get_journal_hash_dev(sb, journal->j_list_hash_table, bl))) {
502500 return 1;
503501 }
504502
505503 /* is it in the current transaction. This should never happen */
506− if ((cn = get_journal_hash_dev(sb, journal->j_hash_table, bl))) {
504+ if ((get_journal_hash_dev(sb, journal->j_hash_table, bl))) {
507505 BUG();
508506 return 1;
509507 }
include/linux/syscalls.h+2−0
@@ -483,6 +483,8 @@ asmlinkage long sys_pipe2(int __user *fildes, int flags); · 482 unmodified lines
483483 /* fs/quota.c */
484484 asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
485485 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);
486488
487489 /* fs/readdir.c */
488490 asmlinkage long sys_getdents64(unsigned int fd,
include/uapi/asm-generic/unistd.h+3−1
@@ -863,9 +863,11 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise) · 862 unmodified lines
863863 __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
864864 #define __NR_mount_setattr 442
865865 __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
866+#define __NR_quotactl_path 443
867+__SYSCALL(__NR_quotactl_path, sys_quotactl_path)
866868
867869 #undef __NR_syscalls
868−#define __NR_syscalls 443
870+#define __NR_syscalls 444
869871
870872 /*
871873 * 32 bit systems traditionally used different
include/uapi/linux/dqblk_xfs.h+4−1
@@ -219,7 +219,10 @@ struct fs_quota_statv { · 218 unmodified lines
219219 __s32 qs_rtbtimelimit;/* limit for rt blks timer */
220220 __u16 qs_bwarnlimit; /* limit for num warnings */
221221 __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 */
223226 };
224227
225228 #endif /* _LINUX_DQBLK_XFS_H */
kernel/sys_ni.c+1−0
@@ -99,6 +99,7 @@ COND_SYSCALL(flock); · 98 unmodified lines
9999
100100 /* fs/quota.c */
101101 COND_SYSCALL(quotactl);
102+COND_SYSCALL(quotactl_path);
102103
103104 /* fs/readdir.c */
104105

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t