All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
@ 2021-02-07  8:32 Yang Li
  2021-02-07 10:16   ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yang Li @ 2021-02-07  8:32 UTC (permalink / raw)
  To: shaggy; +Cc: jfs-discussion, linux-kernel, Yang Li

These functions always return '0' and no callers use the return value.
So make it a void function.

This eliminates the following coccicheck warning:
./fs/jfs/jfs_txnmgr.c:1365:5-7: Unneeded variable: "rc". Return "0" on
line 1414
./fs/jfs/jfs_txnmgr.c:1422:5-7: Unneeded variable: "rc". Return "0" on
line 1527

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---

Changes in v2
-turn functions forward references to void type.

 fs/jfs/jfs_txnmgr.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index dca8edd..5f54a4c 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -148,10 +148,10 @@ static inline void TXN_SLEEP_DROP_LOCK(wait_queue_head_t * event)
 /*
  * forward references
  */
-static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-		struct tlock * tlck, struct commit * cd);
-static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-		struct tlock * tlck);
+static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+		struct tlock *tlck, struct commit *cd);
+static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+		struct tlock *tlck);
 static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 		struct tlock * tlck);
 static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
@@ -159,8 +159,8 @@ static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 static void txAllocPMap(struct inode *ip, struct maplock * maplock,
 		struct tblock * tblk);
 static void txForce(struct tblock * tblk);
-static int txLog(struct jfs_log * log, struct tblock * tblk,
-		struct commit * cd);
+static void txLog(struct jfs_log *log, struct tblock *tblk,
+		struct commit *cd);
 static void txUpdateMap(struct tblock * tblk);
 static void txRelease(struct tblock * tblk);
 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
@@ -1365,9 +1365,8 @@ int txCommit(tid_t tid,		/* transaction identifier */
  *
  * RETURN :
  */
-static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
+static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
 {
-	int rc = 0;
 	struct inode *ip;
 	lid_t lid;
 	struct tlock *tlck;
@@ -1414,7 +1413,7 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
 		}
 	}
 
-	return rc;
+	return;
 }
 
 /*
@@ -1422,10 +1421,9 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
  *
  * function:	log inode tlock and format maplock to update bmap;
  */
-static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-		 struct tlock * tlck, struct commit * cd)
+static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+		 struct tlock *tlck, struct commit *cd)
 {
-	int rc = 0;
 	struct metapage *mp;
 	pxd_t *pxd;
 	struct pxd_lock *pxdlock;
@@ -1527,7 +1525,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 	}
 #endif				/* _JFS_WIP */
 
-	return rc;
+	return;
 }
 
 /*
@@ -1535,8 +1533,8 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
  *
  * function:	log data tlock
  */
-static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-	    struct tlock * tlck)
+static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+	    struct tlock *tlck)
 {
 	struct metapage *mp;
 	pxd_t *pxd;
@@ -1562,7 +1560,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 		metapage_homeok(mp);
 		discard_metapage(mp);
 		tlck->mp = NULL;
-		return 0;
+		return;
 	}
 
 	PXDaddress(pxd, mp->index);
@@ -1573,7 +1571,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 	/* mark page as homeward bound */
 	tlck->flag |= tlckWRITEPAGE;
 
