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

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

Pull ext2, udf, reiserfs, quota cleanups and minor fixes from Jan Kara:
"A few ext2 fixups and then several (mostly comment and documentation)
cleanups in ext2, udf, reiserfs, and quota"

* tag 'for_v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
reiserfs: delete duplicated words
udf: osta_udf.h: delete a duplicated word
reiserfs: reiserfs.h: delete a duplicated word
ext2: ext2.h: fix duplicated word + typos
udf: Replace HTTP links with HTTPS ones
quota: Fixup http links in quota doc
Replace HTTP links with HTTPS ones: DISKQUOTA
ext2: initialize quota info in ext2_xattr_set()
ext2: fix some incorrect comments in inode.c
ext2: remove nocheck option
ext2: fix missing percpu_counter_inc
ext2: ext2_find_entry() return -ENOENT if no entry found
ext2: propagate errors up to ext2_find_entry()'s callers
ext2: fix improper assignment for e_value_offs

+86 -84
+6 -6
Documentation/filesystems/quota.rst
··· 18 18 filesystem. 19 19 20 20 For more details about quota design, see the documentation in quota-tools package 21 - (http://sourceforge.net/projects/linuxquota). 21 + (https://sourceforge.net/projects/linuxquota). 22 22 23 23 Quota netlink interface 24 24 ======================= ··· 31 31 and processed accordingly. 32 32 33 33 The interface uses generic netlink framework (see 34 - http://lwn.net/Articles/208755/ and http://people.suug.ch/~tgr/libnl/ for more 35 - details about this layer). The name of the quota generic netlink interface 36 - is "VFS_DQUOT". Definitions of constants below are in <linux/quota.h>. 37 - Since the quota netlink protocol is not namespace aware, quota netlink messages 38 - are sent only in initial network namespace. 34 + https://lwn.net/Articles/208755/ and http://www.infradead.org/~tgr/libnl/ for 35 + more details about this layer). The name of the quota generic netlink interface 36 + is "VFS_DQUOT". Definitions of constants below are in <linux/quota.h>. Since 37 + the quota netlink protocol is not namespace aware, quota netlink messages are 38 + sent only in initial network namespace. 39 39 40 40 Currently, the interface supports only one message type QUOTA_NL_C_WARNING. 41 41 This command is used to send a notification about any of the above mentioned
+1 -1
Documentation/filesystems/udf.rst
··· 72 72 73 73 Documentation on UDF and ECMA 167 is available FREE from: 74 74 - http://www.osta.org/ 75 - - http://www.ecma-international.org/ 75 + - https://www.ecma-international.org/
+27 -28
fs/ext2/dir.c
··· 348 348 struct page *page = NULL; 349 349 struct ext2_inode_info *ei = EXT2_I(dir); 350 350 ext2_dirent * de; 351 - int dir_has_error = 0; 352 351 353 352 if (npages == 0) 354 353 goto out; ··· 361 362 n = start; 362 363 do { 363 364 char *kaddr; 364 - page = ext2_get_page(dir, n, dir_has_error); 365 - if (!IS_ERR(page)) { 366 - kaddr = page_address(page); 367 - de = (ext2_dirent *) kaddr; 368 - kaddr += ext2_last_byte(dir, n) - reclen; 369 - while ((char *) de <= kaddr) { 370 - if (de->rec_len == 0) { 371 - ext2_error(dir->i_sb, __func__, 372 - "zero-length directory entry"); 373 - ext2_put_page(page); 374 - goto out; 375 - } 376 - if (ext2_match (namelen, name, de)) 377 - goto found; 378 - de = ext2_next_entry(de); 365 + page = ext2_get_page(dir, n, 0); 366 + if (IS_ERR(page)) 367 + return ERR_CAST(page); 368 + 369 + kaddr = page_address(page); 370 + de = (ext2_dirent *) kaddr; 371 + kaddr += ext2_last_byte(dir, n) - reclen; 372 + while ((char *) de <= kaddr) { 373 + if (de->rec_len == 0) { 374 + ext2_error(dir->i_sb, __func__, 375 + "zero-length directory entry"); 376 + ext2_put_page(page); 377 + goto out; 379 378 } 380 - ext2_put_page(page); 381 - } else 382 - dir_has_error = 1; 379 + if (ext2_match(namelen, name, de)) 380 + goto found; 381 + de = ext2_next_entry(de); 382 + } 383 + ext2_put_page(page); 383 384 384 385 if (++n >= npages) 385 386 n = 0; ··· 393 394 } 394 395 } while (n != start); 395 396 out: 396 - return NULL; 397 + return ERR_PTR(-ENOENT); 397 398 398 399 found: 399 400 *res_page = page; ··· 413 414 return de; 414 415 } 415 416 416 - ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child) 417 + int ext2_inode_by_name(struct inode *dir, const struct qstr *child, ino_t *ino) 417 418 { 418 - ino_t res = 0; 419 419 struct ext2_dir_entry_2 *de; 420 420 struct page *page; 421 421 422 - de = ext2_find_entry (dir, child, &page); 423 - if (de) { 424 - res = le32_to_cpu(de->inode); 425 - ext2_put_page(page); 426 - } 427 - return res; 422 + de = ext2_find_entry(dir, child, &page); 423 + if (IS_ERR(de)) 424 + return PTR_ERR(de); 425 + 426 + *ino = le32_to_cpu(de->inode); 427 + ext2_put_page(page); 428 + return 0; 428 429 } 429 430 430 431 static int ext2_prepare_chunk(struct page *page, loff_t pos, unsigned len)
+4 -4
fs/ext2/ext2.h
··· 52 52 /* 53 53 * Was i_next_alloc_goal in ext2_inode_info 54 54 * is the *physical* companion to i_next_alloc_block. 55 - * it the the physical block number of the block which was most-recentl 56 - * allocated to this file. This give us the goal (target) for the next 55 + * it is the physical block number of the block which was most-recently 56 + * allocated to this file. This gives us the goal (target) for the next 57 57 * allocation when we detect linearly ascending requests. 58 58 */ 59 59 ext2_fsblk_t last_alloc_physical_block; ··· 374 374 /* 375 375 * Mount flags 376 376 */ 377 - #define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ 378 377 #define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ 379 378 #define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ 380 379 #define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ ··· 737 738 738 739 /* dir.c */ 739 740 extern int ext2_add_link (struct dentry *, struct inode *); 740 - extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *); 741 + extern int ext2_inode_by_name(struct inode *dir, 742 + const struct qstr *child, ino_t *ino); 741 743 extern int ext2_make_empty(struct inode *, struct inode *); 742 744 extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **); 743 745 extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
+2 -1
fs/ext2/ialloc.c
··· 80 80 if (dir) 81 81 le16_add_cpu(&desc->bg_used_dirs_count, -1); 82 82 spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); 83 + percpu_counter_inc(&EXT2_SB(sb)->s_freeinodes_counter); 83 84 if (dir) 84 85 percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); 85 86 mark_buffer_dirty(bh); ··· 529 528 goto fail; 530 529 } 531 530 532 - percpu_counter_add(&sbi->s_freeinodes_counter, -1); 531 + percpu_counter_dec(&sbi->s_freeinodes_counter); 533 532 if (S_ISDIR(mode)) 534 533 percpu_counter_inc(&sbi->s_dirs_counter); 535 534
+2 -5
fs/ext2/inode.c
··· 356 356 * @blks: number of data blocks to be mapped. 357 357 * @blocks_to_boundary: the offset in the indirect block 358 358 * 359 - * return the total number of blocks to be allocate, including the 360 - * direct and indirect blocks. 359 + * return the number of direct blocks to allocate. 361 360 */ 362 361 static int 363 362 ext2_blks_to_allocate(Indirect * branch, int k, unsigned long blks, ··· 389 390 * ext2_alloc_blocks: multiple allocate blocks needed for a branch 390 391 * @indirect_blks: the number of blocks need to allocate for indirect 391 392 * blocks 392 - * 393 + * @blks: the number of blocks need to allocate for direct blocks 393 394 * @new_blocks: on return it will store the new block numbers for 394 395 * the indirect blocks(if needed) and the first direct block, 395 - * @blks: on return it will store the total number of allocated 396 - * direct blocks 397 396 */ 398 397 static int ext2_alloc_blocks(struct inode *inode, 399 398 ext2_fsblk_t goal, int indirect_blks, int blks,
+24 -15
fs/ext2/namei.c
··· 57 57 { 58 58 struct inode * inode; 59 59 ino_t ino; 60 + int res; 60 61 61 62 if (dentry->d_name.len > EXT2_NAME_LEN) 62 63 return ERR_PTR(-ENAMETOOLONG); 63 64 64 - ino = ext2_inode_by_name(dir, &dentry->d_name); 65 - inode = NULL; 66 - if (ino) { 65 + res = ext2_inode_by_name(dir, &dentry->d_name, &ino); 66 + if (res) { 67 + if (res != -ENOENT) 68 + return ERR_PTR(res); 69 + inode = NULL; 70 + } else { 67 71 inode = ext2_iget(dir->i_sb, ino); 68 72 if (inode == ERR_PTR(-ESTALE)) { 69 73 ext2_error(dir->i_sb, __func__, ··· 82 78 struct dentry *ext2_get_parent(struct dentry *child) 83 79 { 84 80 struct qstr dotdot = QSTR_INIT("..", 2); 85 - unsigned long ino = ext2_inode_by_name(d_inode(child), &dotdot); 86 - if (!ino) 87 - return ERR_PTR(-ENOENT); 81 + ino_t ino; 82 + int res; 83 + 84 + res = ext2_inode_by_name(d_inode(child), &dotdot, &ino); 85 + if (res) 86 + return ERR_PTR(res); 87 + 88 88 return d_obtain_alias(ext2_iget(child->d_sb, ino)); 89 89 } 90 90 ··· 282 274 if (err) 283 275 goto out; 284 276 285 - de = ext2_find_entry (dir, &dentry->d_name, &page); 286 - if (!de) { 287 - err = -ENOENT; 277 + de = ext2_find_entry(dir, &dentry->d_name, &page); 278 + if (IS_ERR(de)) { 279 + err = PTR_ERR(de); 288 280 goto out; 289 281 } 290 282 ··· 338 330 if (err) 339 331 goto out; 340 332 341 - old_de = ext2_find_entry (old_dir, &old_dentry->d_name, &old_page); 342 - if (!old_de) { 343 - err = -ENOENT; 333 + old_de = ext2_find_entry(old_dir, &old_dentry->d_name, &old_page); 334 + if (IS_ERR(old_de)) { 335 + err = PTR_ERR(old_de); 344 336 goto out; 345 337 } 346 338 ··· 359 351 if (dir_de && !ext2_empty_dir (new_inode)) 360 352 goto out_dir; 361 353 362 - err = -ENOENT; 363 - new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page); 364 - if (!new_de) 354 + new_de = ext2_find_entry(new_dir, &new_dentry->d_name, &new_page); 355 + if (IS_ERR(new_de)) { 356 + err = PTR_ERR(new_de); 365 357 goto out_dir; 358 + } 366 359 ext2_set_link(new_dir, new_de, new_page, old_inode, 1); 367 360 new_inode->i_ctime = current_time(new_inode); 368 361 if (dir_de)
+1 -9
fs/ext2/super.c
··· 431 431 enum { 432 432 Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid, 433 433 Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, 434 - Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug, 434 + Opt_err_ro, Opt_nouid32, Opt_debug, 435 435 Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr, 436 436 Opt_acl, Opt_noacl, Opt_xip, Opt_dax, Opt_ignore, Opt_err, Opt_quota, 437 437 Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation ··· 451 451 {Opt_err_panic, "errors=panic"}, 452 452 {Opt_err_ro, "errors=remount-ro"}, 453 453 {Opt_nouid32, "nouid32"}, 454 - {Opt_nocheck, "check=none"}, 455 - {Opt_nocheck, "nocheck"}, 456 454 {Opt_debug, "debug"}, 457 455 {Opt_oldalloc, "oldalloc"}, 458 456 {Opt_orlov, "orlov"}, ··· 543 545 break; 544 546 case Opt_nouid32: 545 547 set_opt (opts->s_mount_opt, NO_UID32); 546 - break; 547 - case Opt_nocheck: 548 - ext2_msg(sb, KERN_WARNING, 549 - "Option nocheck/check=none is deprecated and" 550 - " will be removed in June 2020."); 551 - clear_opt (opts->s_mount_opt, CHECK); 552 548 break; 553 549 case Opt_debug: 554 550 set_opt (opts->s_mount_opt, DEBUG);
+5 -1
fs/ext2/xattr.c
··· 437 437 name_len = strlen(name); 438 438 if (name_len > 255 || value_len > sb->s_blocksize) 439 439 return -ERANGE; 440 + error = dquot_initialize(inode); 441 + if (error) 442 + return error; 440 443 down_write(&EXT2_I(inode)->xattr_sem); 441 444 if (EXT2_I(inode)->i_file_acl) { 442 445 /* The inode already has an extended attribute block. */ ··· 591 588 /* Remove the old value. */ 592 589 memmove(first_val + size, first_val, val - first_val); 593 590 memset(first_val, 0, size); 594 - here->e_value_offs = 0; 595 591 min_offs += size; 596 592 597 593 /* Adjust all value offsets. */ ··· 602 600 cpu_to_le16(o + size); 603 601 last = EXT2_XATTR_NEXT(last); 604 602 } 603 + 604 + here->e_value_offs = 0; 605 605 } 606 606 if (value == NULL) { 607 607 /* Remove the old name. */
+1 -1
fs/quota/Kconfig
··· 15 15 Ext3, ext4 and reiserfs also support journaled quotas for which 16 16 you don't need to run quotacheck(8) after an unclean shutdown. 17 17 For further details, read the Quota mini-HOWTO, available from 18 - <http://www.tldp.org/docs.html#howto>, or the documentation provided 18 + <https://www.tldp.org/docs.html#howto>, or the documentation provided 19 19 with the quota tools. Probably the quota support is only useful for 20 20 multi user systems. If unsure, say N. 21 21
+4 -4
fs/reiserfs/dir.c
··· 289 289 290 290 /* direntry header of "." */ 291 291 put_deh_offset(dot, DOT_OFFSET); 292 - /* these two are from make_le_item_head, and are are LE */ 292 + /* these two are from make_le_item_head, and are LE */ 293 293 dot->deh_dir_id = dirid; 294 294 dot->deh_objectid = objid; 295 295 dot->deh_state = 0; /* Endian safe if 0 */ ··· 299 299 /* direntry header of ".." */ 300 300 put_deh_offset(dotdot, DOT_DOT_OFFSET); 301 301 /* key of ".." for the root directory */ 302 - /* these two are from the inode, and are are LE */ 302 + /* these two are from the inode, and are LE */ 303 303 dotdot->deh_dir_id = par_dirid; 304 304 dotdot->deh_objectid = par_objid; 305 305 dotdot->deh_state = 0; /* Endian safe if 0 */ ··· 323 323 324 324 /* direntry header of "." */ 325 325 put_deh_offset(dot, DOT_OFFSET); 326 - /* these two are from make_le_item_head, and are are LE */ 326 + /* these two are from make_le_item_head, and are LE */ 327 327 dot->deh_dir_id = dirid; 328 328 dot->deh_objectid = objid; 329 329 dot->deh_state = 0; /* Endian safe if 0 */ ··· 333 333 /* direntry header of ".." */ 334 334 put_deh_offset(dotdot, DOT_DOT_OFFSET); 335 335 /* key of ".." for the root directory */ 336 - /* these two are from the inode, and are are LE */ 336 + /* these two are from the inode, and are LE */ 337 337 dotdot->deh_dir_id = par_dirid; 338 338 dotdot->deh_objectid = par_objid; 339 339 dotdot->deh_state = 0; /* Endian safe if 0 */
+2 -2
fs/reiserfs/fix_node.c
··· 611 611 * blk_num number of blocks that S[h] will be splitted into; 612 612 * s012 number of items that fall into splitted nodes. 613 613 * lbytes number of bytes which flow to the left neighbor from the 614 - * item that is not not shifted entirely 614 + * item that is not shifted entirely 615 615 * rbytes number of bytes which flow to the right neighbor from the 616 - * item that is not not shifted entirely 616 + * item that is not shifted entirely 617 617 * s1bytes number of bytes which flow to the first new node when 618 618 * S[0] splits (this number is contained in s012 array) 619 619 */
+1 -1
fs/reiserfs/journal.c
··· 32 32 * to disk for all backgrounded commits that have been 33 33 * around too long. 34 34 * -- Note, if you call this as an immediate flush from 35 - * from within kupdate, it will ignore the immediate flag 35 + * within kupdate, it will ignore the immediate flag 36 36 */ 37 37 38 38 #include <linux/time.h>
+1 -1
fs/reiserfs/reiserfs.h
··· 1109 1109 * ReiserFS leaves the first 64k unused, so that partition labels have 1110 1110 * enough space. If someone wants to write a fancy bootloader that 1111 1111 * needs more than 64k, let us know, and this will be increased in size. 1112 - * This number must be larger than than the largest block size on any 1112 + * This number must be larger than the largest block size on any 1113 1113 * platform, or code will break. -Hans 1114 1114 */ 1115 1115 #define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
+1 -1
fs/reiserfs/xattr_acl.c
··· 373 373 374 374 /* Other xattrs can be created during inode creation. We don't 375 375 * want to claim too many blocks, so we check to see if we 376 - * we need to create the tree to the xattrs, and then we 376 + * need to create the tree to the xattrs, and then we 377 377 * just want two files. */ 378 378 nblocks = reiserfs_xattr_jcreate_nblocks(inode); 379 379 nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb);
+1 -1
fs/udf/ecma_167.h
··· 2 2 * ecma_167.h 3 3 * 4 4 * This file is based on ECMA-167 3rd edition (June 1997) 5 - * http://www.ecma.ch 5 + * https://www.ecma.ch 6 6 * 7 7 * Copyright (c) 2001-2002 Ben Fennema 8 8 * Copyright (c) 2017-2019 Pali Rohár <pali@kernel.org>
+1 -1
fs/udf/osta_udf.h
··· 226 226 #define ICBTAG_FILE_TYPE_MIRROR 0xFB 227 227 #define ICBTAG_FILE_TYPE_BITMAP 0xFC 228 228 229 - /* struct struct long_ad ICB - ADImpUse (UDF 2.60 2.2.4.3) */ 229 + /* struct long_ad ICB - ADImpUse (UDF 2.60 2.2.4.3) */ 230 230 struct allocDescImpUse { 231 231 __le16 flags; 232 232 uint8_t impUse[4];
+2 -2
fs/udf/super.c
··· 11 11 * This code is based on version 2.00 of the UDF specification, 12 12 * and revision 3 of the ECMA 167 standard [equivalent to ISO 13346]. 13 13 * http://www.osta.org/ 14 - * http://www.ecma.ch/ 15 - * http://www.iso.org/ 14 + * https://www.ecma.ch/ 15 + * https://www.iso.org/ 16 16 * 17 17 * COPYRIGHT 18 18 * This file is distributed under the terms of the GNU General Public