mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Attempted mounting read-only after failed permission to read-write
If a partition image could not be opened read-write, retry as read-only
This commit is contained in:
parent
d52b1ca929
commit
2514ce6a42
@ -143,6 +143,9 @@ static int ntfs_device_unix_io_open(struct ntfs_device *dev, int flags)
|
||||
*(int*)dev->d_private = open(dev->d_name, flags);
|
||||
if (*(int*)dev->d_private == -1) {
|
||||
err = errno;
|
||||
/* if permission error and rw, retry read-only */
|
||||
if ((err == EACCES) && ((flags & O_RDWR) == O_RDWR))
|
||||
err = EROFS;
|
||||
goto err_out;
|
||||
}
|
||||
#ifdef HAVE_LINUX_FS_H
|
||||
|
@ -529,7 +529,7 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev,
|
||||
dev->d_name);
|
||||
goto error_exit;
|
||||
} else {
|
||||
ntfs_log_info("Can only open '%s' as read-only\n",
|
||||
ntfs_log_info("Error opening '%s' read-write\n",
|
||||
dev->d_name);
|
||||
NVolSetReadOnly(vol);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user