Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2019-03-20 11:14:01 +0000
committerFilipe Manana <fdmanana@suse.com>2019-03-20 11:14:01 +0000
commitdb613f3d4e08211f4f2861d96fb6e3db5866936c (patch)
tree6c6091fba2b6722399d175ac4e6b85d732a7b1d0
parent278fbe15c609daa9c708d53983178fe08cdb1f7b (diff)
btrfs: simplify IS_ERR/PTR_ERR checks (bsc#1126481).
-rw-r--r--patches.suse/btrfs-simplify-IS_ERR-PTR_ERR-checks.patch59
-rw-r--r--series.conf1
2 files changed, 60 insertions, 0 deletions
diff --git a/patches.suse/btrfs-simplify-IS_ERR-PTR_ERR-checks.patch b/patches.suse/btrfs-simplify-IS_ERR-PTR_ERR-checks.patch
new file mode 100644
index 0000000000..eaeb949fe1
--- /dev/null
+++ b/patches.suse/btrfs-simplify-IS_ERR-PTR_ERR-checks.patch
@@ -0,0 +1,59 @@
+From: Al Viro <viro@zeniv.linux.org.uk>
+Date: Sun, 29 Jul 2018 23:04:46 +0100
+Patch-mainline: 4.19
+Git-commit: 8d9e220ca0844bf75b98cb5b8e2c25d203c0d0f6
+References: bsc#1126481
+Subject: [PATCH] btrfs: simplify IS_ERR/PTR_ERR checks
+
+IS_ERR(p) && PTR_ERR(p) == n is a weird way to spell p == ERR_PTR(n).
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Reviewed-by: Nikolay Borisov <nborisov@suse.com>
+[ update changelog ]
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+---
+ fs/btrfs/transaction.c | 2 +-
+ fs/btrfs/tree-log.c | 5 ++---
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
+index 276249df791c..50e19d33e73e 100644
+--- a/fs/btrfs/transaction.c
++++ b/fs/btrfs/transaction.c
+@@ -718,7 +718,7 @@ btrfs_attach_transaction_barrier(struct btrfs_root *root)
+
+ trans = start_transaction(root, 0, TRANS_ATTACH,
+ BTRFS_RESERVE_NO_FLUSH, true);
+- if (IS_ERR(trans) && PTR_ERR(trans) == -ENOENT)
++ if (trans == ERR_PTR(-ENOENT))
+ btrfs_wait_for_commit(root->fs_info, 0);
+
+ return trans;
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
+index 8cd571f6747b..c1feff1ffceb 100644
+--- a/fs/btrfs/tree-log.c
++++ b/fs/btrfs/tree-log.c
+@@ -2223,7 +2223,7 @@ static noinline int check_item_in_log(struct btrfs_trans_handle *trans,
+ dir_key->offset,
+ name, name_len, 0);
+ }
+- if (!log_di || (IS_ERR(log_di) && PTR_ERR(log_di) == -ENOENT)) {
++ if (!log_di || log_di == ERR_PTR(-ENOENT)) {
+ btrfs_dir_item_key_to_cpu(eb, di, &location);
+ btrfs_release_path(path);
+ btrfs_release_path(log_path);
+@@ -5205,8 +5205,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
+ * we don't need to do more work nor fallback to
+ * a transaction commit.
+ */
+- if (IS_ERR(other_inode) &&
+- PTR_ERR(other_inode) == -ENOENT) {
++ if (other_inode == ERR_PTR(-ENOENT)) {
+ goto next_key;
+ } else if (IS_ERR(other_inode)) {
+ err = PTR_ERR(other_inode);
+--
+2.19.0
+
diff --git a/series.conf b/series.conf
index 091f670bef..2511fd7715 100644
--- a/series.conf
+++ b/series.conf
@@ -17863,6 +17863,7 @@
patches.suse/0016-btrfs-tree-checker-Detect-invalid-and-empty-essentia.patch
patches.suse/btrfs-fix-mount-failure-after-fsync-due-to-hard-link.patch
patches.suse/btrfs-fix-send-failure-when-root-has-deleted-files-s.patch
+ patches.suse/btrfs-simplify-IS_ERR-PTR_ERR-checks.patch
patches.suse/0017-btrfs-Check-that-each-block-group-has-corresponding-.patch
patches.suse/0018-btrfs-Verify-that-every-chunk-has-corresponding-bloc.patch
patches.suse/0019-btrfs-Introduce-mount-time-chunk-dev-extent-mapping-.patch