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>] [day] [month] [year] [list]
Message-id: <000001cfd7cc$ad447a00$07cd6e00$@samsung.com>
Date:	Wed, 24 Sep 2014 16:53:49 +0900
From:	Namjae Jeon <namjae.jeon@...sung.com>
To:	'Dave Chinner' <david@...morbit.com>,
	'Theodore Ts'o' <tytso@....edu>,
	'Dmitry Monakhov' <dmonakhov@...nvz.org>,
	'Christoph Hellwig' <hch@...radead.org>,
	'linux-ext4' <linux-ext4@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	'Luk?? Czerner' <lczerner@...hat.com>,
	'Brian Foster' <bfoster@...hat.com>,
	'Ashish Sangwan' <a.sangwan@...sung.com>, xfs@....sgi.com
Subject: Unifying XFS_IOC_SWAPEXT and EXT4_IOC_MOV_EXT (was Re: [PATCH 2/3]
 xfs: Add support IOC_MOV_DATA ioctl)


> 
> FWIW, what we ideally need for these sorts of defrag programs is
> per-file freezing. i.e. we freeze the file to be defragged, then do
> the copy in userspace, swap/move the copied range and then unfreeze
> it once complete.  That guarantees that the file is not modified in
> any way while userspace is doing the defrag...
I am trying to unify xfs_swap extent and ext4 move extent so that both of these 
could be called via new ioctl mov_data. Both ioctl have different interface
because  both xfs and ext4 have different way of avoiding change in source file
while defrag is running. XFS uses xfs_bstat_t while ext4 performs copying of
data within kernel space after taking mutex lock.
To make them use same approach, we should use something like file sealing as
suggessted by you.
First of all, I am trying to find proper way of sealing file as suggested by
you. I am considering to use S_IMMUTABLE flag set to avoid file modification
during defrag. I am thinking of first syncing  dirty pages, then truncating
page cache pages of inode and lastly setting immutable flag of inode.
This will block further attempts of modifying the file by opening new file
pointer but already open file pointer can still change it.
Although immutable file mean file can not be modified, there is no immutable
check condition in write path and mmap path.
I am wondering it is just missing to add immutable check condition or there
is other reason I am not aware.

Thanks!
> 
> Cheers,
> 
> Dave.
> --
> Dave Chinner
> david@...morbit.com

--
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