From 1fcbcf06e4f159e0db39a53fe258336febbba804 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Wed, 3 Jun 2020 16:44:29 +0800 Subject: ext2: fix improper assignment for e_value_offs In the process of changing value for existing EA, there is an improper assignment of e_value_offs(setting to 0), because it will be reset to incorrect value in the following loop(shifting EA values before target). Delayed assignment can avoid this issue. Link: https://lore.kernel.org/r/20200603084429.25344-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara --- fs/ext2/xattr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 943cc469f42f..c802ea682e7f 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -588,7 +588,6 @@ bad_block: /* Remove the old value. */ memmove(first_val + size, first_val, val - first_val); memset(first_val, 0, size); - here->e_value_offs = 0; min_offs += size; /* Adjust all value offsets. */ @@ -600,6 +599,8 @@ bad_block: cpu_to_le16(o + size); last = EXT2_XATTR_NEXT(last); } + + here->e_value_offs = 0; } if (value == NULL) { /* Remove the old name. */ -- cgit v1.2.3 From b4962091a54c8c332e4c6c211a86b7f6d6e1f759 Mon Sep 17 00:00:00 2001 From: "zhangyi (F)" Date: Mon, 8 Jun 2020 11:40:42 +0800 Subject: ext2: propagate errors up to ext2_find_entry()'s callers The same to commit <36de928641ee4> (ext4: propagate errors up to ext4_find_entry()'s callers') in ext4, also return error instead of NULL pointer in case of some error happens in ext2_find_entry() (e.g. -ENOMEM or -EIO). This could avoid a negative dentry cache entry installed even it failed to read directory block due to IO error. Link: https://lore.kernel.org/r/20200608034043.10451-1-yi.zhang@huawei.com Signed-off-by: zhangyi (F) Signed-off-by: Jan Kara --- fs/ext2/dir.c | 53 ++++++++++++++++++++++++++--------------------------- fs/ext2/ext2.h | 3 ++- fs/ext2/namei.c | 32 ++++++++++++++++++++++++++------ 3 files changed, 54 insertions(+), 34 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 13318e255ebf..95e4f0bd55a3 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -348,7 +348,6 @@ struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, struct page *page = NULL; struct ext2_inode_info *ei = EXT2_I(dir); ext2_dirent * de; - int dir_has_error = 0; if (npages == 0) goto out; @@ -362,25 +361,25 @@ struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, n = start; do { char *kaddr; - page = ext2_get_page(dir, n, dir_has_error); - if (!IS_ERR(page)) { - kaddr = page_address(page); - de = (ext2_dirent *) kaddr; - kaddr += ext2_last_byte(dir, n) - reclen; - while ((char *) de <= kaddr) { - if (de->rec_len == 0) { - ext2_error(dir->i_sb, __func__, - "zero-length directory entry"); - ext2_put_page(page); - goto out; - } - if (ext2_match (namelen, name, de)) - goto found; - de = ext2_next_entry(de); + page = ext2_get_page(dir, n, 0); + if (IS_ERR(page)) + return ERR_CAST(page); + + kaddr = page_address(page); + de = (ext2_dirent *) kaddr; + kaddr += ext2_last_byte(dir, n) - reclen; + while ((char *) de <= kaddr) { + if (de->rec_len == 0) { + ext2_error(dir->i_sb, __func__, + "zero-length directory entry"); + ext2_put_page(page); + goto out; } - ext2_put_page(page); - } else - dir_has_error = 1; + if (ext2_match(namelen, name, de)) + goto found; + de = ext2_next_entry(de); + } + ext2_put_page(page); if (++n >= npages) n = 0; @@ -414,18 +413,18 @@ struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) return de; } -ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child) +int ext2_inode_by_name(struct inode *dir, const struct qstr *child, ino_t *ino) { - ino_t res = 0; struct ext2_dir_entry_2 *de; struct page *page; - de = ext2_find_entry (dir, child, &page); - if (de) { - res = le32_to_cpu(de->inode); - ext2_put_page(page); - } - return res; + de = ext2_find_entry(dir, child, &page); + if (IS_ERR_OR_NULL(de)) + return PTR_ERR(de); + + *ino = le32_to_cpu(de->inode); + ext2_put_page(page); + return 0; } static int ext2_prepare_chunk(struct page *page, loff_t pos, unsigned len) diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 8178bd38a9d6..a321ff9bf1b4 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -738,7 +738,8 @@ extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_wind /* dir.c */ extern int ext2_add_link (struct dentry *, struct inode *); -extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *); +extern int ext2_inode_by_name(struct inode *dir, + const struct qstr *child, ino_t *ino); extern int ext2_make_empty(struct inode *, struct inode *); extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **); extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index ba3e3e075891..9a6ab213bc4d 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -56,12 +56,15 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode) static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) { struct inode * inode; - ino_t ino; + ino_t ino = 0; + int res; if (dentry->d_name.len > EXT2_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); - ino = ext2_inode_by_name(dir, &dentry->d_name); + res = ext2_inode_by_name(dir, &dentry->d_name, &ino); + if (res) + return ERR_PTR(res); inode = NULL; if (ino) { inode = ext2_iget(dir->i_sb, ino); @@ -78,7 +81,12 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, uns struct dentry *ext2_get_parent(struct dentry *child) { struct qstr dotdot = QSTR_INIT("..", 2); - unsigned long ino = ext2_inode_by_name(d_inode(child), &dotdot); + ino_t ino = 0; + int res; + + res = ext2_inode_by_name(d_inode(child), &dotdot, &ino); + if (res) + return ERR_PTR(res); if (!ino) return ERR_PTR(-ENOENT); return d_obtain_alias(ext2_iget(child->d_sb, ino)); @@ -274,7 +282,11 @@ static int ext2_unlink(struct inode * dir, struct dentry *dentry) if (err) goto out; - de = ext2_find_entry (dir, &dentry->d_name, &page); + de = ext2_find_entry(dir, &dentry->d_name, &page); + if (IS_ERR(de)) { + err = PTR_ERR(de); + goto out; + } if (!de) { err = -ENOENT; goto out; @@ -330,7 +342,11 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry, if (err) goto out; - old_de = ext2_find_entry (old_dir, &old_dentry->d_name, &old_page); + old_de = ext2_find_entry(old_dir, &old_dentry->d_name, &old_page); + if (IS_ERR(old_de)) { + err = PTR_ERR(old_de); + goto out; + } if (!old_de) { err = -ENOENT; goto out; @@ -352,7 +368,11 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry, goto out_dir; err = -ENOENT; - new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page); + new_de = ext2_find_entry(new_dir, &new_dentry->d_name, &new_page); + if (IS_ERR(new_de)) { + err = PTR_ERR(new_de); + goto out_dir; + } if (!new_de) goto out_dir; ext2_set_link(new_dir, new_de, new_page, old_inode, 1); -- cgit v1.2.3 From a43850a380ef56009ce721737b0c08984b663b99 Mon Sep 17 00:00:00 2001 From: "zhangyi (F)" Date: Mon, 8 Jun 2020 11:40:43 +0800 Subject: ext2: ext2_find_entry() return -ENOENT if no entry found Almost all callers of ext2_find_entry() transform NULL return value to -ENOENT, so just let ext2_find_entry() retuen -ENOENT instead of NULL if no valid entry found, and also switch to check the return value of ext2_inode_by_name() in ext2_lookup() and ext2_get_parent(). Link: https://lore.kernel.org/r/20200608034043.10451-2-yi.zhang@huawei.com Signed-off-by: zhangyi (F) Suggested-by: Jan Kara Signed-off-by: Jan Kara --- fs/ext2/dir.c | 4 ++-- fs/ext2/namei.c | 27 ++++++++------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 95e4f0bd55a3..70355ab6740e 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -393,7 +393,7 @@ struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, } } while (n != start); out: - return NULL; + return ERR_PTR(-ENOENT); found: *res_page = page; @@ -419,7 +419,7 @@ int ext2_inode_by_name(struct inode *dir, const struct qstr *child, ino_t *ino) struct page *page; de = ext2_find_entry(dir, child, &page); - if (IS_ERR_OR_NULL(de)) + if (IS_ERR(de)) return PTR_ERR(de); *ino = le32_to_cpu(de->inode); diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 9a6ab213bc4d..5bf2c145643b 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -56,17 +56,18 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode) static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) { struct inode * inode; - ino_t ino = 0; + ino_t ino; int res; if (dentry->d_name.len > EXT2_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); res = ext2_inode_by_name(dir, &dentry->d_name, &ino); - if (res) - return ERR_PTR(res); - inode = NULL; - if (ino) { + if (res) { + if (res != -ENOENT) + return ERR_PTR(res); + inode = NULL; + } else { inode = ext2_iget(dir->i_sb, ino); if (inode == ERR_PTR(-ESTALE)) { ext2_error(dir->i_sb, __func__, @@ -81,14 +82,13 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, uns struct dentry *ext2_get_parent(struct dentry *child) { struct qstr dotdot = QSTR_INIT("..", 2); - ino_t ino = 0; + ino_t ino; int res; res = ext2_inode_by_name(d_inode(child), &dotdot, &ino); if (res) return ERR_PTR(res); - if (!ino) - return ERR_PTR(-ENOENT); + return d_obtain_alias(ext2_iget(child->d_sb, ino)); } @@ -287,10 +287,6 @@ static int ext2_unlink(struct inode * dir, struct dentry *dentry) err = PTR_ERR(de); goto out; } - if (!de) { - err = -ENOENT; - goto out; - } err = ext2_delete_entry (de, page); if (err) @@ -347,10 +343,6 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry, err = PTR_ERR(old_de); goto out; } - if (!old_de) { - err = -ENOENT; - goto out; - } if (S_ISDIR(old_inode->i_mode)) { err = -EIO; @@ -367,14 +359,11 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry, if (dir_de && !ext2_empty_dir (new_inode)) goto out_dir; - err = -ENOENT; new_de = ext2_find_entry(new_dir, &new_dentry->d_name, &new_page); if (IS_ERR(new_de)) { err = PTR_ERR(new_de); goto out_dir; } - if (!new_de) - goto out_dir; ext2_set_link(new_dir, new_de, new_page, old_inode, 1); new_inode->i_ctime = current_time(new_inode); if (dir_de) -- cgit v1.2.3 From bc2fbaa4d3808aef82dd1064a8e61c16549fe956 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Mon, 20 Apr 2020 16:02:21 -0400 Subject: ext2: fix missing percpu_counter_inc sbi->s_freeinodes_counter is only decreased by the ext2 code, it is never increased. This patch fixes it. Note that sbi->s_freeinodes_counter is only used in the algorithm that tries to find the group for new allocations, so this bug is not easily visible (the only visibility is that the group finding algorithm selects inoptinal result). Link: https://lore.kernel.org/r/alpine.LRH.2.02.2004201538300.19436@file01.intranet.prod.int.rdu2.redhat.com Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Jan Kara --- fs/ext2/ialloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index fda7d3f5b4be..432c3febea6d 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -80,6 +80,7 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir) if (dir) le16_add_cpu(&desc->bg_used_dirs_count, -1); spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); + percpu_counter_inc(&EXT2_SB(sb)->s_freeinodes_counter); if (dir) percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); mark_buffer_dirty(bh); @@ -528,7 +529,7 @@ got: goto fail; } - percpu_counter_add(&sbi->s_freeinodes_counter, -1); + percpu_counter_dec(&sbi->s_freeinodes_counter); if (S_ISDIR(mode)) percpu_counter_inc(&sbi->s_dirs_counter); -- cgit v1.2.3 From 30b42a714d3241ce2aa2561f629dd6088c60fef7 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Fri, 19 Jun 2020 15:31:44 +0800 Subject: ext2: remove nocheck option Remove useless nocheck option. Link: https://lore.kernel.org/r/20200619073144.4701-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara --- fs/ext2/ext2.h | 1 - fs/ext2/super.c | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index a321ff9bf1b4..0debad3e10e3 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -374,7 +374,6 @@ struct ext2_inode { /* * Mount flags */ -#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */ #define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */ #define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */ #define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */ diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 4a4ab683250d..dda860562ca3 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -431,7 +431,7 @@ static unsigned long get_sb_block(void **data) enum { Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid, Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, - Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug, + Opt_err_ro, Opt_nouid32, Opt_debug, Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_xip, Opt_dax, Opt_ignore, Opt_err, Opt_quota, Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation @@ -451,8 +451,6 @@ static const match_table_t tokens = { {Opt_err_panic, "errors=panic"}, {Opt_err_ro, "errors=remount-ro"}, {Opt_nouid32, "nouid32"}, - {Opt_nocheck, "check=none"}, - {Opt_nocheck, "nocheck"}, {Opt_debug, "debug"}, {Opt_oldalloc, "oldalloc"}, {Opt_orlov, "orlov"}, @@ -546,12 +544,6 @@ static int parse_options(char *options, struct super_block *sb, case Opt_nouid32: set_opt (opts->s_mount_opt, NO_UID32); break; - case Opt_nocheck: - ext2_msg(sb, KERN_WARNING, - "Option nocheck/check=none is deprecated and" - " will be removed in June 2020."); - clear_opt (opts->s_mount_opt, CHECK); - break; case Opt_debug: set_opt (opts->s_mount_opt, DEBUG); break; -- cgit v1.2.3 From cf1013f441eb997ae770566f88cf021086d34cff Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Fri, 3 Jul 2020 20:44:11 +0800 Subject: ext2: fix some incorrect comments in inode.c There are some incorrect comments in inode.c, so fix them properly. Link: https://lore.kernel.org/r/20200703124411.24085-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara --- fs/ext2/inode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index c8b371c82b4f..80662e1f7889 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -356,8 +356,7 @@ static inline ext2_fsblk_t ext2_find_goal(struct inode *inode, long block, * @blks: number of data blocks to be mapped. * @blocks_to_boundary: the offset in the indirect block * - * return the total number of blocks to be allocate, including the - * direct and indirect blocks. + * return the number of direct blocks to allocate. */ static int ext2_blks_to_allocate(Indirect * branch, int k, unsigned long blks, @@ -390,11 +389,9 @@ ext2_blks_to_allocate(Indirect * branch, int k, unsigned long blks, * ext2_alloc_blocks: multiple allocate blocks needed for a branch * @indirect_blks: the number of blocks need to allocate for indirect * blocks - * + * @blks: the number of blocks need to allocate for direct blocks * @new_blocks: on return it will store the new block numbers for * the indirect blocks(if needed) and the first direct block, - * @blks: on return it will store the total number of allocated - * direct blocks */ static int ext2_alloc_blocks(struct inode *inode, ext2_fsblk_t goal, int indirect_blks, int blks, -- cgit v1.2.3 From 1197d04fd3f1daf75cfd0a68442080186e546178 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Fri, 26 Jun 2020 13:49:59 +0800 Subject: ext2: initialize quota info in ext2_xattr_set() In order to correctly account/limit space usage, should initialize quota info before calling quota related functions. Link: https://lore.kernel.org/r/20200626054959.114177-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Reviewed-by: Reviewed-by: Ritesh Harjani Signed-off-by: Jan Kara --- fs/ext2/xattr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index c802ea682e7f..841fa6d9d744 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -437,6 +437,9 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name, name_len = strlen(name); if (name_len > 255 || value_len > sb->s_blocksize) return -ERANGE; + error = dquot_initialize(inode); + if (error) + return error; down_write(&EXT2_I(inode)->xattr_sem); if (EXT2_I(inode)->i_file_acl) { /* The inode already has an extended attribute block. */ -- cgit v1.2.3 From 1f1a5be80ceec2acdbd6f221747657fbe3e44a8f Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 8 Jul 2020 19:19:05 +0200 Subject: Replace HTTP links with HTTPS ones: DISKQUOTA Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Link: https://lore.kernel.org/r/20200708171905.15396-1-grandmaster@al2klimov.de Signed-off-by: Alexander A. Klimov Signed-off-by: Jan Kara --- Documentation/filesystems/quota.rst | 2 +- fs/quota/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/quota.rst b/Documentation/filesystems/quota.rst index a30cdd47c652..6508c4520ba5 100644 --- a/Documentation/filesystems/quota.rst +++ b/Documentation/filesystems/quota.rst @@ -31,7 +31,7 @@ the above events to userspace. There they can be captured by an application and processed accordingly. The interface uses generic netlink framework (see -http://lwn.net/Articles/208755/ and http://people.suug.ch/~tgr/libnl/ for more +https://lwn.net/Articles/208755/ and http://people.suug.ch/~tgr/libnl/ for more details about this layer). The name of the quota generic netlink interface is "VFS_DQUOT". Definitions of constants below are in . Since the quota netlink protocol is not namespace aware, quota netlink messages diff --git a/fs/quota/Kconfig b/fs/quota/Kconfig index 7218314ca13f..d1ceb76adb71 100644 --- a/fs/quota/Kconfig +++ b/fs/quota/Kconfig @@ -15,7 +15,7 @@ config QUOTA Ext3, ext4 and reiserfs also support journaled quotas for which you don't need to run quotacheck(8) after an unclean shutdown. For further details, read the Quota mini-HOWTO, available from - , or the documentation provided + , or the documentation provided with the quota tools. Probably the quota support is only useful for multi user systems. If unsure, say N. -- cgit v1.2.3 From 476fdf14e5c55c699f4eee4fbf74b76a8f90d148 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 9 Jul 2020 08:08:36 +0200 Subject: quota: Fixup http links in quota doc Switch link to Sourceforge in quota documentation to https and replace link for libnl documentation with a working one from infradead. Signed-off-by: Jan Kara --- Documentation/filesystems/quota.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/filesystems/quota.rst b/Documentation/filesystems/quota.rst index 6508c4520ba5..abd4303c546e 100644 --- a/Documentation/filesystems/quota.rst +++ b/Documentation/filesystems/quota.rst @@ -18,7 +18,7 @@ Quota limits (and amount of grace time) are set independently for each filesystem. For more details about quota design, see the documentation in quota-tools package -(http://sourceforge.net/projects/linuxquota). +(https://sourceforge.net/projects/linuxquota). Quota netlink interface ======================= @@ -31,11 +31,11 @@ the above events to userspace. There they can be captured by an application and processed accordingly. The interface uses generic netlink framework (see -https://lwn.net/Articles/208755/ and http://people.suug.ch/~tgr/libnl/ for more -details about this layer). The name of the quota generic netlink interface -is "VFS_DQUOT". Definitions of constants below are in . -Since the quota netlink protocol is not namespace aware, quota netlink messages -are sent only in initial network namespace. +https://lwn.net/Articles/208755/ and http://www.infradead.org/~tgr/libnl/ for +more details about this layer). The name of the quota generic netlink interface +is "VFS_DQUOT". Definitions of constants below are in . Since +the quota netlink protocol is not namespace aware, quota netlink messages are +sent only in initial network namespace. Currently, the interface supports only one message type QUOTA_NL_C_WARNING. This command is used to send a notification about any of the above mentioned -- cgit v1.2.3 From 248727a49897c5f5f984353c67272a97a8429c4b Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 13 Jul 2020 22:07:38 +0200 Subject: udf: Replace HTTP links with HTTPS ones Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Link: https://lore.kernel.org/r/20200713200738.37800-1-grandmaster@al2klimov.de Signed-off-by: Alexander A. Klimov Signed-off-by: Jan Kara --- Documentation/filesystems/udf.rst | 2 +- fs/udf/ecma_167.h | 2 +- fs/udf/super.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/filesystems/udf.rst b/Documentation/filesystems/udf.rst index d9badbf285b2..f9489ddbb767 100644 --- a/Documentation/filesystems/udf.rst +++ b/Documentation/filesystems/udf.rst @@ -72,4 +72,4 @@ For the latest version and toolset see: Documentation on UDF and ECMA 167 is available FREE from: - http://www.osta.org/ - - http://www.ecma-international.org/ + - https://www.ecma-international.org/ diff --git a/fs/udf/ecma_167.h b/fs/udf/ecma_167.h index 736ebc5dc441..185c3e247648 100644 --- a/fs/udf/ecma_167.h +++ b/fs/udf/ecma_167.h @@ -2,7 +2,7 @@ * ecma_167.h * * This file is based on ECMA-167 3rd edition (June 1997) - * http://www.ecma.ch + * https://www.ecma.ch * * Copyright (c) 2001-2002 Ben Fennema * Copyright (c) 2017-2019 Pali Rohár diff --git a/fs/udf/super.c b/fs/udf/super.c index f747bf72edbe..1c42f544096d 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -11,8 +11,8 @@ * This code is based on version 2.00 of the UDF specification, * and revision 3 of the ECMA 167 standard [equivalent to ISO 13346]. * http://www.osta.org/ - * http://www.ecma.ch/ - * http://www.iso.org/ + * https://www.ecma.ch/ + * https://www.iso.org/ * * COPYRIGHT * This file is distributed under the terms of the GNU General Public -- cgit v1.2.3 From 17a0445e7b5d0238c01a7e9b9885a4464408eb5d Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 19 Jul 2020 17:13:27 -0700 Subject: ext2: ext2.h: fix duplicated word + typos Change the repeated word "the" in "it the the" to "it is the". Fix typo "recentl" to "recently". Fix verb "give" to "gives". Link: https://lore.kernel.org/r/20200720001327.23603-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Jan Kara Cc: linux-ext4@vger.kernel.org Signed-off-by: Jan Kara --- fs/ext2/ext2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 0debad3e10e3..5136b7289e8d 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -52,8 +52,8 @@ struct ext2_block_alloc_info { /* * Was i_next_alloc_goal in ext2_inode_info * is the *physical* companion to i_next_alloc_block. - * it the the physical block number of the block which was most-recentl - * allocated to this file. This give us the goal (target) for the next + * it is the physical block number of the block which was most-recently + * allocated to this file. This gives us the goal (target) for the next * allocation when we detect linearly ascending requests. */ ext2_fsblk_t last_alloc_physical_block; -- cgit v1.2.3 From 269f00a950cd93c2251fd90909518a069679854c Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 19 Jul 2020 17:14:31 -0700 Subject: reiserfs: reiserfs.h: delete a duplicated word Drop the repeated word "than" in a comment. Link: https://lore.kernel.org/r/20200720001431.29718-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Jan Kara Cc: Jeff Mahoney Cc: reiserfs-devel@vger.kernel.org Signed-off-by: Jan Kara --- fs/reiserfs/reiserfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h index 726580114d55..f69871516167 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h @@ -1109,7 +1109,7 @@ int is_reiserfs_jr(struct reiserfs_super_block *rs); * ReiserFS leaves the first 64k unused, so that partition labels have * enough space. If someone wants to write a fancy bootloader that * needs more than 64k, let us know, and this will be increased in size. - * This number must be larger than than the largest block size on any + * This number must be larger than the largest block size on any * platform, or code will break. -Hans */ #define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024) -- cgit v1.2.3 From dcec10a5d16b1238056ee73a6964ce8eacebc4e4 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sun, 19 Jul 2020 17:14:55 -0700 Subject: udf: osta_udf.h: delete a duplicated word Drop the repeated word "struct" in a comment. Link: https://lore.kernel.org/r/20200720001455.31882-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Jan Kara Signed-off-by: Jan Kara --- fs/udf/osta_udf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/osta_udf.h b/fs/udf/osta_udf.h index d5fbfab3ddb6..22bc4fb2feb9 100644 --- a/fs/udf/osta_udf.h +++ b/fs/udf/osta_udf.h @@ -226,7 +226,7 @@ struct sparingTable { #define ICBTAG_FILE_TYPE_MIRROR 0xFB #define ICBTAG_FILE_TYPE_BITMAP 0xFC -/* struct struct long_ad ICB - ADImpUse (UDF 2.60 2.2.4.3) */ +/* struct long_ad ICB - ADImpUse (UDF 2.60 2.2.4.3) */ struct allocDescImpUse { __le16 flags; uint8_t impUse[4]; -- cgit v1.2.3 From 9436fb4d899333f612e051a6940af52028f7168b Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 4 Aug 2020 19:49:25 -0700 Subject: reiserfs: delete duplicated words Delete repeated words in fs/reiserfs/. {from, not, we, are} Link: https://lore.kernel.org/r/20200805024925.12281-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap To: linux-fsdevel@vger.kernel.org Cc: Jan Kara Cc: Jeff Mahoney Cc: Andrew Morton Cc: reiserfs-devel@vger.kernel.org Signed-off-by: Jan Kara --- fs/reiserfs/dir.c | 8 ++++---- fs/reiserfs/fix_node.c | 4 ++-- fs/reiserfs/journal.c | 2 +- fs/reiserfs/xattr_acl.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index 5b50689d8539..79ee2b436685 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c @@ -289,7 +289,7 @@ void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid, /* direntry header of "." */ put_deh_offset(dot, DOT_OFFSET); - /* these two are from make_le_item_head, and are are LE */ + /* these two are from make_le_item_head, and are LE */ dot->deh_dir_id = dirid; dot->deh_objectid = objid; dot->deh_state = 0; /* Endian safe if 0 */ @@ -299,7 +299,7 @@ void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid, /* direntry header of ".." */ put_deh_offset(dotdot, DOT_DOT_OFFSET); /* key of ".." for the root directory */ - /* these two are from the inode, and are are LE */ + /* these two are from the inode, and are LE */ dotdot->deh_dir_id = par_dirid; dotdot->deh_objectid = par_objid; dotdot->deh_state = 0; /* Endian safe if 0 */ @@ -323,7 +323,7 @@ void make_empty_dir_item(char *body, __le32 dirid, __le32 objid, /* direntry header of "." */ put_deh_offset(dot, DOT_OFFSET); - /* these two are from make_le_item_head, and are are LE */ + /* these two are from make_le_item_head, and are LE */ dot->deh_dir_id = dirid; dot->deh_objectid = objid; dot->deh_state = 0; /* Endian safe if 0 */ @@ -333,7 +333,7 @@ void make_empty_dir_item(char *body, __le32 dirid, __le32 objid, /* direntry header of ".." */ put_deh_offset(dotdot, DOT_DOT_OFFSET); /* key of ".." for the root directory */ - /* these two are from the inode, and are are LE */ + /* these two are from the inode, and are LE */ dotdot->deh_dir_id = par_dirid; dotdot->deh_objectid = par_objid; dotdot->deh_state = 0; /* Endian safe if 0 */ diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index 117092224111..fefe87e1c099 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c @@ -611,9 +611,9 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h, * blk_num number of blocks that S[h] will be splitted into; * s012 number of items that fall into splitted nodes. * lbytes number of bytes which flow to the left neighbor from the - * item that is not not shifted entirely + * item that is not shifted entirely * rbytes number of bytes which flow to the right neighbor from the - * item that is not not shifted entirely + * item that is not shifted entirely * s1bytes number of bytes which flow to the first new node when * S[0] splits (this number is contained in s012 array) */ diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 5c766330e493..e98f99338f8f 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -32,7 +32,7 @@ * to disk for all backgrounded commits that have been * around too long. * -- Note, if you call this as an immediate flush from - * from within kupdate, it will ignore the immediate flag + * within kupdate, it will ignore the immediate flag */ #include diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 05f666794561..ccd40df6eb45 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c @@ -373,7 +373,7 @@ int reiserfs_cache_default_acl(struct inode *inode) /* Other xattrs can be created during inode creation. We don't * want to claim too many blocks, so we check to see if we - * we need to create the tree to the xattrs, and then we + * need to create the tree to the xattrs, and then we * just want two files. */ nblocks = reiserfs_xattr_jcreate_nblocks(inode); nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb); -- cgit v1.2.3