From: Nathan Scott <nathans@sgi.com>

Update XFS documentation.

Add the noikeep mount option, make ikeep the default for now.

Fix a possible bio-leak on I/O submission, in a case where no I/O was required.



 Documentation/Changes             |    9 +++----
 Documentation/filesystems/xfs.txt |   46 +++++++++++++++++++++++++-------------
 fs/xfs/pagebuf/page_buf.c         |    9 +------
 fs/xfs/xfs_vfsops.c               |    9 +++++--
 4 files changed, 44 insertions(+), 29 deletions(-)

diff -puN Documentation/Changes~xfs-update-01 Documentation/Changes
--- 25/Documentation/Changes~xfs-update-01	2003-12-17 01:25:13.000000000 -0800
+++ 25-akpm/Documentation/Changes	2003-12-17 01:25:14.000000000 -0800
@@ -56,7 +56,7 @@ o  module-init-tools      0.9.10        
 o  e2fsprogs              1.29                    # tune2fs
 o  jfsutils               1.1.3                   # fsck.jfs -V
 o  reiserfsprogs          3.6.3                   # reiserfsck -V 2>&1|grep reiserfsprogs
-o  xfsprogs               2.1.0                   # xfs_db -V
+o  xfsprogs               2.6.0                   # xfs_db -V
 o  pcmcia-cs              3.1.21                  # cardmgr -V
 o  quota-tools            3.09                    # quota -V
 o  PPP                    2.4.0                   # pppd --version
@@ -183,9 +183,8 @@ Xfsprogs
 The latest version of xfsprogs contains mkfs.xfs, xfs_db, and the
 xfs_repair utilities, among others, for the XFS filesystem.  It is
 architecture independent and any version from 2.0.0 onward should
-work correctly with this version of the XFS kernel code.  For the new
-(v2) log format that has better support for stripe-size aligning on
-LVM and MD devices at least xfsprogs 2.1.0 is needed.
+work correctly with this version of the XFS kernel code (2.6.0 or
+later is recommended, due to some significant improvements).
 
 
 Pcmcia-cs
@@ -359,7 +358,7 @@ o  <http://www.namesys.com/pub/reiserfsp
 
 Xfsprogs
 --------
-o  <ftp://oss.sgi.com/projects/xfs/download/cmd_tars/xfsprogs-2.1.0.src.tar.gz>
+o  <ftp://oss.sgi.com/projects/xfs/download/>
 
 Pcmcia-cs
 ---------
diff -puN Documentation/filesystems/xfs.txt~xfs-update-01 Documentation/filesystems/xfs.txt
--- 25/Documentation/filesystems/xfs.txt~xfs-update-01	2003-12-17 01:25:13.000000000 -0800
+++ 25-akpm/Documentation/filesystems/xfs.txt	2003-12-17 01:25:14.000000000 -0800
@@ -29,10 +29,11 @@ When mounting an XFS filesystem, the fol
 	The preferred buffered I/O size can also be altered on an
 	individual file basis using the ioctl(2) system call.
 
-  ikeep
+  ikeep/noikeep
 	When inode clusters are emptied of inodes, keep them around
-	on the disk, this is the old XFS behavior. Default is now to
-	return the inode cluster to the free space pool.
+	on the disk (ikeep) - this is the traditional XFS behaviour
+	and is still the default for now.  Using the noikeep option,
+	inode clusters are returned to the free space pool.
 
   logbufs=value
 	Set the number of in-memory log buffers.  Valid numbers range
@@ -75,6 +76,10 @@ When mounting an XFS filesystem, the fol
 	Filesystems mounted "norecovery" must be mounted read-only or
 	the mount will fail.
 
+  nouuid
+	Don't check for double mounted file systems using the file system uuid.
+	This is useful to mount LVM snapshot volumes.
+
   osyncisosync
 	Make O_SYNC writes implement true O_SYNC.  WITHOUT this option,
 	Linux XFS behaves as if an "osyncisdsync" option is used,
@@ -108,10 +113,6 @@ When mounting an XFS filesystem, the fol
 	The "swidth" option is required if the "sunit" option has been
 	specified, and must be a multiple of the "sunit" value.
 
-  nouuid
-        Don't check for double mounted file systems using the file system uuid.
-        This is useful to mount LVM snapshot volumes.
-
 sysctls
 =======
 
@@ -139,14 +140,14 @@ The following sysctls are available for 
 	Causes certain error conditions to call BUG(). Value is a bitmask; 
 	AND together the tags which represent errors which should cause panics:
 	
