lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Sep 2016 12:14:04 +0200
From:   Richard Weinberger <richard@....at>
To:     Boris Brezillon <boris.brezillon@...e-electrons.com>,
        Artem Bityutskiy <dedekind1@...il.com>
Cc:     David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 11/17] UBI: simplify recover_peb() code

Boris,

On 05.09.2016 17:05, Boris Brezillon wrote:
> + * This function is called in case of a write failure and moves all good data
> + * from the potentially bad physical eraseblock to a good physical eraseblock.
> + * This function also writes the data which was not written due to the failure.
> + * Returns 0 in case of success, and a negative error code in case of failure.
> + * This function tries %UBI_IO_RETRIES before giving up.
> + */
> +static int recover_peb(struct ubi_device *ubi, int pnum, int vol_id, int lnum,
> +		       const void *buf, int offset, int len)
> +{
> +	int err, idx = vol_id2idx(ubi, vol_id), tries;
> +	struct ubi_volume *vol = ubi->volumes[idx];
> +	struct ubi_vid_hdr *vid_hdr;
> +
> +	vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS);
> +	if (!vid_hdr)
> +		return -ENOMEM;
> +
> +	for (tries = 0; tries <= UBI_IO_RETRIES; tries++) {
> +		err = try_recover_peb(vol, pnum, lnum, buf, offset, len,
> +				      vid_hdr);
> +		if (!err || err == -ENOSPC)
> +			break;

Why do you handle ENOSPC as fatal error? Since the loop is bound by UBI_IO_RETRIES
IMHO we can retry also upon ENOSPC.

Thanks,
//richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