forked from openwrt/openwrt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refreshed all patches. Added new patch: - 192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch This fixes a bug introduced in upstream 4.14.68 which caused targets using ubifs to produce file-system errors on boot, rendering them useless. Compile-tested on: cns3xxx, imx6, x86_64 Runtime-tested on: cns3xxx, imx6, x86_64 Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
- Loading branch information
Koen Vandeputte
committed
Sep 17, 2018
1 parent
784d7f0
commit 0cda4af
Showing
12 changed files
with
116 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
target/linux/ath79/patches-4.14/404-mtd-cybertan-trx-parser.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...t/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
From a99708737f566c70651015332e89d0d3b1eb5529 Mon Sep 17 00:00:00 2001 | ||
From: Koen Vandeputte <koen.vandeputte@ncentric.com> | ||
Date: Mon, 17 Sep 2018 10:13:09 +0200 | ||
Subject: [PATCH] Revert "ubifs: xattr: Don't operate on deleted inodes" | ||
|
||
This reverts commit 8a23348d76a1e7716da6e76383281ac82fc071cf. | ||
|
||
UBIFS wants to assert that xattr operations are only issued on files | ||
with positive link count. The said patch made this operations return | ||
-ENOENT for unlinked files such that the asserts will no longer trigger. | ||
This was wrong since xattr operations are perfectly fine on unlinked | ||
files. | ||
Instead the assertions need to be fixed/removed. | ||
|
||
Fixes: 11a6fc3dc743 ("ubifs: xattr: Don't operate on deleted inodes") | ||
Reported-by: Koen Vandeputte <koen.vandeputte@ncentric.com> | ||
Signed-off-by: Richard Weinberger <richard@nod.at> | ||
--- | ||
fs/ubifs/xattr.c | 24 ------------------------ | ||
1 file changed, 24 deletions(-) | ||
|
||
--- a/fs/ubifs/xattr.c | ||
+++ b/fs/ubifs/xattr.c | ||
@@ -152,12 +152,6 @@ static int create_xattr(struct ubifs_inf | ||
ui->data_len = size; | ||
|
||
mutex_lock(&host_ui->ui_mutex); | ||
- | ||
- if (!host->i_nlink) { | ||
- err = -ENOENT; | ||
- goto out_noent; | ||
- } | ||
- | ||
host->i_ctime = current_time(host); | ||
host_ui->xattr_cnt += 1; | ||
host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); | ||
@@ -189,7 +183,6 @@ out_cancel: | ||
host_ui->xattr_size -= CALC_XATTR_BYTES(size); | ||
host_ui->xattr_names -= fname_len(nm); | ||
host_ui->flags &= ~UBIFS_CRYPT_FL; | ||
-out_noent: | ||
mutex_unlock(&host_ui->ui_mutex); | ||
out_free: | ||
make_bad_inode(inode); | ||
@@ -241,12 +234,6 @@ static int change_xattr(struct ubifs_inf | ||
mutex_unlock(&ui->ui_mutex); | ||
|
||
mutex_lock(&host_ui->ui_mutex); | ||
- | ||
- if (!host->i_nlink) { | ||
- err = -ENOENT; | ||
- goto out_noent; | ||
- } | ||
- | ||
host->i_ctime = current_time(host); | ||
host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); | ||
host_ui->xattr_size += CALC_XATTR_BYTES(size); | ||
@@ -268,7 +255,6 @@ static int change_xattr(struct ubifs_inf | ||
out_cancel: | ||
host_ui->xattr_size -= CALC_XATTR_BYTES(size); | ||
host_ui->xattr_size += CALC_XATTR_BYTES(old_size); | ||
-out_noent: | ||
mutex_unlock(&host_ui->ui_mutex); | ||
make_bad_inode(inode); | ||
out_free: | ||
@@ -497,12 +483,6 @@ static int remove_xattr(struct ubifs_inf | ||
return err; | ||
|
||
mutex_lock(&host_ui->ui_mutex); | ||
- | ||
- if (!host->i_nlink) { | ||
- err = -ENOENT; | ||
- goto out_noent; | ||
- } | ||
- | ||
host->i_ctime = current_time(host); | ||
host_ui->xattr_cnt -= 1; | ||
host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); | ||
@@ -522,7 +502,6 @@ out_cancel: | ||
host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); | ||
host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); | ||
host_ui->xattr_names += fname_len(nm); | ||
-out_noent: | ||
mutex_unlock(&host_ui->ui_mutex); | ||
ubifs_release_budget(c, &req); | ||
make_bad_inode(inode); | ||
@@ -562,9 +541,6 @@ static int ubifs_xattr_remove(struct ino | ||
|
||
ubifs_assert(inode_is_locked(host)); | ||
|
||
- if (!host->i_nlink) | ||
- return -ENOENT; | ||
- | ||
if (fname_len(&nm) > UBIFS_MAX_NLEN) | ||
return -ENAMETOOLONG; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters