Skip to contentSkip to conversation

xfsprogs: fixes for release candidate.

PATCH In review Dave Chinner 2 participants 7 messages Nov 9, 2012 – Nov 20, 2012

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 xfs_db: flush devices before exiting

From: Dave Chinner <[email protected]>

Test 287 uses xfs_db to change 32-bit project ID support while the filesystem is unmounted. On a large filesystem the test was failing due to the mount not seeing the feature bit in the superblock.

xfs_db uses a different address space to the filesystem when it is mounte dby the kernel, so the only way to keep them coherent is to ensure that all buffered data is written to disk before the other entity tries to read it. xfs_db uses buffered IO, but does not close the devices when it exits, thereby leaving changes it has written in the block device cache rather than on disk. Hence when th ekernel tries to mount the filesystem, it reads what is on disk and does not see xfs_db's changes.

Fix this by ensuring that xfs_db flushes it's changes to disk before it exits by caling libxfs_device_close(). This fsyncs the data and flushes the caches to ensure that it is present on disk before xfs_db exits.

---
 db/init.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
db/init.c +9 -1
index 2a5ef2b..2a31cb8 100644
@@ -170,7 +170,7 @@ main(
 	}
 	if (cmdline) {
 		xfree(cmdline);
-		return exitcode;
+		goto close_devices;
 	}
 
 	while (!done) {
@@ -181,5 +181,13 @@ main(
 			done = command(c, v);
 		doneline(input, v);
 	}
+
+close_devices:
+	if (x.ddev)
+		libxfs_device_close(x.ddev);
+	if (x.logdev && x.logdev != x.ddev)
+		libxfs_device_close(x.logdev);
+	if (x.rtdev)
+		libxfs_device_close(x.rtdev);
 	return exitcode;
 }
Signature · 6 lines
1.7.10

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] xfs_db: flush devices before exiting

Quoted 15 lines · Dave Chinner

From: Dave Chinner<[email protected]>

Test 287 uses xfs_db to change 32-bit project ID support while the filesystem is unmounted. On a large filesystem the test was failing due to the mount not seeing the feature bit in the superblock.

xfs_db uses a different address space to the filesystem when it is mounte dby the kernel, so the only way to keep them coherent is to ensure that all buffered data is written to disk before the other entity tries to read it. xfs_db uses buffered IO, but does not close the devices when it exits, thereby leaving changes it has written in the block device cache rather than on disk. Hence when th ekernel tries to mount the filesystem, it reads what is on disk and does not see xfs_db's changes.

Quoted 7 lines

Fix this by ensuring that xfs_db flushes it's changes to disk before it exits by caling libxfs_device_close(). This fsyncs the data and flushes the caches to ensure that it is present on disk before xfs_db exits.

---

Looks good. Consistent to mkfs.xfs and xfs_repair.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH 2/2 xfs_quota: fix report command parsing

In reply to Dave Chinner

From: Dave Chinner <[email protected]>

The report command line needs to be parsed as a whole not as individual elements - report_f() is set up to do this correctly. When treated as non-global command line, the report function is called once for each command line arg, resulting in reports being issued multiple times.

Set the command to be a global command so that it is only called once.

---
 quota/report.c |    1 +
 1 file changed, 1 insertion(+)
quota/report.c +1 -0
index a1e165b..70894a2 100644
@@ -653,6 +653,7 @@ report_init(void)
 	report_cmd.cfunc = report_f;
 	report_cmd.argmin = 0;
 	report_cmd.argmax = -1;
+	report_cmd.flags = CMD_FLAG_GLOBAL;
 	report_cmd.args = _("[-bir] [-gpu] [-ahnt] [-f file]");
 	report_cmd.oneline = _("report filesystem quota information");
 	report_cmd.help = report_help;
Signature · 6 lines
1.7.10

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] xfs_quota: fix report command parsing

Quoted 8 lines · Dave Chinner

From: Dave Chinner<[email protected]>

The report command line needs to be parsed as a whole not as individual elements - report_f() is set up to do this correctly. When treated as non-global command line, the report function is called once for each command line arg, resulting in reports being issued multiple times.

Quoted 5 lines

Set the command to be a global command so that it is only called once.

---

Solves the duplicate listings.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw
In reply to Dave Chinner
Quoted 4 lines · Dave Chinner

Hi Ben,

These are two fixes for bugs that have shown up during the -rc phase of the release. Please consider them for inclusion.

ping?

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw
In reply to Dave Chinner
Quoted 5 lines · Dave Chinner

Hi Ben,

These are two fixes for bugs that have shown up during the -rc phase of the release. Please consider them for inclusion.

Quoted 8 lines

Cheers,

Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

This series has been committed to git://oss.sgi.com/xfs/cmds/xfsprogs master branch, commit 1adfff, 19473a and 36298.

--Mark.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs