Bug 202883
Summary: | sometime dead lock in getdents64 | ||
---|---|---|---|
Product: | File System | Reporter: | Jiqun Li (jiqun.li) |
Component: | f2fs | Assignee: | Default virtual assignee for f2fs (filesystem_f2fs) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | chao |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | f2fs-dev | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Jiqun Li
2019-03-12 06:41:08 UTC
for task 9709, do_page_fault() is triggered by __put_user_unaligned() in compat_filldir64(). static int compat_filldir64(struct dir_context *ctx, const char *name, int namlen, loff_t offset, u64 ino, unsigned int d_type) { ..... if (dirent) { if (__put_user_unaligned(offset, &dirent->d_off)) goto efault; } dirent is a local array[] in user space, when want to access dirent->d_off, do_page_fault() is triggered and want to alloc real memory. dirent is a valid user space address Hi Jiqun, I just sent one patch for that, could you try the patch? [PATCH] f2fs: fix to avoid deadlock in f2fs_read_inline_dir() The solution is very similar to what we did in another patch as below, we just take off the lock directly, since it's unneeded. f2fs: no need to take page lock in readdir https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=f3d42f6e5087a4b3a52ee4008734af93519dec06 thanks, I got it I will try it The fixing patch has been merged, close this issue. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aadcef64b22f668c1a107b86d3521d9cac915c24 |