forked from luck/tmp_suning_uos_patched
This pull request contains the following bug fixes for UBI and UBIFS:
- Correctly set next cursor for detailed_erase_block_info debugfs file - Don't use crypto_shash_descsize() for digest size in UBIFS - Remove broken lazytime support from UBIFS -----BEGIN PGP SIGNATURE----- iQJKBAABCAA0FiEEdgfidid8lnn52cLTZvlZhesYu8EFAl7Fh08WHHJpY2hhcmRA c2lnbWEtc3Rhci5hdAAKCRBm+VmF6xi7wW2WD/428LjXh+24Y3rekfnCRXG5w+es yITAfhOmNuzn2vjS1UvCD0HsoBaS/LYbjuaceoyfXF9BG5mcrRTjFH7dVEEWFGDZ YeRvBFkyt4xBEJtrY/6MW35KPRtnCp4Jau9HR9M5RCcQ5xzOeGtw0r/JMdZe56Av zc2mLnZag1x5NyS4TvS30nCgj5pxVbO2bdAkyULJwBfPYs0C3TKeIul/4vjRi+57 PjyIUSR7CxpsOJde0tMjDvf23ewn1IUEW+YnewP1qk36ijRw1M6C90ERr4CU9BM5 YTEfjsxAheCItSf8r+BC70gaPBQPADtvHzPFqs9yNMSsLHYdOkkvqT8Bpwisj76d 1zL45DjZZ8UxC3HfSMFPl/dYDWvfddpffNwrimeltoAzzejI/Wk8AX0VqH1IQ3Z1 zDbz0ixP21ADATvrHUxr7UsoeEU9havGV+2sg+4wSU1aLtKIZUTjceizjkTN+9oB ntHLuv6cS2iop22iSbJGClOv2TjpBlGQNwMDQ7TdD1a0QqxTSPRiguMmf/mDpQa/ MgQGAO6xS5NKRNiEbifniiCugLqpUQBHBPyn+q+4unmfK5sPzzLdpb3vpc0XNmbm WgwfuMZdfmK0jO27P1/MRG6LUGxXKh5arsi6JrUJVIsdxzV3bdc2xBjkUFOOS/tH W7fn4QS+WmbPVm09Jg== =eCh7 -----END PGP SIGNATURE----- Merge tag 'for-linus-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull UBI and UBIFS fixes from Richard Weinberger: - Correctly set next cursor for detailed_erase_block_info debugfs file - Don't use crypto_shash_descsize() for digest size in UBIFS - Remove broken lazytime support from UBIFS * tag 'for-linus-5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubi: Fix seq_file usage in detailed_erase_block_info debugfs file ubifs: fix wrong use of crypto_shash_descsize() ubifs: remove broken lazytime support
This commit is contained in:
commit
fea371e259
|
@ -393,9 +393,6 @@ static void *eraseblk_count_seq_start(struct seq_file *s, loff_t *pos)
|
|||
{
|
||||
struct ubi_device *ubi = s->private;
|
||||
|
||||
if (*pos == 0)
|
||||
return SEQ_START_TOKEN;
|
||||
|
||||
if (*pos < ubi->peb_count)
|
||||
return pos;
|
||||
|
||||
|
@ -409,8 +406,6 @@ static void *eraseblk_count_seq_next(struct seq_file *s, void *v, loff_t *pos)
|
|||
{
|
||||
struct ubi_device *ubi = s->private;
|
||||
|
||||
if (v == SEQ_START_TOKEN)
|
||||
return pos;
|
||||
(*pos)++;
|
||||
|
||||
if (*pos < ubi->peb_count)
|
||||
|
@ -432,11 +427,8 @@ static int eraseblk_count_seq_show(struct seq_file *s, void *iter)
|
|||
int err;
|
||||
|
||||
/* If this is the start, print a header */
|
||||
if (iter == SEQ_START_TOKEN) {
|
||||
seq_puts(s,
|
||||
"physical_block_number\terase_count\tblock_status\tread_status\n");
|
||||
return 0;
|
||||
}
|
||||
if (*block_number == 0)
|
||||
seq_puts(s, "physical_block_number\terase_count\n");
|
||||
|
||||
err = ubi_io_is_bad(ubi, *block_number);
|
||||
if (err)
|
||||
|
|
|
@ -79,13 +79,9 @@ int ubifs_prepare_auth_node(struct ubifs_info *c, void *node,
|
|||
struct shash_desc *inhash)
|
||||
{
|
||||
struct ubifs_auth_node *auth = node;
|
||||
u8 *hash;
|
||||
u8 hash[UBIFS_HASH_ARR_SZ];
|
||||
int err;
|
||||
|
||||
hash = kmalloc(crypto_shash_descsize(c->hash_tfm), GFP_NOFS);
|
||||
if (!hash)
|
||||
return -ENOMEM;
|
||||
|
||||
{
|
||||
SHASH_DESC_ON_STACK(hash_desc, c->hash_tfm);
|
||||
|
||||
|
@ -94,21 +90,16 @@ int ubifs_prepare_auth_node(struct ubifs_info *c, void *node,
|
|||
|
||||
err = crypto_shash_final(hash_desc, hash);
|
||||
if (err)
|
||||
goto out;
|
||||
return err;
|
||||
}
|
||||
|
||||
err = ubifs_hash_calc_hmac(c, hash, auth->hmac);
|
||||
if (err)
|
||||
goto out;
|
||||
return err;
|
||||
|
||||
auth->ch.node_type = UBIFS_AUTH_NODE;
|
||||
ubifs_prepare_node(c, auth, ubifs_auth_node_sz(c), 0);
|
||||
|
||||
err = 0;
|
||||
out:
|
||||
kfree(hash);
|
||||
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct shash_desc *ubifs_get_desc(const struct ubifs_info *c,
|
||||
|
|
|
@ -1375,7 +1375,6 @@ int ubifs_update_time(struct inode *inode, struct timespec64 *time,
|
|||
struct ubifs_info *c = inode->i_sb->s_fs_info;
|
||||
struct ubifs_budget_req req = { .dirtied_ino = 1,
|
||||
.dirtied_ino_d = ALIGN(ui->data_len, 8) };
|
||||
int iflags = I_DIRTY_TIME;
|
||||
int err, release;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_UBIFS_ATIME_SUPPORT))
|
||||
|
@ -1393,11 +1392,8 @@ int ubifs_update_time(struct inode *inode, struct timespec64 *time,
|
|||
if (flags & S_MTIME)
|
||||
inode->i_mtime = *time;
|
||||
|
||||
if (!(inode->i_sb->s_flags & SB_LAZYTIME))
|
||||
iflags |= I_DIRTY_SYNC;
|
||||
|
||||
release = ui->dirty;
|
||||
__mark_inode_dirty(inode, iflags);
|
||||
__mark_inode_dirty(inode, I_DIRTY_SYNC);
|
||||
mutex_unlock(&ui->ui_mutex);
|
||||
if (release)
|
||||
ubifs_release_budget(c, &req);
|
||||
|
|
|
@ -601,18 +601,12 @@ static int authenticate_sleb(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
|
|||
struct ubifs_scan_node *snod;
|
||||
int n_nodes = 0;
|
||||
int err;
|
||||
u8 *hash, *hmac;
|
||||
u8 hash[UBIFS_HASH_ARR_SZ];
|
||||
u8 hmac[UBIFS_HMAC_ARR_SZ];
|
||||
|
||||
if (!ubifs_authenticated(c))
|
||||
return sleb->nodes_cnt;
|
||||
|
||||
hash = kmalloc(crypto_shash_descsize(c->hash_tfm), GFP_NOFS);
|
||||
hmac = kmalloc(c->hmac_desc_len, GFP_NOFS);
|
||||
if (!hash || !hmac) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
list_for_each_entry(snod, &sleb->nodes, list) {
|
||||
|
||||
n_nodes++;
|
||||
|
@ -662,9 +656,6 @@ static int authenticate_sleb(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
|
|||
err = 0;
|
||||
}
|
||||
out:
|
||||
kfree(hash);
|
||||
kfree(hmac);
|
||||
|
||||
return err ? err : n_nodes - n_not_auth;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user