public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3] Make inode64 a remountable option
@ 2012-08-17  2:39 Carlos Maiolino
  2012-08-17  5:04 ` Dave Chinner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Carlos Maiolino @ 2012-08-17  2:39 UTC (permalink / raw)
  To: xfs; +Cc: Carlos Maiolino

Actually, there is no reason about why a user must umount and mount a XFS
filesystem to enable 'inode64' option. So, this patch makes this a remountable
option.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/xfs/xfs_super.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index bdaf4cb..98acd26 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -120,12 +120,13 @@ mempool_t *xfs_ioend_pool;
  * in the future, too.
  */
 enum {
-	Opt_barrier, Opt_nobarrier, Opt_err
+	Opt_barrier, Opt_nobarrier, Opt_inode64, Opt_err
 };
 
 static const match_table_t tokens = {
 	{Opt_barrier, "barrier"},
 	{Opt_nobarrier, "nobarrier"},
+	{Opt_inode64, "inode64"},
 	{Opt_err, NULL}
 };
 
@@ -1043,6 +1044,7 @@ xfs_fs_remount(
 
 	while ((p = strsep(&options, ",")) != NULL) {
 		int token;
+		int i = 0;
 
 		if (!*p)
 			continue;
@@ -1055,6 +1057,20 @@ xfs_fs_remount(
 		case Opt_nobarrier:
 			mp->m_flags &= ~XFS_MOUNT_BARRIER;
 			break;
+		case Opt_inode64:
+
+			for (i = 0; i < mp->m_sb.sb_agcount; i++) {
+				struct xfs_perag	*pag;
+
+				pag = xfs_perag_get(mp, i);
+				pag->pagi_inodeok = 1;
+				pag->pagf_metadata = 0;
+				xfs_perag_put(pag);
+			}
+			mp->m_flags &= ~(XFS_MOUNT_32BITINODES |
+					 XFS_MOUNT_SMALL_INUMS);
+			mp->m_maxagi = i;
+			break;
 		default:
 			/*
 			 * Logically we would return an error here to prevent
-- 
1.7.11.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH V3] Make inode64 a remountable option
  2012-08-17  2:39 [PATCH V3] Make inode64 a remountable option Carlos Maiolino
@ 2012-08-17  5:04 ` Dave Chinner
  2012-08-17 12:24 ` Christoph Hellwig
  2012-08-17 17:33 ` Christoph Hellwig
  2 siblings, 0 replies; 6+ messages in thread
From: Dave Chinner @ 2012-08-17  5:04 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: xfs

On Thu, Aug 16, 2012 at 11:39:38PM -0300, Carlos Maiolino wrote:
> Actually, there is no reason about why a user must umount and mount a XFS
> filesystem to enable 'inode64' option. So, this patch makes this a remountable
> option.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>

Looks good :)

Reviewed-by: Dave Chinner <dchinner@redhat.com>
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH V3] Make inode64 a remountable option
  2012-08-17  2:39 [PATCH V3] Make inode64 a remountable option Carlos Maiolino
  2012-08-17  5:04 ` Dave Chinner
@ 2012-08-17 12:24 ` Christoph Hellwig
  2012-08-17 14:49   ` Carlos Maiolino
  2012-08-17 17:33 ` Christoph Hellwig
  2 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2012-08-17 12:24 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: xfs

On Thu, Aug 16, 2012 at 11:39:38PM -0300, Carlos Maiolino wrote:
> Actually, there is no reason about why a user must umount and mount a XFS
> filesystem to enable 'inode64' option. So, this patch makes this a remountable
> option.

What does protect concurrent updates of m_flags?

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH V3] Make inode64 a remountable option
  2012-08-17 12:24 ` Christoph Hellwig
@ 2012-08-17 14:49   ` Carlos Maiolino
  2012-08-17 17:34     ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Carlos Maiolino @ 2012-08-17 14:49 UTC (permalink / raw)
  To: xfs

On Fri, Aug 17, 2012 at 08:24:37AM -0400, Christoph Hellwig wrote:
> On Thu, Aug 16, 2012 at 11:39:38PM -0300, Carlos Maiolino wrote:
> > Actually, there is no reason about why a user must umount and mount a XFS
> > filesystem to enable 'inode64' option. So, this patch makes this a remountable
> > option.
> 
> What does protect concurrent updates of m_flags?
> 
I don't think there is any lock protection around m_flags, I did a search on the
code and couldn't find anything protecting it. At a first glance though, I don't
think there is a need to protect it once this flag is managed only during super
operations - mount/umount/remount -
Also, I *think* the sb->s_umount rw_semaphore is enough for protection, once it
protects the whole mount/umount operation, but I'm 100% sure of it.

> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

-- 
--Carlos

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH V3] Make inode64 a remountable option
  2012-08-17  2:39 [PATCH V3] Make inode64 a remountable option Carlos Maiolino
  2012-08-17  5:04 ` Dave Chinner
  2012-08-17 12:24 ` Christoph Hellwig
@ 2012-08-17 17:33 ` Christoph Hellwig
  2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2012-08-17 17:33 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: xfs

On Thu, Aug 16, 2012 at 11:39:38PM -0300, Carlos Maiolino wrote:
> +		case Opt_inode64:
> +
> +			for (i = 0; i < mp->m_sb.sb_agcount; i++) {
> +				struct xfs_perag	*pag;
> +
> +				pag = xfs_perag_get(mp, i);
> +				pag->pagi_inodeok = 1;
> +				pag->pagf_metadata = 0;
> +				xfs_perag_put(pag);
> +			}
> +			mp->m_flags &= ~(XFS_MOUNT_32BITINODES |
> +					 XFS_MOUNT_SMALL_INUMS);
> +			mp->m_maxagi = i;

Can you factor this into a little helper?  I hate having lots of code
and especially loops inside of deep switch statements.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH V3] Make inode64 a remountable option
  2012-08-17 14:49   ` Carlos Maiolino
@ 2012-08-17 17:34     ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2012-08-17 17:34 UTC (permalink / raw)
  To: xfs

On Fri, Aug 17, 2012 at 11:49:50AM -0300, Carlos Maiolino wrote:
> I don't think there is any lock protection around m_flags, I did a search on the
> code and couldn't find anything protecting it. At a first glance though, I don't
> think there is a need to protect it once this flag is managed only during super
> operations - mount/umount/remount -
> Also, I *think* the sb->s_umount rw_semaphore is enough for protection, once it
> protects the whole mount/umount operation, but I'm 100% sure of it.

Seems like rw_semaphore takes care of it, and we already have a trace
when setting XFS_MOUNT_FS_SHUTDOWN.  I guess it's fine as is for now,
but I'd love to have comment explaining why it's safe.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2012-08-17 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17  2:39 [PATCH V3] Make inode64 a remountable option Carlos Maiolino
2012-08-17  5:04 ` Dave Chinner
2012-08-17 12:24 ` Christoph Hellwig
2012-08-17 14:49   ` Carlos Maiolino
2012-08-17 17:34     ` Christoph Hellwig
2012-08-17 17:33 ` Christoph Hellwig

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