1
0
Fork 0
forked from nuttx/nuttx-update
local-nuttx-update/fs
chao.an 32bf92c5c3 fs/unionfs: remove excessive protection to avoid deadlock
Deadlock during recursive access if unionfs overlays procfs,
check the critical segment only and remove the useless protection part.

|#0  unionfs_statfs (mountpt=0xf3df4540, buf=0xf3de2f0c) at unionfs/fs_unionfs.c:2136
...
|#6  0x08069429 in procfs_read (filep=0xf3df4574, buffer=0xf3df4610 "...", buflen=1024) at procfs/fs_procfs.c:412
|#7  0x0806c339 in unionfs_read (filep=0xf3de219c, buffer=0xf3df4610 "...", buflen=1024) at unionfs/fs_unionfs.c:1026

original call stack:
(gdb) bt
|#0  unionfs_statfs (mountpt=0xf3df4540, buf=0xf3de2f0c) at unionfs/fs_unionfs.c:2136
|#1  0x08071629 in mountpoint_filter (node=0xf3df4540, dirpath=0xf3df4a28 "/proc", arg=0xf3de2fc4) at mount/fs_foreachmountpoint.c:119
|#2  0x0807171b in foreach_inodelevel (node=0xf3df4540, info=0xf3df4a20) at inode/fs_foreachinode.c:90
|#3  0x08071898 in foreach_inode (handler=0x8071530 <mountpoint_filter>, arg=0xf3de2fc4) at inode/fs_foreachinode.c:193
|#4  0x080716c1 in foreach_mountpoint (handler=0x8070e2f <blocks_entry>, arg=0xf3de300c) at mount/fs_foreachmountpoint.c:169
|#5  0x08071399 in mount_read (filep=0xf3df4574, buffer=0xf3df4610 "...", buflen=1024) at mount/fs_procfs_mount.c:537
|#6  0x08069429 in procfs_read (filep=0xf3df4574, buffer=0xf3df4610 "...", buflen=1024) at procfs/fs_procfs.c:412
|#7  0x0806c339 in unionfs_read (filep=0xf3de219c, buffer=0xf3df4610 "...", buflen=1024) at unionfs/fs_unionfs.c:1026
|#8  0x080657a2 in file_read (filep=0xf3de219c, buf=0xf3df4610, nbytes=1024) at vfs/fs_read.c:110
|#9  0x0806581a in nx_read (fd=3, buf=0xf3df4610, nbytes=1024) at vfs/fs_read.c:175
|#10 0x08065847 in read (fd=3, buf=0xf3df4610, nbytes=1024) at vfs/fs_read.c:206
|#11 0x0805a242 in nsh_catfile (vtbl=0xf3df3f10, cmd=0xf3df4378 "df", filepath=0x808d5ed "/proc/fs/blocks") at nsh_fsutils.c:116
|#12 0x0805b1de in cmd_df (vtbl=0xf3df3f10, argc=1, argv=0xf3de32c0) at nsh_mntcmds.c:73
|#13 0x08056370 in nsh_command (vtbl=0xf3df3f10, argc=1, argv=0xf3de32c0) at nsh_command.c:1061
|#14 0x08053b16 in nsh_execute (vtbl=0xf3df3f10, argc=1, argv=0xf3de32c0, redirfile=0x0, oflags=0) at nsh_parse.c:741
|#15 0x08055998 in nsh_parse_command (vtbl=0xf3df3f10, cmdline=0xf3df4378 "df") at nsh_parse.c:2578
|#16 0x08055a7b in nsh_parse (vtbl=0xf3df3f10, cmdline=0xf3df4378 "df") at nsh_parse.c:2662
|#17 0x0805d691 in nsh_session (pstate=0xf3df3f10, login=1 '\001', argc=1, argv=0xf3de34b0) at nsh_session.c:191
|#18 0x0805b542 in nsh_consolemain (argc=1, argv=0xf3de34b0) at nsh_consolemain.c:115
|#19 0x0805346c in nsh_main (argc=1, argv=0xf3de34b0) at nsh_main.c:168
|#20 0x0805075a in nxtask_startup (entrypt=0x805340a <nsh_main>, argc=1, argv=0xf3de34b0) at sched/task_startup.c:165
|#21 0x08049713 in nxtask_start () at task/task_start.c:144
|#22 0x00000000 in ?? ()

Change-Id: Ic4c7aff0ea50388a371c525745e817a787dabcca
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-15 09:50:29 -06:00
..
aio sched/: Make more naming consistent 2020-05-17 14:01:00 -03:00
binfs fs/binfs/fs_binfs.c: Fix a syslog format 2020-11-25 05:11:26 -08:00
cromfs fs/cromfs/fs_cromfs.c: Fix a syslog format 2020-11-24 22:31:33 -08:00
dirent fs: Add the relative path support 2020-09-24 03:13:27 -07:00
driver Change all files come from Xiaomi/Pinecone to Apache License 2.0 2020-08-22 17:37:21 -06:00
fat fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
hostfs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
inode fs: flashback to release all file descriptors in group to increase debugging time. 2020-11-17 18:54:31 -08:00
littlefs fs/littlefs: enable the low level log only on debug mode 2020-08-18 12:13:32 +01:00
mmap fs/mmap/fs_mmap.c: Fix a syslog format error 2020-11-20 22:22:53 -08:00
mount fs: add missing macro 'CONFIG_FS_HOSTFS' for 'NODFS_SUPPORT'. 2020-10-17 23:22:35 +08:00
mqueue Fix inverted errno in mq_open 2020-08-20 20:35:16 -03:00
nfs fs/nfs/nfs_vfsops.c: Fix syslog formats 2020-11-25 05:11:26 -08:00
nxffs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
partition Change all files come from Xiaomi/Pinecone to Apache License 2.0 2020-08-22 17:37:21 -06:00
procfs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
romfs fs/romfs/fs_romfsutil.c: Fix syslog formats 2020-11-21 19:38:32 -08:00
semaphore Check return from nxsem_wait_initialize() 2020-03-30 17:09:45 +01:00
shm fs/: Remove dangling space at the end of lines. 2017-06-28 13:17:55 -06:00
smartfs fs: fully parenthesize MIN and MAX macros 2020-12-08 12:58:40 -06:00
spiffs fs/spiffs/src/spiffs_core.c: Don't assume finfo() is a macro 2020-12-06 09:03:09 -06:00
tmpfs Change all 'Nuttx' to 'NuttX' 2020-10-20 01:45:06 -07:00
unionfs fs/unionfs: remove excessive protection to avoid deadlock 2020-12-15 09:50:29 -06:00
userfs fs/userfs/fs_userfs.c: Fix syslog formats 2020-11-24 22:31:33 -08:00
vfs fs/vfs/fs_epoll.c: Fix syslog formats 2020-11-20 22:22:53 -08:00
fs_initialize.c Remove some block comments before empty code sections 2016-04-11 18:16:04 -06:00
Kconfig vfs/epoll: add epoll_create1(2) implement 2020-08-17 23:41:13 -05:00
Makefile style/Makefile: remove unnecessary trailing whitespace 2020-11-28 12:20:30 +01:00