linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle
@ 2011-10-25 17:52 Eric Sandeen
  2011-10-26  7:40 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2011-10-25 17:52 UTC (permalink / raw)
  To: ext4 development

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).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index c757adc..eefbdb0 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -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;

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

* Re: [PATCH] ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle
  2011-10-25 17:52 [PATCH] ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle Eric Sandeen
@ 2011-10-26  7:40 ` Ted Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-10-26  7:40 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On Tue, Oct 25, 2011 at 12:52:09PM -0500, Eric Sandeen wrote:
> 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).
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Applied, thanks.

					- Ted

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

end of thread, other threads:[~2011-10-26  7:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 17:52 [PATCH] ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle Eric Sandeen
2011-10-26  7:40 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).