public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Running out of inode flags in ext4
@ 2024-02-05 10:08 Ojaswin Mujoo
  2024-02-05 16:32 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Ojaswin Mujoo @ 2024-02-05 10:08 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, linux-kernel, jack, ritesh.list, john.g.garry, djwong

Hi folks,

I'm trying to rework the ext4 atomic write patchset so we have similar
semantics as discussed here [1], which would look something like:

1. we call FS_IOC_FSSETXATTR to enable atomic write on inode

2. In the setxattr path, we need to mark the inode with
atomic_write_enabled. XFS does it via an on disk inode flag which is
straightforward enough 

However, on ext4 we are almost out of 32 bits of inode flags and I don't
think it's possible to add any flags2 field or something (iiuc, ondisk
indoe doesn't have scope for expansion).

Some ideas that I have:

- I see that 0x00400000 (formerly EXT4_EOFBLOCKS_FL) is free to use but
	as per my understanding, this is interpreted in some way by older fsck
	versions. However, marking atomic writes as RO_COMPAT might help aavoid
	confusion in fsck.

- If we can't use inode flags, should we maybe use xattr to store
	atomic_write details?
	
Should I go with either of above or is there a better way to mark
ext4 inodes which I might be missing. Also, now that we are out of inode
flags, what's the recommended way to handle such use cases in the
future?

Would appreciate some suggestions on this.

Thanks,
ojaswin

[1]
https://lore.kernel.org/all/20240124142645.9334-4-john.g.garry@oracle.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Running out of inode flags in ext4
  2024-02-05 10:08 Running out of inode flags in ext4 Ojaswin Mujoo
@ 2024-02-05 16:32 ` Theodore Ts'o
  2024-02-06  5:13   ` Ojaswin Mujoo
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2024-02-05 16:32 UTC (permalink / raw)
  To: Ojaswin Mujoo
  Cc: linux-ext4, linux-kernel, jack, ritesh.list, john.g.garry, djwong

On Mon, Feb 05, 2024 at 03:38:54PM +0530, Ojaswin Mujoo wrote:
> Hi folks,
> 
> I'm trying to rework the ext4 atomic write patchset so we have similar
> semantics as discussed here [1], which would look something like:
> 
> 1. we call FS_IOC_FSSETXATTR to enable atomic write on inode
> 
> 2. In the setxattr path, we need to mark the inode with
> atomic_write_enabled. XFS does it via an on disk inode flag which is
> straightforward enough 
> 
> However, on ext4 we are almost out of 32 bits of inode flags and I don't
> think it's possible to add any flags2 field or something (iiuc, ondisk
> indoe doesn't have scope for expansion).

We still have some unused flags.  For example,
0x01000000. 0x04000000. and 0x08000000 are still unused.  We are
starting to get close to full, so we need to be a bit careful since it
is very much a limited resource.  But we're not yet at the point where
we need to worry about trying to reuse flags like EXT4_EOFBLOCKS_FL.

Cheers,

							- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Running out of inode flags in ext4
  2024-02-05 16:32 ` Theodore Ts'o
@ 2024-02-06  5:13   ` Ojaswin Mujoo
  0 siblings, 0 replies; 3+ messages in thread
From: Ojaswin Mujoo @ 2024-02-06  5:13 UTC (permalink / raw)
  To: Theodore Ts'o, g
  Cc: linux-ext4, linux-kernel, jack, ritesh.list, john.g.garry, djwong

On Mon, Feb 05, 2024 at 11:32:49AM -0500, Theodore Ts'o wrote:
> On Mon, Feb 05, 2024 at 03:38:54PM +0530, Ojaswin Mujoo wrote:
> > Hi folks,
> > 
> > I'm trying to rework the ext4 atomic write patchset so we have similar
> > semantics as discussed here [1], which would look something like:
> > 
> > 1. we call FS_IOC_FSSETXATTR to enable atomic write on inode
> > 
> > 2. In the setxattr path, we need to mark the inode with
> > atomic_write_enabled. XFS does it via an on disk inode flag which is
> > straightforward enough 
> > 
> > However, on ext4 we are almost out of 32 bits of inode flags and I don't
> > think it's possible to add any flags2 field or something (iiuc, ondisk
> > indoe doesn't have scope for expansion).
> 
> We still have some unused flags.  For example,
> 0x01000000. 0x04000000. and 0x08000000 are still unused.  We are
> starting to get close to full, so we need to be a bit careful since it
> is very much a limited resource.  But we're not yet at the point where
> we need to worry about trying to reuse flags like EXT4_EOFBLOCKS_FL.
Hi Ted,

Thats true, i don't even know how I missed that :) Sorry for the noise.

Regards,
ojaswin
> 
> Cheers,
> 
> 							- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-06  5:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 10:08 Running out of inode flags in ext4 Ojaswin Mujoo
2024-02-05 16:32 ` Theodore Ts'o
2024-02-06  5:13   ` Ojaswin Mujoo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox