lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 20 Jul 2010 16:48:26 -0700 (PDT)
From:	Sage Weil <sage@...dream.net>
To:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC] FS_IOC_SYNCFS

As far as I can see, currently the only way to sync a single file system 
(and not _all_ mounted file systems) is via the BLKFLSBUF ioctl, which 
will sync_filesystem() and then invalidate_bdev().  If you _just_ want to 
sync, though, the invalidate_bdev() is unnecessary and potentially 
counter-productive.

Would it be reasonable to add a simple call like so?  Then you could

	fd = open("/path/for/some/mount", O_RDONLY);
	ioctl(fd, FS_IOC_SYNCFS);
	close(fd);

or something along those lines.
sage


diff --git a/fs/ioctl.c b/fs/ioctl.c
index 2d140a7..0bc9f7a 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -593,6 +593,9 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
 	case FS_IOC_FIEMAP:
 		return ioctl_fiemap(filp, arg);
 
+	case FS_IOC_SYNCFS:
+		return sync_filesystem(filp->f_dentry->d_sb);
+
 	case FIGETBSZ:
 	{
 		struct inode *inode = filp->f_path.dentry->d_inode;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 471e1ff..4a84d78 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -321,6 +321,7 @@ struct inodes_stat_t {
 #define	FS_IOC_GETVERSION		_IOR('v', 1, long)
 #define	FS_IOC_SETVERSION		_IOW('v', 2, long)
 #define FS_IOC_FIEMAP			_IOWR('f', 11, struct fiemap)
+#define FS_IOC_SYNCFS                   _IO('S', 12)
 #define FS_IOC32_GETFLAGS		_IOR('f', 1, int)
 #define FS_IOC32_SETFLAGS		_IOW('f', 2, int)
 #define FS_IOC32_GETVERSION		_IOR('v', 1, int)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