Skip to contentSkip to conversation

ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle

PATCH Applied Eric Sandeen 2 participants 2 messages Oct 25, 2011 – Oct 26, 2011 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle

ext4_mark_iloc_dirty() says:

* The caller must have previously called ext4_reserve_inode_write().
* Give this, we know that the caller already has write access to iloc->bh.

ext4_xattr_set_handle, however, just open-codes it. May as well use the helper function for consistency.

No bug here, just tidiness.

(Note: on cleanup path, ext4_reserve_inode_write sets the bh to NULL if it returns an error, and brelse() of a null bh is handled gracefully).

---

fs/ext4/xattr.c +0 -3
index c757adc..eefbdb0 100644
@@ -985,11 +985,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
 	no_expand = ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND);
 	ext4_set_inode_state(inode, EXT4_STATE_NO_EXPAND);
 
-	error = ext4_get_inode_loc(inode, &is.iloc);
-	if (error)
-		goto cleanup;
maintainer Applied
#1 lore raw
Quoted 8 lines · Eric Sandeen

ext4_mark_iloc_dirty() says:

* The caller must have previously called ext4_reserve_inode_write().
* Give this, we know that the caller already has write access to iloc->bh.

ext4_xattr_set_handle, however, just open-codes it. May as well use the helper function for consistency.

Quoted 7 lines

No bug here, just tidiness.

(Note: on cleanup path, ext4_reserve_inode_write sets the bh to NULL if it returns an error, and brelse() of a null bh is handled gracefully).

Applied, thanks.

- Ted