summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 14:37:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 14:37:27 -0400
commitb8cac3cd24c19113982f929c65c50ce99d4cb83f (patch)
tree309fa0efe3fcd0f16a3bd0ff0d6ac19544b15ef1
parent9f2e3a53f7ec9ef55e9d01bc29a6285d291c151e (diff)
parenta5fdd713d256887b5f012608701149fa939e5645 (diff)
Merge tag 'jfs-5.2' of git://github.com/kleikamp/linux-shaggy
Pull jfs updates from Dave Kleikamp: "Several minor jfs fixes" * tag 'jfs-5.2' of git://github.com/kleikamp/linux-shaggy: jfs: fix bogus variable self-initialization fs/jfs: Switch to use new generic UUID API jfs: compare old and new mode before setting update_mode flag jfs: remove incorrect comment in jfs_superblock jfs: fix spelling mistake, EACCESS -> EACCES
-rw-r--r--fs/jfs/acl.c3
-rw-r--r--fs/jfs/jfs_incore.h6
-rw-r--r--fs/jfs/jfs_logmgr.c18
-rw-r--r--fs/jfs/jfs_logmgr.h10
-rw-r--r--fs/jfs/jfs_mount.c4
-rw-r--r--fs/jfs/jfs_superblock.h8
-rw-r--r--fs/jfs/jfs_txnmgr.c3
-rw-r--r--fs/jfs/namei.c2
-rw-r--r--fs/jfs/super.c8
9 files changed, 33 insertions, 29 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 8c06a6ea862d..ebb299003a5b 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -117,7 +117,8 @@ int jfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
117 rc = posix_acl_update_mode(inode, &mode, &acl); 117 rc = posix_acl_update_mode(inode, &mode, &acl);
118 if (rc) 118 if (rc)
119 goto end_tx; 119 goto end_tx;
120 update_mode = 1; 120 if (mode != inode->i_mode)
121 update_mode = 1;
121 } 122 }
122 rc = __jfs_set_acl(tid, inode, type, acl); 123 rc = __jfs_set_acl(tid, inode, type, acl);
123 if (!rc) { 124 if (!rc) {
diff --git a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h
index 912a3af2393e..340eb8e4f716 100644
--- a/fs/jfs/jfs_incore.h
+++ b/fs/jfs/jfs_incore.h
@@ -23,6 +23,8 @@
23#include <linux/rwsem.h> 23#include <linux/rwsem.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26#include <linux/uuid.h>
27
26#include "jfs_types.h" 28#include "jfs_types.h"
27#include "jfs_xtree.h" 29#include "jfs_xtree.h"
28#include "jfs_dtree.h" 30#include "jfs_dtree.h"
@@ -178,8 +180,8 @@ struct jfs_sb_info {
178 pxd_t logpxd; /* pxd describing log */ 180 pxd_t logpxd; /* pxd describing log */
179 pxd_t fsckpxd; /* pxd describing fsck wkspc */ 181 pxd_t fsckpxd; /* pxd describing fsck wkspc */
180 pxd_t ait2; /* pxd describing AIT copy */ 182 pxd_t ait2; /* pxd describing AIT copy */
181 char uuid[16]; /* 128-bit uuid for volume */ 183 uuid_t uuid; /* 128-bit uuid for volume */
182 char loguuid[16]; /* 128-bit uuid for log */ 184 uuid_t loguuid; /* 128-bit uuid for log */
183 /* 185 /*
184 * commit_state is used for synchronization of the jfs_commit 186 * commit_state is used for synchronization of the jfs_commit
185 * threads. It is protected by LAZY_LOCK(). 187 * threads. It is protected by LAZY_LOCK().
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 6b68df395892..4c77b808020b 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1092,8 +1092,7 @@ int lmLogOpen(struct super_block *sb)
1092 mutex_lock(&jfs_log_mutex); 1092 mutex_lock(&jfs_log_mutex);
1093 list_for_each_entry(log, &jfs_external_logs, journal_list) { 1093 list_for_each_entry(log, &jfs_external_logs, journal_list) {
1094 if (log->bdev->bd_dev == sbi->logdev) { 1094 if (log->bdev->bd_dev == sbi->logdev) {
1095 if (memcmp(log->uuid, sbi->loguuid, 1095 if (!uuid_equal(&log->uuid, &sbi->loguuid)) {
1096 sizeof(log->uuid))) {
1097 jfs_warn("wrong uuid on JFS journal"); 1096 jfs_warn("wrong uuid on JFS journal");
1098 mutex_unlock(&jfs_log_mutex); 1097 mutex_unlock(&jfs_log_mutex);
1099 return -EINVAL; 1098 return -EINVAL;
@@ -1130,7 +1129,7 @@ int lmLogOpen(struct super_block *sb)
1130 } 1129 }
1131 1130
1132 log->bdev = bdev; 1131 log->bdev = bdev;
1133 memcpy(log->uuid, sbi->loguuid, sizeof(log->uuid)); 1132 uuid_copy(&log->uuid, &sbi->loguuid);
1134 1133
1135 /* 1134 /*
1136 * initialize log: 1135 * initialize log:
@@ -1336,7 +1335,7 @@ int lmLogInit(struct jfs_log * log)
1336 jfs_info("lmLogInit: inline log:0x%p base:0x%Lx size:0x%x", 1335 jfs_info("lmLogInit: inline log:0x%p base:0x%Lx size:0x%x",
1337 log, (unsigned long long)log->base, log->size); 1336 log, (unsigned long long)log->base, log->size);
1338 } else { 1337 } else {
1339 if (memcmp(logsuper->uuid, log->uuid, 16)) { 1338 if (!uuid_equal(&logsuper->uuid, &log->uuid)) {
1340 jfs_warn("wrong uuid on JFS log device"); 1339 jfs_warn("wrong uuid on JFS log device");
1341 goto errout20; 1340 goto errout20;
1342 } 1341 }
@@ -1732,7 +1731,7 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
1732 int i; 1731 int i;
1733 struct logsuper *logsuper; 1732 struct logsuper *logsuper;
1734 struct lbuf *bpsuper; 1733 struct lbuf *bpsuper;
1735 char *uuid = sbi->uuid; 1734 uuid_t *uuid = &sbi->uuid;
1736 1735
1737 /* 1736 /*
1738 * insert/remove file system device to log active file system list. 1737 * insert/remove file system device to log active file system list.
@@ -1743,8 +1742,8 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
1743 logsuper = (struct logsuper *) bpsuper->l_ldata; 1742 logsuper = (struct logsuper *) bpsuper->l_ldata;
1744 if (activate) { 1743 if (activate) {
1745 for (i = 0; i < MAX_ACTIVE; i++) 1744 for (i = 0; i < MAX_ACTIVE; i++)
1746 if (!memcmp(logsuper->active[i].uuid, NULL_UUID, 16)) { 1745 if (uuid_is_null(&logsuper->active[i].uuid)) {
1747 memcpy(logsuper->active[i].uuid, uuid, 16); 1746 uuid_copy(&logsuper->active[i].uuid, uuid);
1748 sbi->aggregate = i; 1747 sbi->aggregate = i;
1749 break; 1748 break;
1750 } 1749 }
@@ -1755,8 +1754,9 @@ static int lmLogFileSystem(struct jfs_log * log, struct jfs_sb_info *sbi,
1755 } 1754 }
1756 } else { 1755 } else {
1757 for (i = 0; i < MAX_ACTIVE; i++) 1756 for (i = 0; i < MAX_ACTIVE; i++)
1758 if (!memcmp(logsuper->active[i].uuid, uuid, 16)) { 1757 if (uuid_equal(&logsuper->active[i].uuid, uuid)) {
1759 memcpy(logsuper->active[i].uuid, NULL_UUID, 16); 1758 uuid_copy(&logsuper->active[i].uuid,
1759 &uuid_null);
1760 break; 1760 break;
1761 } 1761 }
1762 if (i == MAX_ACTIVE) { 1762 if (i == MAX_ACTIVE) {
diff --git a/fs/jfs/jfs_logmgr.h b/fs/jfs/jfs_logmgr.h
index e38c21598850..870fc22360e7 100644
--- a/fs/jfs/jfs_logmgr.h
+++ b/fs/jfs/jfs_logmgr.h
@@ -19,6 +19,8 @@
19#ifndef _H_JFS_LOGMGR 19#ifndef _H_JFS_LOGMGR
20#define _H_JFS_LOGMGR 20#define _H_JFS_LOGMGR
21 21
22#include <linux/uuid.h>
23
22#include "jfs_filsys.h" 24#include "jfs_filsys.h"
23#include "jfs_lock.h" 25#include "jfs_lock.h"
24 26
@@ -73,15 +75,13 @@ struct logsuper {
73 __le32 state; /* 4: state - see below */ 75 __le32 state; /* 4: state - see below */
74 76
75 __le32 end; /* 4: addr of last log record set by logredo */ 77 __le32 end; /* 4: addr of last log record set by logredo */
76 char uuid[16]; /* 16: 128-bit journal uuid */ 78 uuid_t uuid; /* 16: 128-bit journal uuid */
77 char label[16]; /* 16: journal label */ 79 char label[16]; /* 16: journal label */
78 struct { 80 struct {
79 char uuid[16]; 81 uuid_t uuid;
80 } active[MAX_ACTIVE]; /* 2048: active file systems list */ 82 } active[MAX_ACTIVE]; /* 2048: active file systems list */
81}; 83};
82 84
83#define NULL_UUID "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
84
85/* log flag: commit option (see jfs_filsys.h) */ 85/* log flag: commit option (see jfs_filsys.h) */
86 86
87/* log state */ 87/* log state */
@@ -410,7 +410,7 @@ struct jfs_log {
410 spinlock_t synclock; /* 4: synclist lock */ 410 spinlock_t synclock; /* 4: synclist lock */
411 struct lbuf *wqueue; /* 4: log pageout queue */ 411 struct lbuf *wqueue; /* 4: log pageout queue */
412 int count; /* 4: count */ 412 int count; /* 4: count */
413 char uuid[16]; /* 16: 128-bit uuid of log device */ 413 uuid_t uuid; /* 16: 128-bit uuid of log device */
414 414
415 int no_integrity; /* 3: flag to disable journaling to disk */ 415 int no_integrity; /* 3: flag to disable journaling to disk */
416}; 416};
diff --git a/fs/jfs/jfs_mount.c b/fs/jfs/jfs_mount.c
index d8658607bf46..c9c1f16b93df 100644
--- a/fs/jfs/jfs_mount.c
+++ b/fs/jfs/jfs_mount.c
@@ -389,8 +389,8 @@ static int chkSuper(struct super_block *sb)
389 sbi->logpxd = j_sb->s_logpxd; 389 sbi->logpxd = j_sb->s_logpxd;
390 else { 390 else {
391 sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev)); 391 sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev));
392 memcpy(sbi->uuid, j_sb->s_uuid, sizeof(sbi->uuid)); 392 uuid_copy(&sbi->uuid, &j_sb->s_uuid);
393 memcpy(sbi->loguuid, j_sb->s_loguuid, sizeof(sbi->uuid)); 393 uuid_copy(&sbi->loguuid, &j_sb->s_loguuid);
394 } 394 }
395 sbi->fsckpxd = j_sb->s_fsckpxd; 395 sbi->fsckpxd = j_sb->s_fsckpxd;
396 sbi->ait2 = j_sb->s_ait2; 396 sbi->ait2 = j_sb->s_ait2;
diff --git a/fs/jfs/jfs_superblock.h b/fs/jfs/jfs_superblock.h
index 04847b8d3070..eb03de7fa925 100644
--- a/fs/jfs/jfs_superblock.h
+++ b/fs/jfs/jfs_superblock.h
@@ -18,6 +18,8 @@
18#ifndef _H_JFS_SUPERBLOCK 18#ifndef _H_JFS_SUPERBLOCK
19#define _H_JFS_SUPERBLOCK 19#define _H_JFS_SUPERBLOCK
20 20
21#include <linux/uuid.h>
22
21/* 23/*
22 * make the magic number something a human could read 24 * make the magic number something a human could read
23 */ 25 */
@@ -98,11 +100,9 @@ struct jfs_superblock {
98 __le64 s_xsize; /* 8: extendfs s_size */ 100 __le64 s_xsize; /* 8: extendfs s_size */
99 pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */ 101 pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */
100 pxd_t s_xlogpxd; /* 8: extendfs logpxd */ 102 pxd_t s_xlogpxd; /* 8: extendfs logpxd */
101 /* - 128 byte boundary - */ 103 uuid_t s_uuid; /* 16: 128-bit uuid for volume */
102
103 char s_uuid[16]; /* 16: 128-bit uuid for volume */
104 char s_label[16]; /* 16: volume label */ 104 char s_label[16]; /* 16: volume label */
105 char s_loguuid[16]; /* 16: 128-bit uuid for log device */ 105 uuid_t s_loguuid; /* 16: 128-bit uuid for log device */
106 106
107}; 107};
108 108
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index a5663cb621d8..78789c5ed36b 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -1928,8 +1928,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
1928 * header ? 1928 * header ?
1929 */ 1929 */
1930 if (tlck->type & tlckTRUNCATE) { 1930 if (tlck->type & tlckTRUNCATE) {
1931 /* This odd declaration suppresses a bogus gcc warning */ 1931 pxd_t pxd; /* truncated extent of xad */
1932 pxd_t pxd = pxd; /* truncated extent of xad */
1933 int twm; 1932 int twm;
1934 1933
1935 /* 1934 /*
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 14528c0ffe63..fa719a1553b6 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -203,7 +203,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode,
203 * RETURN: Errors from subroutines 203 * RETURN: Errors from subroutines
204 * 204 *
205 * note: 205 * note:
206 * EACCESS: user needs search+write permission on the parent directory 206 * EACCES: user needs search+write permission on the parent directory
207 */ 207 */
208static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode) 208static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode)
209{ 209{
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 9454831bbd71..8f78fa374242 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -156,9 +156,11 @@ static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
156 buf->f_files = maxinodes; 156 buf->f_files = maxinodes;
157 buf->f_ffree = maxinodes - (atomic_read(&imap->im_numinos) - 157 buf->f_ffree = maxinodes - (atomic_read(&imap->im_numinos) -
158 atomic_read(&imap->im_numfree)); 158 atomic_read(&imap->im_numfree));
159 buf->f_fsid.val[0] = (u32)crc32_le(0, sbi->uuid, sizeof(sbi->uuid)/2); 159 buf->f_fsid.val[0] = crc32_le(0, (char *)&sbi->uuid,
160 buf->f_fsid.val[1] = (u32)crc32_le(0, sbi->uuid + sizeof(sbi->uuid)/2, 160 sizeof(sbi->uuid)/2);
161 sizeof(sbi->uuid)/2); 161 buf->f_fsid.val[1] = crc32_le(0,
162 (char *)&sbi->uuid + sizeof(sbi->uuid)/2,
163 sizeof(sbi->uuid)/2);
162 164
163 buf->f_namelen = JFS_NAME_MAX; 165 buf->f_namelen = JFS_NAME_MAX;
164 return 0; 166 return 0;