-	return 0;
+	return;
 }
 
 /*
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
  2021-02-07  8:32 [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions Yang Li
@ 2021-02-07 10:16   ` kernel test robot
  2021-02-07 12:06   ` kernel test robot
  2021-02-08 15:05 ` Dave Kleikamp
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-02-07 10:16 UTC (permalink / raw)
  To: Yang Li, shaggy; +Cc: kbuild-all, jfs-discussion, linux-kernel, Yang Li

[-- Attachment #1: Type: text/plain, Size: 22442 bytes --]

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on shaggy/jfs-next]
[also build test ERROR on v5.11-rc6 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
base:   https://github.com/kleikamp/linux-shaggy jfs-next
config: i386-randconfig-s001-20210207 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        # https://github.com/0day-ci/linux/commit/1d4e3ad79325df64962835ecc11999b520ffbc80
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
        git checkout 1d4e3ad79325df64962835ecc11999b520ffbc80
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/jfs/jfs_txnmgr.c: In function 'txCommit':
>> fs/jfs/jfs_txnmgr.c:1259:10: error: void value not ignored as it ought to be
    1259 |  if ((rc = txLog(log, tblk, &cd)))
         |          ^


vim +1259 fs/jfs/jfs_txnmgr.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1084  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1085  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1086   *		transaction commit management
^1da177e4c3f41 Linus Torvalds    2005-04-16  1087   *		-----------------------------
^1da177e4c3f41 Linus Torvalds    2005-04-16  1088   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1089  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1090  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1091   * NAME:	txCommit()
^1da177e4c3f41 Linus Torvalds    2005-04-16  1092   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1093   * FUNCTION:	commit the changes to the objects specified in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1094   *		clist.  For journalled segments only the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1095   *		changes of the caller are committed, ie by tid.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1096   *		for non-journalled segments the data are flushed to
^1da177e4c3f41 Linus Torvalds    2005-04-16  1097   *		disk and then the change to the disk inode and indirect
^1da177e4c3f41 Linus Torvalds    2005-04-16  1098   *		blocks committed (so blocks newly allocated to the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1099   *		segment will be made a part of the segment atomically).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1100   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1101   *		all of the segments specified in clist must be in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1102   *		one file system. no more than 6 segments are needed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1103   *		to handle all unix svcs.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1104   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1105   *		if the i_nlink field (i.e. disk inode link count)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1106   *		is zero, and the type of inode is a regular file or
^1da177e4c3f41 Linus Torvalds    2005-04-16  1107   *		directory, or symbolic link , the inode is truncated
^1da177e4c3f41 Linus Torvalds    2005-04-16  1108   *		to zero length. the truncation is committed but the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1109   *		VM resources are unaffected until it is closed (see
^1da177e4c3f41 Linus Torvalds    2005-04-16  1110   *		iput and iclose).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1111   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1112   * PARAMETER:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1113   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1114   * RETURN:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1115   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1116   * serialization:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1117   *		on entry the inode lock on each segment is assumed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1118   *		to be held.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1119   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1120   * i/o error:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1121   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1122  int txCommit(tid_t tid,		/* transaction identifier */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1123  	     int nip,		/* number of inodes to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1124  	     struct inode **iplist,	/* list of inode to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1125  	     int flag)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1126  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1127  	int rc = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1128  	struct commit cd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1129  	struct jfs_log *log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1130  	struct tblock *tblk;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1131  	struct lrd *lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1132  	struct inode *ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1133  	struct jfs_inode_info *jfs_ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1134  	int k, n;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1135  	ino_t top;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1136  	struct super_block *sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1137  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1138  	jfs_info("txCommit, tid = %d, flag = %d", tid, flag);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1139  	/* is read-only file system ? */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1140  	if (isReadOnly(iplist[0])) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1141  		rc = -EROFS;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1142  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1143  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1144  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1145  	sb = cd.sb = iplist[0]->i_sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1146  	cd.tid = tid;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1147  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1148  	if (tid == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1149  		tid = txBegin(sb, 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1150  	tblk = tid_to_tblock(tid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1151  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1152  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1153  	 * initialize commit structure
^1da177e4c3f41 Linus Torvalds    2005-04-16  1154  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1155  	log = JFS_SBI(sb)->log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1156  	cd.log = log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1157  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1158  	/* initialize log record descriptor in commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1159  	lrd = &cd.lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1160  	lrd->logtid = cpu_to_le32(tblk->logtid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1161  	lrd->backchain = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1162  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1163  	tblk->xflag |= flag;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1164  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1165  	if ((flag & (COMMIT_FORCE | COMMIT_SYNC)) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1166  		tblk->xflag |= COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1167  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1168  	 *	prepare non-journaled objects for commit
^1da177e4c3f41 Linus Torvalds    2005-04-16  1169  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1170  	 * flush data pages of non-journaled file
^1da177e4c3f41 Linus Torvalds    2005-04-16  1171  	 * to prevent the file getting non-initialized disk blocks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1172  	 * in case of crash.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1173  	 * (new blocks - )
^1da177e4c3f41 Linus Torvalds    2005-04-16  1174  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1175  	cd.iplist = iplist;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1176  	cd.nip = nip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1177  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1178  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1179  	 *	acquire transaction lock on (on-disk) inodes
^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  	 * update on-disk inode from in-memory inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  	 * acquiring transaction locks for AFTER records
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  	 * on the on-disk inode of file object
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	 * sort the inodes array by inode number in descending order
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  	 * to prevent deadlock when acquiring transaction lock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	 * of on-disk inodes on multiple on-disk inode pages by
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  	 * multiple concurrent transactions
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		top = (cd.iplist[k])->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		for (n = k + 1; n < cd.nip; n++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			ip = cd.iplist[n];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  			if (ip->i_ino > top) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  				top = ip->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  				cd.iplist[n] = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  				cd.iplist[k] = ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  		 * BUGBUG - This code has temporarily been removed.  The
^1da177e4c3f41 Linus Torvalds    2005-04-16  1206  		 * intent is to ensure that any file data is written before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  		 * the metadata is committed to the journal.  This prevents
^1da177e4c3f41 Linus Torvalds    2005-04-16  1208  		 * uninitialized data from appearing in a file after the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  		 * journal has been replayed.  (The uninitialized data
^1da177e4c3f41 Linus Torvalds    2005-04-16  1210  		 * could be sensitive data removed by another user.)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		 * The problem now is that we are holding the IWRITELOCK
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  		 * on the inode, and calling filemap_fdatawrite on an
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  		 * unmapped page will cause a deadlock in jfs_get_block.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1215  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1216  		 * The long term solution is to pare down the use of
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  		 * IWRITELOCK.  We are currently holding it too long.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		 * We could also be smarter about which data pages need
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  		 * to be written before the transaction is committed and
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  		 * when we don't need to worry about it at all.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  		 * if ((!S_ISDIR(ip->i_mode))
28fd129827b00e OGAWA Hirofumi    2006-01-08  1223  		 *    && (tblk->flag & COMMIT_DELETE) == 0)
28fd129827b00e OGAWA Hirofumi    2006-01-08  1224  		 *	filemap_write_and_wait(ip->i_mapping);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  		 * Mark inode as not dirty.  It will still be on the dirty
^1da177e4c3f41 Linus Torvalds    2005-04-16  1229  		 * inode list, but we'll know not to commit it again unless
^1da177e4c3f41 Linus Torvalds    2005-04-16  1230  		 * it gets marked dirty again
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  		clear_cflag(COMMIT_Dirty, ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* inherit anonymous tlock(s) of inode */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (jfs_ip->atlhead) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			lid_to_tlock(jfs_ip->atltail)->next = tblk->next;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			tblk->next = jfs_ip->atlhead;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1238  			if (!tblk->last)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  				tblk->last = jfs_ip->atltail;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			jfs_ip->atlhead = jfs_ip->atltail = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  			TXN_LOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			list_del_init(&jfs_ip->anon_inode_list);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  			TXN_UNLOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1247  		 * acquire transaction lock on on-disk inode page
^1da177e4c3f41 Linus Torvalds    2005-04-16  1248  		 * (become first tlock of the tblk's tlock list)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1249  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1250  		if (((rc = diWrite(tid, ip))))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1251  			goto out;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1252  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1253  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1254  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1255  	 *	write log records from transaction locks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1256  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1257  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1258  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1259  	if ((rc = txLog(log, tblk, &cd)))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1260  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1261  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1262  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1263  	 * Ensure that inode isn't reused before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1264  	 * lazy commit thread finishes processing
^1da177e4c3f41 Linus Torvalds    2005-04-16  1265  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1266  	if (tblk->xflag & COMMIT_DELETE) {
7de9c6ee3ecffd Al Viro           2010-10-23  1267  		ihold(tblk->u.ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1268  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1269  		 * Avoid a rare deadlock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1270  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1271  		 * If the inode is locked, we may be blocked in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1272  		 * jfs_commit_inode.  If so, we don't want the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1273  		 * lazy_commit thread doing the last iput() on the inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1274  		 * since that may block on the locked inode.  Instead,
^1da177e4c3f41 Linus Torvalds    2005-04-16  1275  		 * commit the transaction synchronously, so the last iput
^1da177e4c3f41 Linus Torvalds    2005-04-16  1276  		 * will be done by the calling thread (or later)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1277  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1278  		/*
1c0eeaf5698597 Joern Engel       2007-10-16  1279  		 * I believe this code is no longer needed.  Splitting I_LOCK
eaff8079d4f101 Christoph Hellwig 2009-12-17  1280  		 * into two bits, I_NEW and I_SYNC should prevent this
1c0eeaf5698597 Joern Engel       2007-10-16  1281  		 * deadlock as well.  But since I don't have a JFS testload
1c0eeaf5698597 Joern Engel       2007-10-16  1282  		 * to verify this, only a trivial s/I_LOCK/I_SYNC/ was done.
1c0eeaf5698597 Joern Engel       2007-10-16  1283  		 * Joern
1c0eeaf5698597 Joern Engel       2007-10-16  1284  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1285  		if (tblk->u.ip->i_state & I_SYNC)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1286  			tblk->xflag &= ~COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1287  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1288  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1289  	ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
^1da177e4c3f41 Linus Torvalds    2005-04-16  1290  	       ((tblk->u.ip->i_nlink == 0) &&
^1da177e4c3f41 Linus Torvalds    2005-04-16  1291  		!test_cflag(COMMIT_Nolink, tblk->u.ip)));
^1da177e4c3f41 Linus Torvalds    2005-04-16  1292  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1293  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1294  	 *	write COMMIT log record
^1da177e4c3f41 Linus Torvalds    2005-04-16  1295  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1296  	lrd->type = cpu_to_le16(LOG_COMMIT);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1297  	lrd->length = 0;
3c2c2262859900 Dave Kleikamp     2011-06-20  1298  	lmLog(log, tblk, lrd, NULL);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1299  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1300  	lmGroupCommit(log, tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1301  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1302  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1303  	 *	- transaction is now committed -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1304  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1305  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1306  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1307  	 * force pages in careful update
^1da177e4c3f41 Linus Torvalds    2005-04-16  1308  	 * (imap addressing structure update)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1309  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1310  	if (flag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1311  		txForce(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1312  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1313  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1314  	 *	update allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1315  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1316  	 * update inode allocation map and inode:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1317  	 * free pager lock on memory object of inode if any.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1318  	 * update block allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1319  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1320  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1321  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1322  	if (tblk->xflag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1323  		txUpdateMap(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1324  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1325  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1326  	 *	free transaction locks and pageout/free pages
^1da177e4c3f41 Linus Torvalds    2005-04-16  1327  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1328  	txRelease(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1329  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1330  	if ((tblk->flag & tblkGC_LAZY) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1331  		txUnlock(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1332  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1333  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1334  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1335  	 *	reset in-memory object state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1336  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1337  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1338  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1339  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1340  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1341  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1342  		 * reset in-memory inode state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1343  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1344  		jfs_ip->bxflag = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1345  		jfs_ip->blid = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1346  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1347  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1348        out:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1349  	if (rc != 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1350  		txAbort(tid, 1);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1351  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1352        TheEnd:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1353  	jfs_info("txCommit: tid = %d, returning %d", tid, rc);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1354  	return rc;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1355  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1356  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
@ 2021-02-07 10:16   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-02-07 10:16 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 22758 bytes --]

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on shaggy/jfs-next]
[also build test ERROR on v5.11-rc6 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
base:   https://github.com/kleikamp/linux-shaggy jfs-next
config: i386-randconfig-s001-20210207 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        # https://github.com/0day-ci/linux/commit/1d4e3ad79325df64962835ecc11999b520ffbc80
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
        git checkout 1d4e3ad79325df64962835ecc11999b520ffbc80
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/jfs/jfs_txnmgr.c: In function 'txCommit':
>> fs/jfs/jfs_txnmgr.c:1259:10: error: void value not ignored as it ought to be
    1259 |  if ((rc = txLog(log, tblk, &cd)))
         |          ^


vim +1259 fs/jfs/jfs_txnmgr.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1084  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1085  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1086   *		transaction commit management
^1da177e4c3f41 Linus Torvalds    2005-04-16  1087   *		-----------------------------
^1da177e4c3f41 Linus Torvalds    2005-04-16  1088   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1089  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1090  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1091   * NAME:	txCommit()
^1da177e4c3f41 Linus Torvalds    2005-04-16  1092   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1093   * FUNCTION:	commit the changes to the objects specified in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1094   *		clist.  For journalled segments only the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1095   *		changes of the caller are committed, ie by tid.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1096   *		for non-journalled segments the data are flushed to
^1da177e4c3f41 Linus Torvalds    2005-04-16  1097   *		disk and then the change to the disk inode and indirect
^1da177e4c3f41 Linus Torvalds    2005-04-16  1098   *		blocks committed (so blocks newly allocated to the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1099   *		segment will be made a part of the segment atomically).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1100   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1101   *		all of the segments specified in clist must be in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1102   *		one file system. no more than 6 segments are needed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1103   *		to handle all unix svcs.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1104   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1105   *		if the i_nlink field (i.e. disk inode link count)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1106   *		is zero, and the type of inode is a regular file or
^1da177e4c3f41 Linus Torvalds    2005-04-16  1107   *		directory, or symbolic link , the inode is truncated
^1da177e4c3f41 Linus Torvalds    2005-04-16  1108   *		to zero length. the truncation is committed but the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1109   *		VM resources are unaffected until it is closed (see
^1da177e4c3f41 Linus Torvalds    2005-04-16  1110   *		iput and iclose).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1111   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1112   * PARAMETER:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1113   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1114   * RETURN:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1115   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1116   * serialization:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1117   *		on entry the inode lock on each segment is assumed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1118   *		to be held.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1119   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1120   * i/o error:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1121   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1122  int txCommit(tid_t tid,		/* transaction identifier */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1123  	     int nip,		/* number of inodes to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1124  	     struct inode **iplist,	/* list of inode to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1125  	     int flag)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1126  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1127  	int rc = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1128  	struct commit cd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1129  	struct jfs_log *log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1130  	struct tblock *tblk;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1131  	struct lrd *lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1132  	struct inode *ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1133  	struct jfs_inode_info *jfs_ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1134  	int k, n;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1135  	ino_t top;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1136  	struct super_block *sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1137  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1138  	jfs_info("txCommit, tid = %d, flag = %d", tid, flag);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1139  	/* is read-only file system ? */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1140  	if (isReadOnly(iplist[0])) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1141  		rc = -EROFS;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1142  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1143  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1144  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1145  	sb = cd.sb = iplist[0]->i_sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1146  	cd.tid = tid;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1147  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1148  	if (tid == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1149  		tid = txBegin(sb, 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1150  	tblk = tid_to_tblock(tid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1151  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1152  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1153  	 * initialize commit structure
^1da177e4c3f41 Linus Torvalds    2005-04-16  1154  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1155  	log = JFS_SBI(sb)->log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1156  	cd.log = log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1157  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1158  	/* initialize log record descriptor in commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1159  	lrd = &cd.lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1160  	lrd->logtid = cpu_to_le32(tblk->logtid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1161  	lrd->backchain = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1162  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1163  	tblk->xflag |= flag;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1164  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1165  	if ((flag & (COMMIT_FORCE | COMMIT_SYNC)) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1166  		tblk->xflag |= COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1167  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1168  	 *	prepare non-journaled objects for commit
^1da177e4c3f41 Linus Torvalds    2005-04-16  1169  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1170  	 * flush data pages of non-journaled file
^1da177e4c3f41 Linus Torvalds    2005-04-16  1171  	 * to prevent the file getting non-initialized disk blocks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1172  	 * in case of crash.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1173  	 * (new blocks - )
^1da177e4c3f41 Linus Torvalds    2005-04-16  1174  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1175  	cd.iplist = iplist;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1176  	cd.nip = nip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1177  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1178  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1179  	 *	acquire transaction lock on (on-disk) inodes
^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  	 * update on-disk inode from in-memory inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  	 * acquiring transaction locks for AFTER records
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  	 * on the on-disk inode of file object
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	 * sort the inodes array by inode number in descending order
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  	 * to prevent deadlock when acquiring transaction lock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	 * of on-disk inodes on multiple on-disk inode pages by
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  	 * multiple concurrent transactions
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		top = (cd.iplist[k])->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		for (n = k + 1; n < cd.nip; n++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			ip = cd.iplist[n];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  			if (ip->i_ino > top) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  				top = ip->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  				cd.iplist[n] = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  				cd.iplist[k] = ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  		 * BUGBUG - This code has temporarily been removed.  The
^1da177e4c3f41 Linus Torvalds    2005-04-16  1206  		 * intent is to ensure that any file data is written before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  		 * the metadata is committed to the journal.  This prevents
^1da177e4c3f41 Linus Torvalds    2005-04-16  1208  		 * uninitialized data from appearing in a file after the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  		 * journal has been replayed.  (The uninitialized data
^1da177e4c3f41 Linus Torvalds    2005-04-16  1210  		 * could be sensitive data removed by another user.)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		 * The problem now is that we are holding the IWRITELOCK
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  		 * on the inode, and calling filemap_fdatawrite on an
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  		 * unmapped page will cause a deadlock in jfs_get_block.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1215  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1216  		 * The long term solution is to pare down the use of
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  		 * IWRITELOCK.  We are currently holding it too long.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		 * We could also be smarter about which data pages need
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  		 * to be written before the transaction is committed and
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  		 * when we don't need to worry about it at all.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  		 * if ((!S_ISDIR(ip->i_mode))
28fd129827b00e OGAWA Hirofumi    2006-01-08  1223  		 *    && (tblk->flag & COMMIT_DELETE) == 0)
28fd129827b00e OGAWA Hirofumi    2006-01-08  1224  		 *	filemap_write_and_wait(ip->i_mapping);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  		 * Mark inode as not dirty.  It will still be on the dirty
^1da177e4c3f41 Linus Torvalds    2005-04-16  1229  		 * inode list, but we'll know not to commit it again unless
^1da177e4c3f41 Linus Torvalds    2005-04-16  1230  		 * it gets marked dirty again
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  		clear_cflag(COMMIT_Dirty, ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* inherit anonymous tlock(s) of inode */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (jfs_ip->atlhead) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			lid_to_tlock(jfs_ip->atltail)->next = tblk->next;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			tblk->next = jfs_ip->atlhead;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1238  			if (!tblk->last)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  				tblk->last = jfs_ip->atltail;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			jfs_ip->atlhead = jfs_ip->atltail = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  			TXN_LOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			list_del_init(&jfs_ip->anon_inode_list);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  			TXN_UNLOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1247  		 * acquire transaction lock on on-disk inode page
^1da177e4c3f41 Linus Torvalds    2005-04-16  1248  		 * (become first tlock of the tblk's tlock list)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1249  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1250  		if (((rc = diWrite(tid, ip))))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1251  			goto out;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1252  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1253  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1254  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1255  	 *	write log records from transaction locks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1256  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1257  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1258  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1259  	if ((rc = txLog(log, tblk, &cd)))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1260  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1261  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1262  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1263  	 * Ensure that inode isn't reused before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1264  	 * lazy commit thread finishes processing
^1da177e4c3f41 Linus Torvalds    2005-04-16  1265  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1266  	if (tblk->xflag & COMMIT_DELETE) {
7de9c6ee3ecffd Al Viro           2010-10-23  1267  		ihold(tblk->u.ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1268  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1269  		 * Avoid a rare deadlock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1270  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1271  		 * If the inode is locked, we may be blocked in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1272  		 * jfs_commit_inode.  If so, we don't want the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1273  		 * lazy_commit thread doing the last iput() on the inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1274  		 * since that may block on the locked inode.  Instead,
^1da177e4c3f41 Linus Torvalds    2005-04-16  1275  		 * commit the transaction synchronously, so the last iput
^1da177e4c3f41 Linus Torvalds    2005-04-16  1276  		 * will be done by the calling thread (or later)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1277  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1278  		/*
1c0eeaf5698597 Joern Engel       2007-10-16  1279  		 * I believe this code is no longer needed.  Splitting I_LOCK
eaff8079d4f101 Christoph Hellwig 2009-12-17  1280  		 * into two bits, I_NEW and I_SYNC should prevent this
1c0eeaf5698597 Joern Engel       2007-10-16  1281  		 * deadlock as well.  But since I don't have a JFS testload
1c0eeaf5698597 Joern Engel       2007-10-16  1282  		 * to verify this, only a trivial s/I_LOCK/I_SYNC/ was done.
1c0eeaf5698597 Joern Engel       2007-10-16  1283  		 * Joern
1c0eeaf5698597 Joern Engel       2007-10-16  1284  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1285  		if (tblk->u.ip->i_state & I_SYNC)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1286  			tblk->xflag &= ~COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1287  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1288  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1289  	ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
^1da177e4c3f41 Linus Torvalds    2005-04-16  1290  	       ((tblk->u.ip->i_nlink == 0) &&
^1da177e4c3f41 Linus Torvalds    2005-04-16  1291  		!test_cflag(COMMIT_Nolink, tblk->u.ip)));
^1da177e4c3f41 Linus Torvalds    2005-04-16  1292  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1293  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1294  	 *	write COMMIT log record
^1da177e4c3f41 Linus Torvalds    2005-04-16  1295  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1296  	lrd->type = cpu_to_le16(LOG_COMMIT);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1297  	lrd->length = 0;
3c2c2262859900 Dave Kleikamp     2011-06-20  1298  	lmLog(log, tblk, lrd, NULL);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1299  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1300  	lmGroupCommit(log, tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1301  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1302  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1303  	 *	- transaction is now committed -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1304  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1305  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1306  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1307  	 * force pages in careful update
^1da177e4c3f41 Linus Torvalds    2005-04-16  1308  	 * (imap addressing structure update)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1309  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1310  	if (flag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1311  		txForce(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1312  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1313  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1314  	 *	update allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1315  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1316  	 * update inode allocation map and inode:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1317  	 * free pager lock on memory object of inode if any.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1318  	 * update block allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1319  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1320  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1321  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1322  	if (tblk->xflag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1323  		txUpdateMap(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1324  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1325  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1326  	 *	free transaction locks and pageout/free pages
^1da177e4c3f41 Linus Torvalds    2005-04-16  1327  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1328  	txRelease(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1329  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1330  	if ((tblk->flag & tblkGC_LAZY) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1331  		txUnlock(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1332  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1333  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1334  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1335  	 *	reset in-memory object state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1336  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1337  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1338  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1339  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1340  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1341  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1342  		 * reset in-memory inode state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1343  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1344  		jfs_ip->bxflag = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1345  		jfs_ip->blid = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1346  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1347  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1348        out:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1349  	if (rc != 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1350  		txAbort(tid, 1);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1351  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1352        TheEnd:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1353  	jfs_info("txCommit: tid = %d, returning %d", tid, rc);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1354  	return rc;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1355  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1356  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
  2021-02-07  8:32 [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions Yang Li
@ 2021-02-07 12:06   ` kernel test robot
  2021-02-07 12:06   ` kernel test robot
  2021-02-08 15:05 ` Dave Kleikamp
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-02-07 12:06 UTC (permalink / raw)
  To: Yang Li, shaggy
  Cc: kbuild-all, clang-built-linux, jfs-discussion, linux-kernel, Yang Li

[-- Attachment #1: Type: text/plain, Size: 22711 bytes --]

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on shaggy/jfs-next]
[also build test ERROR on v5.11-rc6 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
base:   https://github.com/kleikamp/linux-shaggy jfs-next
config: x86_64-randconfig-a011-20210207 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/1d4e3ad79325df64962835ecc11999b520ffbc80
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
        git checkout 1d4e3ad79325df64962835ecc11999b520ffbc80
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> fs/jfs/jfs_txnmgr.c:1259:10: error: assigning to 'int' from incompatible type 'void'
           if ((rc = txLog(log, tblk, &cd)))
                   ^ ~~~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +1259 fs/jfs/jfs_txnmgr.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1084  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1085  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1086   *		transaction commit management
^1da177e4c3f41 Linus Torvalds    2005-04-16  1087   *		-----------------------------
^1da177e4c3f41 Linus Torvalds    2005-04-16  1088   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1089  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1090  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1091   * NAME:	txCommit()
^1da177e4c3f41 Linus Torvalds    2005-04-16  1092   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1093   * FUNCTION:	commit the changes to the objects specified in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1094   *		clist.  For journalled segments only the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1095   *		changes of the caller are committed, ie by tid.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1096   *		for non-journalled segments the data are flushed to
^1da177e4c3f41 Linus Torvalds    2005-04-16  1097   *		disk and then the change to the disk inode and indirect
^1da177e4c3f41 Linus Torvalds    2005-04-16  1098   *		blocks committed (so blocks newly allocated to the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1099   *		segment will be made a part of the segment atomically).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1100   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1101   *		all of the segments specified in clist must be in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1102   *		one file system. no more than 6 segments are needed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1103   *		to handle all unix svcs.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1104   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1105   *		if the i_nlink field (i.e. disk inode link count)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1106   *		is zero, and the type of inode is a regular file or
^1da177e4c3f41 Linus Torvalds    2005-04-16  1107   *		directory, or symbolic link , the inode is truncated
^1da177e4c3f41 Linus Torvalds    2005-04-16  1108   *		to zero length. the truncation is committed but the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1109   *		VM resources are unaffected until it is closed (see
^1da177e4c3f41 Linus Torvalds    2005-04-16  1110   *		iput and iclose).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1111   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1112   * PARAMETER:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1113   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1114   * RETURN:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1115   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1116   * serialization:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1117   *		on entry the inode lock on each segment is assumed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1118   *		to be held.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1119   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1120   * i/o error:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1121   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1122  int txCommit(tid_t tid,		/* transaction identifier */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1123  	     int nip,		/* number of inodes to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1124  	     struct inode **iplist,	/* list of inode to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1125  	     int flag)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1126  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1127  	int rc = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1128  	struct commit cd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1129  	struct jfs_log *log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1130  	struct tblock *tblk;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1131  	struct lrd *lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1132  	struct inode *ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1133  	struct jfs_inode_info *jfs_ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1134  	int k, n;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1135  	ino_t top;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1136  	struct super_block *sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1137  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1138  	jfs_info("txCommit, tid = %d, flag = %d", tid, flag);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1139  	/* is read-only file system ? */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1140  	if (isReadOnly(iplist[0])) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1141  		rc = -EROFS;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1142  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1143  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1144  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1145  	sb = cd.sb = iplist[0]->i_sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1146  	cd.tid = tid;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1147  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1148  	if (tid == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1149  		tid = txBegin(sb, 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1150  	tblk = tid_to_tblock(tid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1151  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1152  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1153  	 * initialize commit structure
^1da177e4c3f41 Linus Torvalds    2005-04-16  1154  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1155  	log = JFS_SBI(sb)->log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1156  	cd.log = log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1157  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1158  	/* initialize log record descriptor in commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1159  	lrd = &cd.lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1160  	lrd->logtid = cpu_to_le32(tblk->logtid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1161  	lrd->backchain = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1162  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1163  	tblk->xflag |= flag;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1164  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1165  	if ((flag & (COMMIT_FORCE | COMMIT_SYNC)) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1166  		tblk->xflag |= COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1167  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1168  	 *	prepare non-journaled objects for commit
^1da177e4c3f41 Linus Torvalds    2005-04-16  1169  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1170  	 * flush data pages of non-journaled file
^1da177e4c3f41 Linus Torvalds    2005-04-16  1171  	 * to prevent the file getting non-initialized disk blocks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1172  	 * in case of crash.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1173  	 * (new blocks - )
^1da177e4c3f41 Linus Torvalds    2005-04-16  1174  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1175  	cd.iplist = iplist;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1176  	cd.nip = nip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1177  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1178  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1179  	 *	acquire transaction lock on (on-disk) inodes
^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  	 * update on-disk inode from in-memory inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  	 * acquiring transaction locks for AFTER records
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  	 * on the on-disk inode of file object
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	 * sort the inodes array by inode number in descending order
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  	 * to prevent deadlock when acquiring transaction lock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	 * of on-disk inodes on multiple on-disk inode pages by
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  	 * multiple concurrent transactions
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		top = (cd.iplist[k])->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		for (n = k + 1; n < cd.nip; n++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			ip = cd.iplist[n];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  			if (ip->i_ino > top) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  				top = ip->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  				cd.iplist[n] = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  				cd.iplist[k] = ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  		 * BUGBUG - This code has temporarily been removed.  The
^1da177e4c3f41 Linus Torvalds    2005-04-16  1206  		 * intent is to ensure that any file data is written before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  		 * the metadata is committed to the journal.  This prevents
^1da177e4c3f41 Linus Torvalds    2005-04-16  1208  		 * uninitialized data from appearing in a file after the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  		 * journal has been replayed.  (The uninitialized data
^1da177e4c3f41 Linus Torvalds    2005-04-16  1210  		 * could be sensitive data removed by another user.)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		 * The problem now is that we are holding the IWRITELOCK
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  		 * on the inode, and calling filemap_fdatawrite on an
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  		 * unmapped page will cause a deadlock in jfs_get_block.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1215  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1216  		 * The long term solution is to pare down the use of
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  		 * IWRITELOCK.  We are currently holding it too long.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		 * We could also be smarter about which data pages need
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  		 * to be written before the transaction is committed and
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  		 * when we don't need to worry about it at all.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  		 * if ((!S_ISDIR(ip->i_mode))
28fd129827b00e OGAWA Hirofumi    2006-01-08  1223  		 *    && (tblk->flag & COMMIT_DELETE) == 0)
28fd129827b00e OGAWA Hirofumi    2006-01-08  1224  		 *	filemap_write_and_wait(ip->i_mapping);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  		 * Mark inode as not dirty.  It will still be on the dirty
^1da177e4c3f41 Linus Torvalds    2005-04-16  1229  		 * inode list, but we'll know not to commit it again unless
^1da177e4c3f41 Linus Torvalds    2005-04-16  1230  		 * it gets marked dirty again
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  		clear_cflag(COMMIT_Dirty, ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* inherit anonymous tlock(s) of inode */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (jfs_ip->atlhead) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			lid_to_tlock(jfs_ip->atltail)->next = tblk->next;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			tblk->next = jfs_ip->atlhead;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1238  			if (!tblk->last)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  				tblk->last = jfs_ip->atltail;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			jfs_ip->atlhead = jfs_ip->atltail = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  			TXN_LOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			list_del_init(&jfs_ip->anon_inode_list);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  			TXN_UNLOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1247  		 * acquire transaction lock on on-disk inode page
^1da177e4c3f41 Linus Torvalds    2005-04-16  1248  		 * (become first tlock of the tblk's tlock list)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1249  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1250  		if (((rc = diWrite(tid, ip))))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1251  			goto out;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1252  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1253  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1254  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1255  	 *	write log records from transaction locks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1256  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1257  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1258  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1259  	if ((rc = txLog(log, tblk, &cd)))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1260  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1261  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1262  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1263  	 * Ensure that inode isn't reused before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1264  	 * lazy commit thread finishes processing
^1da177e4c3f41 Linus Torvalds    2005-04-16  1265  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1266  	if (tblk->xflag & COMMIT_DELETE) {
7de9c6ee3ecffd Al Viro           2010-10-23  1267  		ihold(tblk->u.ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1268  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1269  		 * Avoid a rare deadlock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1270  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1271  		 * If the inode is locked, we may be blocked in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1272  		 * jfs_commit_inode.  If so, we don't want the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1273  		 * lazy_commit thread doing the last iput() on the inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1274  		 * since that may block on the locked inode.  Instead,
^1da177e4c3f41 Linus Torvalds    2005-04-16  1275  		 * commit the transaction synchronously, so the last iput
^1da177e4c3f41 Linus Torvalds    2005-04-16  1276  		 * will be done by the calling thread (or later)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1277  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1278  		/*
1c0eeaf5698597 Joern Engel       2007-10-16  1279  		 * I believe this code is no longer needed.  Splitting I_LOCK
eaff8079d4f101 Christoph Hellwig 2009-12-17  1280  		 * into two bits, I_NEW and I_SYNC should prevent this
1c0eeaf5698597 Joern Engel       2007-10-16  1281  		 * deadlock as well.  But since I don't have a JFS testload
1c0eeaf5698597 Joern Engel       2007-10-16  1282  		 * to verify this, only a trivial s/I_LOCK/I_SYNC/ was done.
1c0eeaf5698597 Joern Engel       2007-10-16  1283  		 * Joern
1c0eeaf5698597 Joern Engel       2007-10-16  1284  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1285  		if (tblk->u.ip->i_state & I_SYNC)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1286  			tblk->xflag &= ~COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1287  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1288  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1289  	ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
^1da177e4c3f41 Linus Torvalds    2005-04-16  1290  	       ((tblk->u.ip->i_nlink == 0) &&
^1da177e4c3f41 Linus Torvalds    2005-04-16  1291  		!test_cflag(COMMIT_Nolink, tblk->u.ip)));
^1da177e4c3f41 Linus Torvalds    2005-04-16  1292  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1293  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1294  	 *	write COMMIT log record
^1da177e4c3f41 Linus Torvalds    2005-04-16  1295  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1296  	lrd->type = cpu_to_le16(LOG_COMMIT);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1297  	lrd->length = 0;
3c2c2262859900 Dave Kleikamp     2011-06-20  1298  	lmLog(log, tblk, lrd, NULL);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1299  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1300  	lmGroupCommit(log, tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1301  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1302  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1303  	 *	- transaction is now committed -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1304  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1305  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1306  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1307  	 * force pages in careful update
^1da177e4c3f41 Linus Torvalds    2005-04-16  1308  	 * (imap addressing structure update)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1309  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1310  	if (flag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1311  		txForce(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1312  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1313  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1314  	 *	update allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1315  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1316  	 * update inode allocation map and inode:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1317  	 * free pager lock on memory object of inode if any.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1318  	 * update block allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1319  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1320  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1321  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1322  	if (tblk->xflag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1323  		txUpdateMap(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1324  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1325  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1326  	 *	free transaction locks and pageout/free pages
^1da177e4c3f41 Linus Torvalds    2005-04-16  1327  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1328  	txRelease(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1329  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1330  	if ((tblk->flag & tblkGC_LAZY) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1331  		txUnlock(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1332  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1333  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1334  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1335  	 *	reset in-memory object state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1336  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1337  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1338  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1339  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1340  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1341  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1342  		 * reset in-memory inode state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1343  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1344  		jfs_ip->bxflag = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1345  		jfs_ip->blid = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1346  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1347  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1348        out:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1349  	if (rc != 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1350  		txAbort(tid, 1);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1351  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1352        TheEnd:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1353  	jfs_info("txCommit: tid = %d, returning %d", tid, rc);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1354  	return rc;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1355  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1356  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30444 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
@ 2021-02-07 12:06   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-02-07 12:06 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 23029 bytes --]

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on shaggy/jfs-next]
[also build test ERROR on v5.11-rc6 next-20210125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
base:   https://github.com/kleikamp/linux-shaggy jfs-next
config: x86_64-randconfig-a011-20210207 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/1d4e3ad79325df64962835ecc11999b520ffbc80
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/jfs-turn-diLog-dataLog-and-txLog-into-void-functions/20210207-164143
        git checkout 1d4e3ad79325df64962835ecc11999b520ffbc80
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> fs/jfs/jfs_txnmgr.c:1259:10: error: assigning to 'int' from incompatible type 'void'
           if ((rc = txLog(log, tblk, &cd)))
                   ^ ~~~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +1259 fs/jfs/jfs_txnmgr.c

^1da177e4c3f41 Linus Torvalds    2005-04-16  1084  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1085  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1086   *		transaction commit management
^1da177e4c3f41 Linus Torvalds    2005-04-16  1087   *		-----------------------------
^1da177e4c3f41 Linus Torvalds    2005-04-16  1088   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1089  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1090  /*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1091   * NAME:	txCommit()
^1da177e4c3f41 Linus Torvalds    2005-04-16  1092   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1093   * FUNCTION:	commit the changes to the objects specified in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1094   *		clist.  For journalled segments only the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1095   *		changes of the caller are committed, ie by tid.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1096   *		for non-journalled segments the data are flushed to
^1da177e4c3f41 Linus Torvalds    2005-04-16  1097   *		disk and then the change to the disk inode and indirect
^1da177e4c3f41 Linus Torvalds    2005-04-16  1098   *		blocks committed (so blocks newly allocated to the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1099   *		segment will be made a part of the segment atomically).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1100   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1101   *		all of the segments specified in clist must be in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1102   *		one file system. no more than 6 segments are needed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1103   *		to handle all unix svcs.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1104   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1105   *		if the i_nlink field (i.e. disk inode link count)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1106   *		is zero, and the type of inode is a regular file or
^1da177e4c3f41 Linus Torvalds    2005-04-16  1107   *		directory, or symbolic link , the inode is truncated
^1da177e4c3f41 Linus Torvalds    2005-04-16  1108   *		to zero length. the truncation is committed but the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1109   *		VM resources are unaffected until it is closed (see
^1da177e4c3f41 Linus Torvalds    2005-04-16  1110   *		iput and iclose).
^1da177e4c3f41 Linus Torvalds    2005-04-16  1111   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1112   * PARAMETER:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1113   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1114   * RETURN:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1115   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1116   * serialization:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1117   *		on entry the inode lock on each segment is assumed
^1da177e4c3f41 Linus Torvalds    2005-04-16  1118   *		to be held.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1119   *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1120   * i/o error:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1121   */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1122  int txCommit(tid_t tid,		/* transaction identifier */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1123  	     int nip,		/* number of inodes to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1124  	     struct inode **iplist,	/* list of inode to commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1125  	     int flag)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1126  {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1127  	int rc = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1128  	struct commit cd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1129  	struct jfs_log *log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1130  	struct tblock *tblk;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1131  	struct lrd *lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1132  	struct inode *ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1133  	struct jfs_inode_info *jfs_ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1134  	int k, n;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1135  	ino_t top;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1136  	struct super_block *sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1137  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1138  	jfs_info("txCommit, tid = %d, flag = %d", tid, flag);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1139  	/* is read-only file system ? */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1140  	if (isReadOnly(iplist[0])) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1141  		rc = -EROFS;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1142  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1143  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1144  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1145  	sb = cd.sb = iplist[0]->i_sb;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1146  	cd.tid = tid;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1147  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1148  	if (tid == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1149  		tid = txBegin(sb, 0);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1150  	tblk = tid_to_tblock(tid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1151  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1152  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1153  	 * initialize commit structure
^1da177e4c3f41 Linus Torvalds    2005-04-16  1154  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1155  	log = JFS_SBI(sb)->log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1156  	cd.log = log;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1157  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1158  	/* initialize log record descriptor in commit */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1159  	lrd = &cd.lrd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1160  	lrd->logtid = cpu_to_le32(tblk->logtid);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1161  	lrd->backchain = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1162  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1163  	tblk->xflag |= flag;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1164  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1165  	if ((flag & (COMMIT_FORCE | COMMIT_SYNC)) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1166  		tblk->xflag |= COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1167  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1168  	 *	prepare non-journaled objects for commit
^1da177e4c3f41 Linus Torvalds    2005-04-16  1169  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1170  	 * flush data pages of non-journaled file
^1da177e4c3f41 Linus Torvalds    2005-04-16  1171  	 * to prevent the file getting non-initialized disk blocks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1172  	 * in case of crash.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1173  	 * (new blocks - )
^1da177e4c3f41 Linus Torvalds    2005-04-16  1174  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1175  	cd.iplist = iplist;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1176  	cd.nip = nip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1177  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1178  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1179  	 *	acquire transaction lock on (on-disk) inodes
^1da177e4c3f41 Linus Torvalds    2005-04-16  1180  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1181  	 * update on-disk inode from in-memory inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1182  	 * acquiring transaction locks for AFTER records
^1da177e4c3f41 Linus Torvalds    2005-04-16  1183  	 * on the on-disk inode of file object
^1da177e4c3f41 Linus Torvalds    2005-04-16  1184  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1185  	 * sort the inodes array by inode number in descending order
^1da177e4c3f41 Linus Torvalds    2005-04-16  1186  	 * to prevent deadlock when acquiring transaction lock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1187  	 * of on-disk inodes on multiple on-disk inode pages by
^1da177e4c3f41 Linus Torvalds    2005-04-16  1188  	 * multiple concurrent transactions
^1da177e4c3f41 Linus Torvalds    2005-04-16  1189  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1190  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1191  		top = (cd.iplist[k])->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1192  		for (n = k + 1; n < cd.nip; n++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1193  			ip = cd.iplist[n];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1194  			if (ip->i_ino > top) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1195  				top = ip->i_ino;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1196  				cd.iplist[n] = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1197  				cd.iplist[k] = ip;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1198  			}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1199  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1200  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1201  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1202  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1203  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1204  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1205  		 * BUGBUG - This code has temporarily been removed.  The
^1da177e4c3f41 Linus Torvalds    2005-04-16  1206  		 * intent is to ensure that any file data is written before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1207  		 * the metadata is committed to the journal.  This prevents
^1da177e4c3f41 Linus Torvalds    2005-04-16  1208  		 * uninitialized data from appearing in a file after the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1209  		 * journal has been replayed.  (The uninitialized data
^1da177e4c3f41 Linus Torvalds    2005-04-16  1210  		 * could be sensitive data removed by another user.)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1211  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1212  		 * The problem now is that we are holding the IWRITELOCK
^1da177e4c3f41 Linus Torvalds    2005-04-16  1213  		 * on the inode, and calling filemap_fdatawrite on an
^1da177e4c3f41 Linus Torvalds    2005-04-16  1214  		 * unmapped page will cause a deadlock in jfs_get_block.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1215  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1216  		 * The long term solution is to pare down the use of
^1da177e4c3f41 Linus Torvalds    2005-04-16  1217  		 * IWRITELOCK.  We are currently holding it too long.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1218  		 * We could also be smarter about which data pages need
^1da177e4c3f41 Linus Torvalds    2005-04-16  1219  		 * to be written before the transaction is committed and
^1da177e4c3f41 Linus Torvalds    2005-04-16  1220  		 * when we don't need to worry about it at all.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1221  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1222  		 * if ((!S_ISDIR(ip->i_mode))
28fd129827b00e OGAWA Hirofumi    2006-01-08  1223  		 *    && (tblk->flag & COMMIT_DELETE) == 0)
28fd129827b00e OGAWA Hirofumi    2006-01-08  1224  		 *	filemap_write_and_wait(ip->i_mapping);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1225  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1226  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1227  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1228  		 * Mark inode as not dirty.  It will still be on the dirty
^1da177e4c3f41 Linus Torvalds    2005-04-16  1229  		 * inode list, but we'll know not to commit it again unless
^1da177e4c3f41 Linus Torvalds    2005-04-16  1230  		 * it gets marked dirty again
^1da177e4c3f41 Linus Torvalds    2005-04-16  1231  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1232  		clear_cflag(COMMIT_Dirty, ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1233  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1234  		/* inherit anonymous tlock(s) of inode */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1235  		if (jfs_ip->atlhead) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1236  			lid_to_tlock(jfs_ip->atltail)->next = tblk->next;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1237  			tblk->next = jfs_ip->atlhead;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1238  			if (!tblk->last)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1239  				tblk->last = jfs_ip->atltail;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1240  			jfs_ip->atlhead = jfs_ip->atltail = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1241  			TXN_LOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1242  			list_del_init(&jfs_ip->anon_inode_list);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1243  			TXN_UNLOCK();
^1da177e4c3f41 Linus Torvalds    2005-04-16  1244  		}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1245  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1246  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1247  		 * acquire transaction lock on on-disk inode page
^1da177e4c3f41 Linus Torvalds    2005-04-16  1248  		 * (become first tlock of the tblk's tlock list)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1249  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1250  		if (((rc = diWrite(tid, ip))))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1251  			goto out;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1252  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1253  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1254  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1255  	 *	write log records from transaction locks
^1da177e4c3f41 Linus Torvalds    2005-04-16  1256  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1257  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1258  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16 @1259  	if ((rc = txLog(log, tblk, &cd)))
^1da177e4c3f41 Linus Torvalds    2005-04-16  1260  		goto TheEnd;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1261  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1262  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1263  	 * Ensure that inode isn't reused before
^1da177e4c3f41 Linus Torvalds    2005-04-16  1264  	 * lazy commit thread finishes processing
^1da177e4c3f41 Linus Torvalds    2005-04-16  1265  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1266  	if (tblk->xflag & COMMIT_DELETE) {
7de9c6ee3ecffd Al Viro           2010-10-23  1267  		ihold(tblk->u.ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1268  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1269  		 * Avoid a rare deadlock
^1da177e4c3f41 Linus Torvalds    2005-04-16  1270  		 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1271  		 * If the inode is locked, we may be blocked in
^1da177e4c3f41 Linus Torvalds    2005-04-16  1272  		 * jfs_commit_inode.  If so, we don't want the
^1da177e4c3f41 Linus Torvalds    2005-04-16  1273  		 * lazy_commit thread doing the last iput() on the inode
^1da177e4c3f41 Linus Torvalds    2005-04-16  1274  		 * since that may block on the locked inode.  Instead,
^1da177e4c3f41 Linus Torvalds    2005-04-16  1275  		 * commit the transaction synchronously, so the last iput
^1da177e4c3f41 Linus Torvalds    2005-04-16  1276  		 * will be done by the calling thread (or later)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1277  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1278  		/*
1c0eeaf5698597 Joern Engel       2007-10-16  1279  		 * I believe this code is no longer needed.  Splitting I_LOCK
eaff8079d4f101 Christoph Hellwig 2009-12-17  1280  		 * into two bits, I_NEW and I_SYNC should prevent this
1c0eeaf5698597 Joern Engel       2007-10-16  1281  		 * deadlock as well.  But since I don't have a JFS testload
1c0eeaf5698597 Joern Engel       2007-10-16  1282  		 * to verify this, only a trivial s/I_LOCK/I_SYNC/ was done.
1c0eeaf5698597 Joern Engel       2007-10-16  1283  		 * Joern
1c0eeaf5698597 Joern Engel       2007-10-16  1284  		 */
1c0eeaf5698597 Joern Engel       2007-10-16  1285  		if (tblk->u.ip->i_state & I_SYNC)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1286  			tblk->xflag &= ~COMMIT_LAZY;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1287  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1288  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1289  	ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
^1da177e4c3f41 Linus Torvalds    2005-04-16  1290  	       ((tblk->u.ip->i_nlink == 0) &&
^1da177e4c3f41 Linus Torvalds    2005-04-16  1291  		!test_cflag(COMMIT_Nolink, tblk->u.ip)));
^1da177e4c3f41 Linus Torvalds    2005-04-16  1292  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1293  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1294  	 *	write COMMIT log record
^1da177e4c3f41 Linus Torvalds    2005-04-16  1295  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1296  	lrd->type = cpu_to_le16(LOG_COMMIT);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1297  	lrd->length = 0;
3c2c2262859900 Dave Kleikamp     2011-06-20  1298  	lmLog(log, tblk, lrd, NULL);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1299  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1300  	lmGroupCommit(log, tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1301  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1302  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1303  	 *	- transaction is now committed -
^1da177e4c3f41 Linus Torvalds    2005-04-16  1304  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1305  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1306  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1307  	 * force pages in careful update
^1da177e4c3f41 Linus Torvalds    2005-04-16  1308  	 * (imap addressing structure update)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1309  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1310  	if (flag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1311  		txForce(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1312  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1313  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1314  	 *	update allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1315  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1316  	 * update inode allocation map and inode:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1317  	 * free pager lock on memory object of inode if any.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1318  	 * update block allocation map.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1319  	 *
^1da177e4c3f41 Linus Torvalds    2005-04-16  1320  	 * txUpdateMap() resets XAD_NEW in XAD.
^1da177e4c3f41 Linus Torvalds    2005-04-16  1321  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1322  	if (tblk->xflag & COMMIT_FORCE)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1323  		txUpdateMap(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1324  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1325  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1326  	 *	free transaction locks and pageout/free pages
^1da177e4c3f41 Linus Torvalds    2005-04-16  1327  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1328  	txRelease(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1329  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1330  	if ((tblk->flag & tblkGC_LAZY) == 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1331  		txUnlock(tblk);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1332  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1333  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1334  	/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1335  	 *	reset in-memory object state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1336  	 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1337  	for (k = 0; k < cd.nip; k++) {
^1da177e4c3f41 Linus Torvalds    2005-04-16  1338  		ip = cd.iplist[k];
^1da177e4c3f41 Linus Torvalds    2005-04-16  1339  		jfs_ip = JFS_IP(ip);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1340  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1341  		/*
^1da177e4c3f41 Linus Torvalds    2005-04-16  1342  		 * reset in-memory inode state
^1da177e4c3f41 Linus Torvalds    2005-04-16  1343  		 */
^1da177e4c3f41 Linus Torvalds    2005-04-16  1344  		jfs_ip->bxflag = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1345  		jfs_ip->blid = 0;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1346  	}
^1da177e4c3f41 Linus Torvalds    2005-04-16  1347  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1348        out:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1349  	if (rc != 0)
^1da177e4c3f41 Linus Torvalds    2005-04-16  1350  		txAbort(tid, 1);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1351  
^1da177e4c3f41 Linus Torvalds    2005-04-16  1352        TheEnd:
^1da177e4c3f41 Linus Torvalds    2005-04-16  1353  	jfs_info("txCommit: tid = %d, returning %d", tid, rc);
^1da177e4c3f41 Linus Torvalds    2005-04-16  1354  	return rc;
^1da177e4c3f41 Linus Torvalds    2005-04-16  1355  }
^1da177e4c3f41 Linus Torvalds    2005-04-16  1356  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30444 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
  2021-02-07  8:32 [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions Yang Li
  2021-02-07 10:16   ` kernel test robot
  2021-02-07 12:06   ` kernel test robot
@ 2021-02-08 15:05 ` Dave Kleikamp
  2021-02-08 15:12   ` [Jfs-discussion] " Dave Kleikamp
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Kleikamp @ 2021-02-08 15:05 UTC (permalink / raw)
  To: Yang Li, shaggy; +Cc: jfs-discussion, linux-kernel

On 2/7/21 2:32 AM, Yang Li wrote:
> These functions always return '0' and no callers use the return value.
> So make it a void function.
> 
> This eliminates the following coccicheck warning:
> ./fs/jfs/jfs_txnmgr.c:1365:5-7: Unneeded variable: "rc". Return "0" on
> line 1414
> ./fs/jfs/jfs_txnmgr.c:1422:5-7: Unneeded variable: "rc". Return "0" on
> line 1527
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> 
> Changes in v2
> -turn functions forward references to void type.
> 
>   fs/jfs/jfs_txnmgr.c | 32 +++++++++++++++-----------------
>   1 file changed, 15 insertions(+), 17 deletions(-)

This patch missed fixing a call to txLog() which did check the return value. I took the liberty of fixing it here.


jfs: turn diLog(), dataLog() and txLog() into void functions

These functions always return '0' and no callers use the return value.
So make it a void function.

This eliminates the following coccicheck warning:
./fs/jfs/jfs_txnmgr.c:1365:5-7: Unneeded variable: "rc". Return "0" on
line 1414
./fs/jfs/jfs_txnmgr.c:1422:5-7: Unneeded variable: "rc". Return "0" on
line 1527

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
---
  fs/jfs/jfs_txnmgr.c | 35 ++++++++++++++++-------------------
  1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index dca8edd2378c..053295cd7bc6 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -148,10 +148,10 @@ static struct {
  /*
   * forward references
   */
-static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-		struct tlock * tlck, struct commit * cd);
-static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-		struct tlock * tlck);
+static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+		struct tlock *tlck, struct commit *cd);
+static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+		struct tlock *tlck);
  static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
  		struct tlock * tlck);
  static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
@@ -159,8 +159,8 @@ static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
  static void txAllocPMap(struct inode *ip, struct maplock * maplock,
  		struct tblock * tblk);
  static void txForce(struct tblock * tblk);
-static int txLog(struct jfs_log * log, struct tblock * tblk,
-		struct commit * cd);
+static void txLog(struct jfs_log *log, struct tblock *tblk,
+		struct commit *cd);
  static void txUpdateMap(struct tblock * tblk);
  static void txRelease(struct tblock * tblk);
  static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
@@ -1256,8 +1256,7 @@ int txCommit(tid_t tid,		/* transaction identifier */
  	 *
  	 * txUpdateMap() resets XAD_NEW in XAD.
  	 */
-	if ((rc = txLog(log, tblk, &cd)))
-		goto TheEnd;
+	txLog(log, tblk, &cd);
   	/*
  	 * Ensure that inode isn't reused before
@@ -1365,9 +1364,8 @@ int txCommit(tid_t tid,		/* transaction identifier */
   *
   * RETURN :
   */
-static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
+static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
  {
-	int rc = 0;
  	struct inode *ip;
  	lid_t lid;
  	struct tlock *tlck;
@@ -1414,7 +1412,7 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
  		}
  	}
  -	return rc;
+	return;
  }
   /*
@@ -1422,10 +1420,9 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
   *
   * function:	log inode tlock and format maplock to update bmap;
   */
-static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-		 struct tlock * tlck, struct commit * cd)
+static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+		 struct tlock *tlck, struct commit *cd)
  {
-	int rc = 0;
  	struct metapage *mp;
  	pxd_t *pxd;
  	struct pxd_lock *pxdlock;
@@ -1527,7 +1524,7 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
  	}
  #endif				/* _JFS_WIP */
  -	return rc;
+	return;
  }
   /*
@@ -1535,8 +1532,8 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
   *
   * function:	log data tlock
   */
-static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
-	    struct tlock * tlck)
+static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
+	    struct tlock *tlck)
  {
  	struct metapage *mp;
  	pxd_t *pxd;
@@ -1562,7 +1559,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
  		metapage_homeok(mp);
  		discard_metapage(mp);
  		tlck->mp = NULL;
-		return 0;
+		return;
  	}
   	PXDaddress(pxd, mp->index);
@@ -1573,7 +1570,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
  	/* mark page as homeward bound */
  	tlck->flag |= tlckWRITEPAGE;
  -	return 0;
+	return;
  }
   /*
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Jfs-discussion] [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
  2021-02-08 15:05 ` Dave Kleikamp
@ 2021-02-08 15:12   ` Dave Kleikamp
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Kleikamp @ 2021-02-08 15:12 UTC (permalink / raw)
  To: Yang Li; +Cc: jfs-discussion, linux-kernel

I just realized I mangled some whitespace trying to mail this through
Thunderbird. I'll repost it the right way.

Shaggy

On 2/8/21 9:05 AM, Dave Kleikamp wrote:
> On 2/7/21 2:32 AM, Yang Li wrote:
>> These functions always return '0' and no callers use the return value.
>> So make it a void function.
>>
>> This eliminates the following coccicheck warning:
>> ./fs/jfs/jfs_txnmgr.c:1365:5-7: Unneeded variable: "rc". Return "0" on
>> line 1414
>> ./fs/jfs/jfs_txnmgr.c:1422:5-7: Unneeded variable: "rc". Return "0" on
>> line 1527
>>
>> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
>> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
>> ---
>>
>> Changes in v2
>> -turn functions forward references to void type.
>>
>>   fs/jfs/jfs_txnmgr.c | 32 +++++++++++++++-----------------
>>   1 file changed, 15 insertions(+), 17 deletions(-)
> 
> This patch missed fixing a call to txLog() which did check the return 
> value. I took the liberty of fixing it here.
> 
> 
> jfs: turn diLog(), dataLog() and txLog() into void functions
> 
> These functions always return '0' and no callers use the return value.
> So make it a void function.
> 
> This eliminates the following coccicheck warning:
> ./fs/jfs/jfs_txnmgr.c:1365:5-7: Unneeded variable: "rc". Return "0" on
> line 1414
> ./fs/jfs/jfs_txnmgr.c:1422:5-7: Unneeded variable: "rc". Return "0" on
> line 1527
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> ---
>   fs/jfs/jfs_txnmgr.c | 35 ++++++++++++++++-------------------
>   1 file changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
> index dca8edd2378c..053295cd7bc6 100644
> --- a/fs/jfs/jfs_txnmgr.c
> +++ b/fs/jfs/jfs_txnmgr.c
> @@ -148,10 +148,10 @@ static struct {
>   /*
>    * forward references
>    */
> -static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd 
> * lrd,
> -        struct tlock * tlck, struct commit * cd);
> -static int dataLog(struct jfs_log * log, struct tblock * tblk, struct 
> lrd * lrd,
> -        struct tlock * tlck);
> +static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd 
> *lrd,
> +        struct tlock *tlck, struct commit *cd);
> +static void dataLog(struct jfs_log *log, struct tblock *tblk, struct 
> lrd *lrd,
> +        struct tlock *tlck);
>   static void dtLog(struct jfs_log * log, struct tblock * tblk, struct 
> lrd * lrd,
>           struct tlock * tlck);
>   static void mapLog(struct jfs_log * log, struct tblock * tblk, struct 
> lrd * lrd,
> @@ -159,8 +159,8 @@ static void mapLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>   static void txAllocPMap(struct inode *ip, struct maplock * maplock,
>           struct tblock * tblk);
>   static void txForce(struct tblock * tblk);
> -static int txLog(struct jfs_log * log, struct tblock * tblk,
> -        struct commit * cd);
> +static void txLog(struct jfs_log *log, struct tblock *tblk,
> +        struct commit *cd);
>   static void txUpdateMap(struct tblock * tblk);
>   static void txRelease(struct tblock * tblk);
>   static void xtLog(struct jfs_log * log, struct tblock * tblk, struct 
> lrd * lrd,
> @@ -1256,8 +1256,7 @@ int txCommit(tid_t tid,        /* transaction 
> identifier */
>        *
>        * txUpdateMap() resets XAD_NEW in XAD.
>        */
> -    if ((rc = txLog(log, tblk, &cd)))
> -        goto TheEnd;
> +    txLog(log, tblk, &cd);
>        /*
>        * Ensure that inode isn't reused before
> @@ -1365,9 +1364,8 @@ int txCommit(tid_t tid,        /* transaction 
> identifier */
>    *
>    * RETURN :
>    */
> -static int txLog(struct jfs_log * log, struct tblock * tblk, struct 
> commit * cd)
> +static void txLog(struct jfs_log *log, struct tblock *tblk, struct 
> commit *cd)
>   {
> -    int rc = 0;
>       struct inode *ip;
>       lid_t lid;
>       struct tlock *tlck;
> @@ -1414,7 +1412,7 @@ static int txLog(struct jfs_log * log, struct 
> tblock * tblk, struct commit * cd)
>           }
>       }
>   -    return rc;
> +    return;
>   }
>    /*
> @@ -1422,10 +1420,9 @@ static int txLog(struct jfs_log * log, struct 
> tblock * tblk, struct commit * cd)
>    *
>    * function:    log inode tlock and format maplock to update bmap;
>    */
> -static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd 
> * lrd,
> -         struct tlock * tlck, struct commit * cd)
> +static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd 
> *lrd,
> +         struct tlock *tlck, struct commit *cd)
>   {
> -    int rc = 0;
>       struct metapage *mp;
>       pxd_t *pxd;
>       struct pxd_lock *pxdlock;
> @@ -1527,7 +1524,7 @@ static int diLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>       }
>   #endif                /* _JFS_WIP */
>   -    return rc;
> +    return;
>   }
>    /*
> @@ -1535,8 +1532,8 @@ static int diLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>    *
>    * function:    log data tlock
>    */
> -static int dataLog(struct jfs_log * log, struct tblock * tblk, struct 
> lrd * lrd,
> -        struct tlock * tlck)
> +static void dataLog(struct jfs_log *log, struct tblock *tblk, struct 
> lrd *lrd,
> +        struct tlock *tlck)
>   {
>       struct metapage *mp;
>       pxd_t *pxd;
> @@ -1562,7 +1559,7 @@ static int dataLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>           metapage_homeok(mp);
>           discard_metapage(mp);
>           tlck->mp = NULL;
> -        return 0;
> +        return;
>       }
>        PXDaddress(pxd, mp->index);
> @@ -1573,7 +1570,7 @@ static int dataLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>       /* mark page as homeward bound */
>       tlck->flag |= tlckWRITEPAGE;
>   -    return 0;
> +    return;
>   }
>    /*

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-08 16:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-07  8:32 [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions Yang Li
2021-02-07 10:16 ` kernel test robot
2021-02-07 10:16   ` kernel test robot
2021-02-07 12:06 ` kernel test robot
2021-02-07 12:06   ` kernel test robot
2021-02-08 15:05 ` Dave Kleikamp
2021-02-08 15:12   ` [Jfs-discussion] " Dave Kleikamp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.