Commit 5cb08b62 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'jfs-6.18' of github.com:kleikamp/linux-shaggy

Pull jfs updates from Dave Kleikamp:
 "A few fixes and cleanups for JFS"

* tag 'jfs-6.18' of github.com:kleikamp/linux-shaggy:
  jfs: replace hardcoded magic number with DTPAGEMAXSLOT constant
  JFS: Remove redundant 0 value initialization
  JFS: Remove unnecessary parentheses
  jfs: fix uninitialized waitqueue in transaction manager
  jfs: Verify inode mode when loading from disk
parents 65989db7 cafc6679
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -59,9 +59,15 @@ struct inode *jfs_iget(struct super_block *sb, unsigned long ino)
			 */
			inode->i_link[inode->i_size] = '\0';
		}
	} else {
	} else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) ||
		   S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
		inode->i_op = &jfs_file_inode_operations;
		init_special_inode(inode, inode->i_mode, inode->i_rdev);
	} else {
		printk(KERN_DEBUG "JFS: Invalid file type 0%04o for inode %lu.\n",
		       inode->i_mode, inode->i_ino);
		iget_failed(inode);
		return ERR_PTR(-EIO);
	}
	unlock_new_inode(inode);
	return inode;
+2 −2
Original line number Diff line number Diff line
@@ -2903,7 +2903,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
		stbl = DT_GETSTBL(p);

		for (i = index; i < p->header.nextindex; i++) {
			if (stbl[i] < 0 || stbl[i] > 127) {
			if (stbl[i] < 0 || stbl[i] >= DTPAGEMAXSLOT) {
				jfs_err("JFS: Invalid stbl[%d] = %d for inode %ld, block = %lld",
					i, stbl[i], (long)ip->i_ino, (long long)bn);
				free_page(dirent_buf);
@@ -3108,7 +3108,7 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
		/* get the leftmost entry */
		stbl = DT_GETSTBL(p);

		if (stbl[0] < 0 || stbl[0] > 127) {
		if (stbl[0] < 0 || stbl[0] >= DTPAGEMAXSLOT) {
			DT_PUTPAGE(mp);
			jfs_error(ip->i_sb, "stbl[0] out of bound\n");
			return -EIO;
+0 −1
Original line number Diff line number Diff line
@@ -1199,7 +1199,6 @@ static int open_dummy_log(struct super_block *sb)
		init_waitqueue_head(&dummy_log->syncwait);
		dummy_log->no_integrity = 1;
		/* Make up some stuff */
		dummy_log->base = 0;
		dummy_log->size = 1024;
		rc = lmLogInit(dummy_log);
		if (rc) {
+5 −5
Original line number Diff line number Diff line
@@ -325,13 +325,13 @@ static int chkSuper(struct super_block *sb)
	if ((j_sb->s_flag & cpu_to_le32(JFS_BAD_SAIT)) !=
	    cpu_to_le32(JFS_BAD_SAIT)) {
		expected_AIM_bytesize = 2 * PSIZE;
		AIM_bytesize = lengthPXD(&(j_sb->s_aim2)) * bsize;
		AIM_bytesize = lengthPXD(&j_sb->s_aim2) * bsize;
		expected_AIT_bytesize = 4 * PSIZE;
		AIT_bytesize = lengthPXD(&(j_sb->s_ait2)) * bsize;
		AIM_byte_addr = addressPXD(&(j_sb->s_aim2)) * bsize;
		AIT_byte_addr = addressPXD(&(j_sb->s_ait2)) * bsize;
		AIT_bytesize = lengthPXD(&j_sb->s_ait2) * bsize;
		AIM_byte_addr = addressPXD(&j_sb->s_aim2) * bsize;
		AIT_byte_addr = addressPXD(&j_sb->s_ait2) * bsize;
		byte_addr_diff0 = AIT_byte_addr - AIM_byte_addr;
		fsckwsp_addr = addressPXD(&(j_sb->s_fsckpxd)) * bsize;
		fsckwsp_addr = addressPXD(&j_sb->s_fsckpxd) * bsize;
		byte_addr_diff1 = fsckwsp_addr - AIT_byte_addr;
		if ((AIM_bytesize != expected_AIM_bytesize) ||
		    (AIT_bytesize != expected_AIT_bytesize) ||
+5 −4
Original line number Diff line number Diff line
@@ -272,14 +272,15 @@ int txInit(void)
	if (TxBlock == NULL)
		return -ENOMEM;

	for (k = 1; k < nTxBlock - 1; k++) {
		TxBlock[k].next = k + 1;
	for (k = 0; k < nTxBlock; k++) {
		init_waitqueue_head(&TxBlock[k].gcwait);
		init_waitqueue_head(&TxBlock[k].waitor);
	}

	for (k = 1; k < nTxBlock - 1; k++) {
		TxBlock[k].next = k + 1;
	}
	TxBlock[k].next = 0;
	init_waitqueue_head(&TxBlock[k].gcwait);
	init_waitqueue_head(&TxBlock[k].waitor);

	TxAnchor.freetid = 1;
	init_waitqueue_head(&TxAnchor.freewait);