[PATCH] lib/nilfs.c: remove broken readonly fs check at nilfs_sync()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nilfs_sync() API function is wrongly checking EROFS error.  It sees
the return value of ioctl instead of errno variable.  This removes the
broken error check from nilfs_sync() instead of fixing it because
EROFS should by rights be used or ignored by callers.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxxxxxx>
---
 lib/nilfs.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lib/nilfs.c b/lib/nilfs.c
index 05b9b03..c1771e8 100644
--- a/lib/nilfs.c
+++ b/lib/nilfs.c
@@ -688,19 +688,12 @@ int nilfs_clean_segments(struct nilfs *nilfs,
  */
 int nilfs_sync(const struct nilfs *nilfs, nilfs_cno_t *cnop)
 {
-	int ret;
-
 	if (nilfs->n_iocfd < 0) {
 		errno = EBADF;
 		return -1;
 	}
 
-	ret = ioctl(nilfs->n_iocfd, NILFS_IOCTL_SYNC, cnop);
-	if (ret < 0 && ret == -EROFS)
-		/* syncing read-only filesystem */
-		ret = 0;
-
-	return ret;
+	return ioctl(nilfs->n_iocfd, NILFS_IOCTL_SYNC, cnop);
 }
 
 /**
-- 
1.7.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux BTRFS]     [Linux CIFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux