|
56 | 56 |
|
57 | 57 | #include <linux/buffer_head.h>
|
58 | 58 | #include <linux/init.h>
|
| 59 | +#include <linux/printk.h> |
59 | 60 | #include <linux/slab.h>
|
60 | 61 | #include <linux/mbcache.h>
|
61 | 62 | #include <linux/quotaops.h>
|
|
84 | 85 | printk("\n"); \
|
85 | 86 | } while (0)
|
86 | 87 | #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) |
89 | 90 | #endif
|
90 | 91 |
|
91 | 92 | static int ext2_xattr_set2(struct inode *, struct buffer_head *,
|
@@ -790,7 +791,15 @@ ext2_xattr_delete_inode(struct inode *inode)
|
790 | 791 | struct buffer_head *bh = NULL;
|
791 | 792 | struct ext2_sb_info *sbi = EXT2_SB(inode->i_sb);
|
792 | 793 |
|
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; |
794 | 803 | if (!EXT2_I(inode)->i_file_acl)
|
795 | 804 | goto cleanup;
|
796 | 805 |
|
@@ -864,8 +873,7 @@ ext2_xattr_cache_insert(struct mb_cache *cache, struct buffer_head *bh)
|
864 | 873 | true);
|
865 | 874 | if (error) {
|
866 | 875 | 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"); |
869 | 877 | error = 0;
|
870 | 878 | }
|
871 | 879 | } else
|
|
0 commit comments