diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 821da92fe5c2..4a986daad16b 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3314,7 +3314,13 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping, block_t blkaddr = NULL_ADDR; int err = 0; - if (trace_android_fs_datawrite_start_enabled()) { + /* + * Should avoid quota operations which can make deadlock: + * kswapd -> f2fs_evict_inode -> dquot_drop -> + * f2fs_dquot_commit -> f2fs_write_begin -> + * d_obtain_alias -> __d_alloc -> kmem_cache_alloc(GFP_KERNEL) + */ + if (trace_android_fs_datawrite_start_enabled() && !IS_NOQUOTA(inode)) { char *path, pathbuf[MAX_TRACE_PATHBUF_LEN]; path = android_fstrace_get_pathname(pathbuf,