@@ -1379,7 +1379,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
13791379 return error ;
13801380}
13811381
1382- static int ea_dealloc_block (struct gfs2_inode * ip )
1382+ static int ea_dealloc_block (struct gfs2_inode * ip , bool initialized )
13831383{
13841384 struct gfs2_sbd * sdp = GFS2_SB (& ip -> i_inode );
13851385 struct gfs2_rgrpd * rgd ;
@@ -1412,7 +1412,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
14121412 ip -> i_eattr = 0 ;
14131413 gfs2_add_inode_blocks (& ip -> i_inode , -1 );
14141414
1415- if (likely (! test_bit ( GIF_ALLOC_FAILED , & ip -> i_flags )) ) {
1415+ if (initialized ) {
14161416 error = gfs2_meta_inode_buffer (ip , & dibh );
14171417 if (!error ) {
14181418 gfs2_trans_add_meta (ip -> i_gl , dibh );
@@ -1431,11 +1431,12 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
14311431/**
14321432 * gfs2_ea_dealloc - deallocate the extended attribute fork
14331433 * @ip: the inode
1434+ * @initialized: xattrs have been initialized
14341435 *
14351436 * Returns: errno
14361437 */
14371438
1438- int gfs2_ea_dealloc (struct gfs2_inode * ip )
1439+ int gfs2_ea_dealloc (struct gfs2_inode * ip , bool initialized )
14391440{
14401441 int error ;
14411442
@@ -1447,7 +1448,7 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
14471448 if (error )
14481449 return error ;
14491450
1450- if (likely (! test_bit ( GIF_ALLOC_FAILED , & ip -> i_flags )) ) {
1451+ if (initialized ) {
14511452 error = ea_foreach (ip , ea_dealloc_unstuffed , NULL );
14521453 if (error )
14531454 goto out_quota ;
@@ -1459,7 +1460,7 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
14591460 }
14601461 }
14611462
1462- error = ea_dealloc_block (ip );
1463+ error = ea_dealloc_block (ip , initialized );
14631464
14641465out_quota :
14651466 gfs2_quota_unhold (ip );
0 commit comments