Re: [f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Omar Sandoval
On Fri, Feb 15, 2019 at 01:57:39AM +, Hans van Kranenburg wrote: > Hi, > > On 2/14/19 11:00 AM, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Since statx was added in 4.11, userspace has had an interface for > > reading btime (file creation time), but no way to set it. This RFC patch

Re: [f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Omar Sandoval
On Fri, Feb 15, 2019 at 11:16:57AM +1100, Dave Chinner wrote: > On Thu, Feb 14, 2019 at 03:14:29PM -0800, Omar Sandoval wrote: > > On Fri, Feb 15, 2019 at 09:06:26AM +1100, Dave Chinner wrote: > > > On Thu, Feb 14, 2019 at 02:00:07AM -0800, Omar Sandoval wrote: > > > > From: Omar Sandoval > > > >

Re: [f2fs-dev] [PATCH] f2fs: do not use mutex lock in atomic context

2019-02-14 Thread Ritesh Harjani
On 2/14/2019 9:40 PM, Chao Yu wrote: On 2019-2-14 15:46, Sahitya Tummala wrote: On Wed, Feb 13, 2019 at 11:25:31AM +0800, Chao Yu wrote: On 2019/2/4 16:06, Sahitya Tummala wrote: Fix below warning coming because of using mutex lock in atomic context. BUG: sleeping function called from

[f2fs-dev] [RFC PATCH 4/6] ext4: add support for setting btime

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval The ext4 inode format includes btime (under the name crtime) if the inode is large enough (256 bytes). Signed-off-by: Omar Sandoval --- fs/ext4/inode.c | 15 +-- fs/ext4/super.c | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git

[f2fs-dev] [RFC PATCH 5/6] f2fs: add support for setting btime

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval The f2fs inode format includes btime (under the name crtime) if the feature was enabled at mkfs time. Signed-off-by: Omar Sandoval --- fs/f2fs/file.c | 19 +++ fs/f2fs/super.c | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git

[f2fs-dev] [RFC PATCH 6/6] xfs: add support for setting btime

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval The XFS inode format includes btime (under the name crtime) in inode version 3. Also update the comments in libxfs to reflect that di_crtime can now change. Signed-off-by: Omar Sandoval --- fs/xfs/libxfs/xfs_format.h | 2 +- fs/xfs/libxfs/xfs_log_format.h | 2 +-

[f2fs-dev] [PATCH] utimensat2: document AT_UTIME_BTIME

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval Signed-off-by: Omar Sandoval --- man2/utimensat.2 | 38 +- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/man2/utimensat.2 b/man2/utimensat.2 index d61b43e96..3b7c62181 100644 --- a/man2/utimensat.2 +++ b/man2/utimensat.2

[f2fs-dev] [PATCH] xfs_io: add AT_UTIME_BTIME support

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval In order to test updating btime, make the utimes command optionally take the btime timestamp. Signed-off-by: Omar Sandoval --- io/utimes.c | 41 +++-- man/man8/xfs_io.8 | 5 +++-- 2 files changed, 34 insertions(+), 12 deletions(-)

[f2fs-dev] [RFC PATCH 3/6] Btrfs: add support for setting btime

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval The Btrfs inode format has always included btime (under the name otime), so setting it is trivial. Signed-off-by: Omar Sandoval --- fs/btrfs/inode.c | 2 ++ fs/btrfs/super.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c

[f2fs-dev] [RFC PATCH 2/6] fs: add AT_UTIME_BTIME for utimensat()

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval Now that we have a btime iattr, use it to allow updating btime from utimensat(). We do so by adding a new AT_UTIME_BTIME flag. Iff this flag is given, the btime is set to times[2] (unless times is NULL, in which case the current time is used). Signed-off-by: Omar Sandoval

[f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval Hi, Since statx was added in 4.11, userspace has had an interface for reading btime (file creation time), but no way to set it. This RFC patch series adds support for changing btime with utimensat(). Patch 1 adds the VFS infrastructure, patch 2 adds the support to

[f2fs-dev] [RFC PATCH 1/6] fs: add btime to struct iattr

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval Add btime as an attribute that can be updated through notify_change() if the filesystem supports it, which is indicated by FS_HAS_BTIME in file_system_type->fs_flags. Signed-off-by: Omar Sandoval --- fs/attr.c | 6 ++ include/linux/fs.h | 4 2 files

[f2fs-dev] [PATCH] generic: add a test for AT_UTIME_BTIME

2019-02-14 Thread Omar Sandoval
From: Omar Sandoval Test that on filesystems supporting btime, the timestamp is updated as expected. Signed-off-by: Omar Sandoval --- common/rc | 14 ++ tests/generic/526 | 64 +++ tests/generic/526.out | 14 ++

[f2fs-dev] [PATCH v2] f2fs: fix to check inline_xattr_size boundary correctly

2019-02-14 Thread Chao Yu
From: Chao Yu We use below condition to check inline_xattr_size boundary: if (!F2FS_OPTION(sbi).inline_xattr_size || F2FS_OPTION(sbi).inline_xattr_size >= DEF_ADDRS_PER_INODE - F2FS_TOTAL_EXTRA_ATTR_SIZE -

[f2fs-dev] [PATCH] f2fs: don't allow negative ->write_io_size_bits

2019-02-14 Thread Chao Yu
From: Chao Yu As Dan reported: "We put an upper bound on ->write_io_size_bits but we don't have a lower bound." So let's add lower bound check for ->write_io_size_bits in parse_options(). [We don't allow configuring ->write_io_size_bits to zero, since at least we need to fill one dummy page

Re: [f2fs-dev] [PATCH] f2fs: do not use mutex lock in atomic context

2019-02-14 Thread Chao Yu
On 2019-2-14 15:46, Sahitya Tummala wrote: > On Wed, Feb 13, 2019 at 11:25:31AM +0800, Chao Yu wrote: >> On 2019/2/4 16:06, Sahitya Tummala wrote: >>> Fix below warning coming because of using mutex lock in atomic context. >>> >>> BUG: sleeping function called from invalid context at >>>

Re: [f2fs-dev] [PATCH] f2fs: don't allow negative ->write_io_size_bits

2019-02-14 Thread Chao Yu
On 2019-2-13 17:46, Dan Carpenter wrote: > On Wed, Feb 13, 2019 at 04:49:57PM +0800, Chao Yu wrote: >> On 2019/2/13 11:32, Chao Yu wrote: >>> On 2019/2/12 2:45, Dan Carpenter wrote: We put an upper bound on ->write_io_size_bits but we don't have a lower bound. >>> >>> Oh, lower bound, I

Re: [f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Dave Chinner
On Thu, Feb 14, 2019 at 02:00:07AM -0800, Omar Sandoval wrote: > From: Omar Sandoval > > Hi, > > Since statx was added in 4.11, userspace has had an interface for > reading btime (file creation time), but no way to set it. This RFC patch > series adds support for changing btime with

Re: [f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Hans van Kranenburg
Hi, On 2/14/19 11:00 AM, Omar Sandoval wrote: > From: Omar Sandoval > > Since statx was added in 4.11, userspace has had an interface for > reading btime (file creation time), but no way to set it. This RFC patch > series adds support for changing btime with utimensat(). Patch 1 adds > the VFS

Re: [f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Omar Sandoval
On Fri, Feb 15, 2019 at 09:06:26AM +1100, Dave Chinner wrote: > On Thu, Feb 14, 2019 at 02:00:07AM -0800, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Hi, > > > > Since statx was added in 4.11, userspace has had an interface for > > reading btime (file creation time), but no way to set

Re: [f2fs-dev] [RFC PATCH 0/6] Allow setting file birth time with utimensat()

2019-02-14 Thread Dave Chinner
On Thu, Feb 14, 2019 at 03:14:29PM -0800, Omar Sandoval wrote: > On Fri, Feb 15, 2019 at 09:06:26AM +1100, Dave Chinner wrote: > > On Thu, Feb 14, 2019 at 02:00:07AM -0800, Omar Sandoval wrote: > > > From: Omar Sandoval > > > > > > Hi, > > > > > > Since statx was added in 4.11, userspace has

[f2fs-dev] [PATCH] vfs: don't decrement i_nlink in d_tmpfile

2019-02-14 Thread Darrick J. Wong
From: Darrick J. Wong d_tmpfile was introduced to instantiate an inode in the dentry cache as a temporary file. This helper decrements the inode's nlink count and dirties the inode, presumably so that filesystems could call new_inode to create a new inode with nlink == 1 and then call d_tmpfile