Skip to content

Commit 74e934b

Browse files
committed
Merge tag 'for_v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext2/udf updates from Jan Kara: "Cleanups and fixes for ext2 and one cleanup for udf" * tag 'for_v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: fix empty body warnings when -Wextra is used ext2: fix debug reference to ext2_xattr_cache udf: udf_sb.h: Replace zero-length array with flexible-array member ext2: xattr.h: Replace zero-length array with flexible-array member ext2: Silence lockdep warning about reclaim under xattr_sem
2 parents e14679b + 44a5202 commit 74e934b

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

fs/ext2/xattr.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757
#include <linux/buffer_head.h>
5858
#include <linux/init.h>
59+
#include <linux/printk.h>
5960
#include <linux/slab.h>
6061
#include <linux/mbcache.h>
6162
#include <linux/quotaops.h>
@@ -84,8 +85,8 @@
8485
printk("\n"); \
8586
} while (0)
8687
#else
87-
# define ea_idebug(f...)
88-
# define ea_bdebug(f...)
88+
# define ea_idebug(inode, f...) no_printk(f)
89+
# define ea_bdebug(bh, f...) no_printk(f)
8990
#endif
9091

9192
static int ext2_xattr_set2(struct inode *, struct buffer_head *,
@@ -790,7 +791,15 @@ ext2_xattr_delete_inode(struct inode *inode)
790791
struct buffer_head *bh = NULL;
791792
struct ext2_sb_info *sbi = EXT2_SB(inode->i_sb);
792793

793-
down_write(&EXT2_I(inode)->xattr_sem);
794+
/*
795+
* We are the only ones holding inode reference. The xattr_sem should
796+
* better be unlocked! We could as well just not acquire xattr_sem at
797+
* all but this makes the code more futureproof. OTOH we need trylock
798+
* here to avoid false-positive warning from lockdep about reclaim
799+
* circular dependency.
800+
*/
801+
if (WARN_ON_ONCE(!down_write_trylock(&EXT2_I(inode)->xattr_sem)))
802+
return;
794803
if (!EXT2_I(inode)->i_file_acl)
795804
goto cleanup;
796805

@@ -864,8 +873,7 @@ ext2_xattr_cache_insert(struct mb_cache *cache, struct buffer_head *bh)
864873
true);
865874
if (error) {
866875
if (error == -EBUSY) {
867-
ea_bdebug(bh, "already in cache (%d cache entries)",
868-
atomic_read(&ext2_xattr_cache->c_entry_count));
876+
ea_bdebug(bh, "already in cache");
869877
error = 0;
870878
}
871879
} else

fs/ext2/xattr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct ext2_xattr_entry {
3939
__le32 e_value_block; /* disk block attribute is stored on (n/i) */
4040
__le32 e_value_size; /* size of attribute value */
4141
__le32 e_hash; /* hash value of name and value */
42-
char e_name[0]; /* attribute name */
42+
char e_name[]; /* attribute name */
4343
};
4444

4545
#define EXT2_XATTR_PAD_BITS 2

fs/udf/udf_sb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct udf_virtual_data {
8383
struct udf_bitmap {
8484
__u32 s_extPosition;
8585
int s_nr_groups;
86-
struct buffer_head *s_block_bitmap[0];
86+
struct buffer_head *s_block_bitmap[];
8787
};
8888

8989
struct udf_part_map {

0 commit comments

Comments
 (0)