-		XFS_NO_PTAG                     0LL
-		XFS_PTAG_IFLUSH                 0x0000000000000001LL
-		XFS_PTAG_LOGRES                 0x0000000000000002LL
-		XFS_PTAG_AILDELETE              0x0000000000000004LL
-		XFS_PTAG_ERROR_REPORT           0x0000000000000008LL
-		XFS_PTAG_SHUTDOWN_CORRUPT       0x0000000000000010LL
-		XFS_PTAG_SHUTDOWN_IOERROR       0x0000000000000020LL
-		XFS_PTAG_SHUTDOWN_LOGERROR      0x0000000000000040LL
+		XFS_NO_PTAG                     0
+		XFS_PTAG_IFLUSH                 0x00000001
+		XFS_PTAG_LOGRES                 0x00000002
+		XFS_PTAG_AILDELETE              0x00000004
+		XFS_PTAG_ERROR_REPORT           0x00000008
+		XFS_PTAG_SHUTDOWN_CORRUPT       0x00000010
+		XFS_PTAG_SHUTDOWN_IOERROR       0x00000020
+		XFS_PTAG_SHUTDOWN_LOGERROR      0x00000040
 
 	This option is intended for debugging only.		
 
@@ -165,6 +166,21 @@ The following sysctls are available for 
   	Controls whether unprivileged users can use chown to "give away"
 	a file to another user.
 
+  fs.xfs.inherit_sync		(Min: 0  Default: 1  Max 1)
+	Setting this to "1" will cause the "sync" flag set
+	by the chattr(1) command on a directory to be
+	inherited by files in that directory.
+
+  fs.xfs.inherit_nodump		(Min: 0  Default: 1  Max 1)
+	Setting this to "1" will cause the "nodump" flag set
+	by the chattr(1) command on a directory to be
+	inherited by files in that directory.
+
+  fs.xfs.inherit_noatime	(Min: 0  Default: 1  Max 1)
+	Setting this to "1" will cause the "noatime" flag set
+	by the chattr(1) command on a directory to be
+	inherited by files in that directory.
+
   vm.pagebuf.stats_clear	(Min: 0  Default: 0  Max: 1)
 	Setting this to "1" clears accumulated pagebuf statistics 
 	in /proc/fs/pagebuf/stat.  It then immediately reset to "0".
diff -puN fs/xfs/pagebuf/page_buf.c~xfs-update-01 fs/xfs/pagebuf/page_buf.c
--- 25/fs/xfs/pagebuf/page_buf.c~xfs-update-01	2003-12-17 01:25:13.000000000 -0800
+++ 25-akpm/fs/xfs/pagebuf/page_buf.c	2003-12-17 01:25:14.000000000 -0800
@@ -1395,7 +1395,6 @@ next_chunk:
 			break;
 
 		offset = 0;
-
 		sector += nbytes >> BBSHIFT;
 		size -= nbytes;
 		total_nr_pages--;
@@ -1403,15 +1402,11 @@ next_chunk:
 
 submit_io:
 	if (likely(bio->bi_size)) {
-		if (pb->pb_flags & PBF_READ) {
-			submit_bio(READ, bio);
-		} else {
-			submit_bio(WRITE, bio);
-		}
-
+		submit_bio((pb->pb_flags & PBF_READ) ? READ : WRITE, bio);
 		if (size)
 			goto next_chunk;
 	} else {
+		bio_put(bio);
 		pagebuf_ioerror(pb, EIO);
 	}
 
diff -puN fs/xfs/xfs_vfsops.c~xfs-update-01 fs/xfs/xfs_vfsops.c
--- 25/fs/xfs/xfs_vfsops.c~xfs-update-01	2003-12-17 01:25:14.000000000 -0800
+++ 25-akpm/fs/xfs/xfs_vfsops.c	2003-12-17 01:25:14.000000000 -0800
@@ -1598,8 +1598,9 @@ xfs_vget(
 #define MNTOPT_NORECOVERY   "norecovery"   /* don't run XFS recovery */
 #define MNTOPT_NOLOGFLUSH   "nologflush"   /* don't hard flush on log writes */
 #define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */
-#define MNTOPT_64BITINODE   "inode64"  /* inodes can be allocated anywhere */
-#define MNTOPT_IKEEP	"ikeep"		/* free empty inode clusters */
+#define MNTOPT_64BITINODE   "inode64"	/* inodes can be allocated anywhere */
+#define MNTOPT_IKEEP	"ikeep"		/* do not free empty inode clusters */
+#define MNTOPT_NOIKEEP	"noikeep"	/* free empty inode clusters */
 
 
 int
@@ -1614,7 +1615,9 @@ xfs_parseargs(
 	int			dsunit, dswidth, vol_dsunit, vol_dswidth;
 	int			iosize;
 
+#if 0	/* XXX: off by default, until some remaining issues ironed out */
 	args->flags |= XFSMNT_IDELETE; /* default to on */
+#endif
 
 	if (!options)
 		return 0;
@@ -1722,6 +1725,8 @@ xfs_parseargs(
 			args->flags |= XFSMNT_NOLOGFLUSH;
 		} else if (!strcmp(this_char, MNTOPT_IKEEP)) {
 			args->flags &= ~XFSMNT_IDELETE;
+		} else if (!strcmp(this_char, MNTOPT_NOIKEEP)) {
+			args->flags |= XFSMNT_IDELETE;
 		} else if (!strcmp(this_char, "osyncisdsync")) {
 			/* no-op, this is now the default */
 printk("XFS: osyncisdsync is now the default, option is deprecated.\n");

_