Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'xfs-5.16-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:
"Fixes for a resource leak and a build robot complaint about totally
dead code:

- Fix buffer resource leak that could lead to livelock on corrupt fs.

- Remove unused function xfs_inew_wait to shut up the build robots"

* tag 'xfs-5.16-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: remove xfs_inew_wait
xfs: Fix the free logic of state in xfs_attr_node_hasname

+8 -34
+7 -10
fs/xfs/libxfs/xfs_attr.c
··· 1077 1077 1078 1078 state = xfs_da_state_alloc(args); 1079 1079 if (statep != NULL) 1080 - *statep = NULL; 1080 + *statep = state; 1081 1081 1082 1082 /* 1083 1083 * Search to see if name exists, and get back a pointer to it. 1084 1084 */ 1085 1085 error = xfs_da3_node_lookup_int(state, &retval); 1086 - if (error) { 1087 - xfs_da_state_free(state); 1088 - return error; 1089 - } 1086 + if (error) 1087 + retval = error; 1090 1088 1091 - if (statep != NULL) 1092 - *statep = state; 1093 - else 1089 + if (!statep) 1094 1090 xfs_da_state_free(state); 1091 + 1095 1092 return retval; 1096 1093 } 1097 1094 ··· 1109 1112 */ 1110 1113 retval = xfs_attr_node_hasname(args, &dac->da_state); 1111 1114 if (retval != -ENOATTR && retval != -EEXIST) 1112 - return retval; 1115 + goto error; 1113 1116 1114 1117 if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE)) 1115 1118 goto error; ··· 1334 1337 1335 1338 error = xfs_attr_node_hasname(args, state); 1336 1339 if (error != -EEXIST) 1337 - return error; 1340 + goto out; 1338 1341 error = 0; 1339 1342 1340 1343 ASSERT((*state)->path.blk[(*state)->path.active - 1].bp != NULL);
-21
fs/xfs/xfs_icache.c
··· 289 289 trace_xfs_perag_clear_inode_tag(mp, pag->pag_agno, tag, _RET_IP_); 290 290 } 291 291 292 - static inline void 293 - xfs_inew_wait( 294 - struct xfs_inode *ip) 295 - { 296 - wait_queue_head_t *wq = bit_waitqueue(&ip->i_flags, __XFS_INEW_BIT); 297 - DEFINE_WAIT_BIT(wait, &ip->i_flags, __XFS_INEW_BIT); 298 - 299 - do { 300 - prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE); 301 - if (!xfs_iflags_test(ip, XFS_INEW)) 302 - break; 303 - schedule(); 304 - } while (true); 305 - finish_wait(wq, &wait.wq_entry); 306 - } 307 - 308 292 /* 309 293 * When we recycle a reclaimable inode, we need to re-initialise the VFS inode 310 294 * part of the structure. This is made more complex by the fact we store ··· 352 368 ASSERT(!rwsem_is_locked(&inode->i_rwsem)); 353 369 error = xfs_reinit_inode(mp, inode); 354 370 if (error) { 355 - bool wake; 356 - 357 371 /* 358 372 * Re-initializing the inode failed, and we are in deep 359 373 * trouble. Try to re-add it to the reclaim list. 360 374 */ 361 375 rcu_read_lock(); 362 376 spin_lock(&ip->i_flags_lock); 363 - wake = !!__xfs_iflags_test(ip, XFS_INEW); 364 377 ip->i_flags &= ~(XFS_INEW | XFS_IRECLAIM); 365 - if (wake) 366 - wake_up_bit(&ip->i_flags, __XFS_INEW_BIT); 367 378 ASSERT(ip->i_flags & XFS_IRECLAIMABLE); 368 379 spin_unlock(&ip->i_flags_lock); 369 380 rcu_read_unlock();
+1 -3
fs/xfs/xfs_inode.h
··· 231 231 #define XFS_IRECLAIM (1 << 0) /* started reclaiming this inode */ 232 232 #define XFS_ISTALE (1 << 1) /* inode has been staled */ 233 233 #define XFS_IRECLAIMABLE (1 << 2) /* inode can be reclaimed */ 234 - #define __XFS_INEW_BIT 3 /* inode has just been allocated */ 235 - #define XFS_INEW (1 << __XFS_INEW_BIT) 234 + #define XFS_INEW (1 << 3) /* inode has just been allocated */ 236 235 #define XFS_IPRESERVE_DM_FIELDS (1 << 4) /* has legacy DMAPI fields set */ 237 236 #define XFS_ITRUNCATED (1 << 5) /* truncated down so flush-on-close */ 238 237 #define XFS_IDIRTY_RELEASE (1 << 6) /* dirty release already seen */ ··· 491 492 xfs_iflags_clear(ip, XFS_INEW); 492 493 barrier(); 493 494 unlock_new_inode(VFS_I(ip)); 494 - wake_up_bit(&ip->i_flags, __XFS_INEW_BIT); 495 495 } 496 496 497 497 static inline void xfs_setup_existing_inode(struct xfs_inode *ip)