Skip to content

Commit efa5637

Browse files
committed
Merge tag 'upstream-4.9-rc3' of git://git.infradead.org/linux-ubifs
Pull ubi/ubifs fixes from Richard Weinberger: "This contains fixes for issues in both UBI and UBIFS: - A regression wrt overlayfs, introduced in -rc2. - An UBI issue, found by Dan Carpenter's static checker" * tag 'upstream-4.9-rc3' of git://git.infradead.org/linux-ubifs: ubifs: Fix regression in ubifs_readdir() ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap()
2 parents 2674235 + a00052a commit efa5637

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

drivers/mtd/ubi/fastmap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,11 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
707707
fmvhdr->vol_type,
708708
be32_to_cpu(fmvhdr->last_eb_bytes));
709709

710-
if (!av)
711-
goto fail_bad;
712-
if (PTR_ERR(av) == -EINVAL) {
713-
ubi_err(ubi, "volume (ID %i) already exists",
714-
fmvhdr->vol_id);
710+
if (IS_ERR(av)) {
711+
if (PTR_ERR(av) == -EEXIST)
712+
ubi_err(ubi, "volume (ID %i) already exists",
713+
fmvhdr->vol_id);
714+
715715
goto fail_bad;
716716
}
717717

fs/ubifs/dir.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,14 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
543543

544544
if (err != -ENOENT)
545545
ubifs_err(c, "cannot find next direntry, error %d", err);
546+
else
547+
/*
548+
* -ENOENT is a non-fatal error in this context, the TNC uses
549+
* it to indicate that the cursor moved past the current directory
550+
* and readdir() has to stop.
551+
*/
552+
err = 0;
553+
546554

547555
/* 2 is a special value indicating that there are no more direntries */
548556
ctx->pos = 2;

0 commit comments

Comments
 (0)