Skip to content

Commit

Permalink
Merge tag 'for_v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Aug 7, 2020
2 parents 019c407 + 9436fb4 commit 09e70bb
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 84 deletions.
12 changes: 6 additions & 6 deletions Documentation/filesystems/quota.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======================
Expand All @@ -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
http://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 <linux/quota.h>.
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 <linux/quota.h>. 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
Expand Down
2 changes: 1 addition & 1 deletion Documentation/filesystems/udf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/
55 changes: 27 additions & 28 deletions fs/ext2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -394,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;
Expand All @@ -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(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)
Expand Down
8 changes: 4 additions & 4 deletions fs/ext2/ext2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -738,7 +737,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 *);
Expand Down
3 changes: 2 additions & 1 deletion fs/ext2/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -528,7 +529,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
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);

Expand Down
7 changes: 2 additions & 5 deletions fs/ext2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
39 changes: 24 additions & 15 deletions fs/ext2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, uns
{
struct inode * inode;
ino_t ino;
int res;

if (dentry->d_name.len > EXT2_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);

ino = ext2_inode_by_name(dir, &dentry->d_name);
inode = NULL;
if (ino) {
res = ext2_inode_by_name(dir, &dentry->d_name, &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__,
Expand All @@ -78,9 +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);
unsigned long ino = ext2_inode_by_name(d_inode(child), &dotdot);
if (!ino)
return ERR_PTR(-ENOENT);
ino_t ino;
int res;

res = ext2_inode_by_name(d_inode(child), &dotdot, &ino);
if (res)
return ERR_PTR(res);

return d_obtain_alias(ext2_iget(child->d_sb, ino));
}

Expand Down Expand Up @@ -274,9 +282,9 @@ static int ext2_unlink(struct inode * dir, struct dentry *dentry)
if (err)
goto out;

de = ext2_find_entry (dir, &dentry->d_name, &page);
if (!de) {
err = -ENOENT;
de = ext2_find_entry(dir, &dentry->d_name, &page);
if (IS_ERR(de)) {
err = PTR_ERR(de);
goto out;
}

Expand Down Expand Up @@ -330,9 +338,9 @@ 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);
if (!old_de) {
err = -ENOENT;
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;
}

Expand All @@ -351,10 +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 (!new_de)
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;
}
ext2_set_link(new_dir, new_de, new_page, old_inode, 1);
new_inode->i_ctime = current_time(new_inode);
if (dir_de)
Expand Down
10 changes: 1 addition & 9 deletions fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"},
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -588,7 +591,6 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
/* 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. */
Expand All @@ -600,6 +602,8 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
cpu_to_le16(o + size);
last = EXT2_XATTR_NEXT(last);
}

here->e_value_offs = 0;
}
if (value == NULL) {
/* Remove the old name. */
Expand Down
2 changes: 1 addition & 1 deletion fs/quota/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
<http://www.tldp.org/docs.html#howto>, or the documentation provided
<https://www.tldp.org/docs.html#howto>, or the documentation provided
with the quota tools. Probably the quota support is only useful for
multi user systems. If unsure, say N.

Expand Down
8 changes: 4 additions & 4 deletions fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand All @@ -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 */
Expand All @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions fs/reiserfs/fix_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down
2 changes: 1 addition & 1 deletion fs/reiserfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <linux/time.h>
Expand Down
Loading

0 comments on commit 09e70bb

Please sign in to comment.