Whamcloud - gitweb
EX-5678 mmp: don't use O_RDWR in ext2fs_mmp_read 32/48432/2
authorLi Dongyang <dongyangli@ddn.com>
Mon, 5 Sep 2022 00:27:34 +0000 (10:27 +1000)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 5 Sep 2022 01:43:34 +0000 (01:43 +0000)
commit86477112767c3d3377a8af0cb0541d69cd485f7a
tree5db2df1a5eff423d6dad85a31e9ae7ffc9916a00
parentb4450eadfa09dfdedd322af19ba3601335608632
EX-5678 mmp: don't use O_RDWR in ext2fs_mmp_read

It doesn't seem to be necessary since ext2fs_mmp_write doesn't write
via mmp_fd, and opening the block device with O_RDWR will trigger
udev.

Triggering udev is bad because it leads to an infinite loop when
running dumpe2fs in response to a udev event.

[ Rebased onto the maint branch, and added O_RDONLY flag.  From the
  open(2) man page: "The argument flags must include one of the
  following access modes: O_RDONLY, O_WRONLY, or O_RDWR." -- TYT ]

E2fsprogs-commit: 5cc83a2e5d2f3ec19462529c4144a2993b0c86e4

Change-Id: Iddecf0f18b584051ec064d39719254842552cc45
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/48432
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lib/ext2fs/mmp.c