Merge lp:~xnox/ubuntu/saucy/mountall/btrfs into lp:ubuntu/saucy/mountall

Proposed by Dimitri John Ledkov
Status: Needs review
Proposed branch: lp:~xnox/ubuntu/saucy/mountall/btrfs
Merge into: lp:ubuntu/saucy/mountall
Diff against target: 92 lines (+41/-1)
3 files modified
debian/changelog (+8/-0)
debian/control (+1/-1)
src/mountall.c (+32/-0)
To merge this branch: bzr merge lp:~xnox/ubuntu/saucy/mountall/btrfs
Reviewer Review Type Date Requested Status
Steve Langasek Disapprove
Upstart Reviewers Pending
Review via email: mp+177822@code.launchpad.net

Description of the change

Provide better bitter fs support.

* Ignore missing fsck.btrfs
* Skip automatic checking of filesystems with major zero, such as btrfs. (similar is done by sysvinit & checkroot.sh / systemdish systems)

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

I don't think mountall should special case fsck.btrfs. fsck.$fs is a standard interface; btrfs-tools should be supporting this, even if it means making it a symlink to /bin/true - mountall should not be special-casing btrfs, btrfs should be complying with the interfaces.

I'm also not happy with the "major_zero" change. This is way too magic. I think we should get an explanation of why this is the correct check here before including such code.

review: Disapprove
Revision history for this message
James Hunt (jamesodhunt) wrote :

Drive-by review comment...

- major_zero() could do with an nih_assert call to check mnt (as could missing_fsck() and find_fsck()).

Unmerged revisions

445. By Dimitri John Ledkov

* Allow skipping fsck, when no fsck utility found for btrfs.
* Skip automatic checking of filesystems with major 0, such as btrfs.
* Add myself to uploaders.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-07-02 23:10:21 +0000
+++ debian/changelog 2013-07-31 12:28:30 +0000
@@ -1,3 +1,11 @@
1mountall (2.50) unstable; urgency=low
2
3 * Allow skipping fsck, when no fsck utility found for btrfs.
4 * Skip automatic checking of filesystems with major 0, such as btrfs.
5 * Add myself to uploaders.
6
7 -- Dmitrijs Ledkovs <xnox@debian.org> Wed, 31 Jul 2013 11:32:23 +0100
8
1mountall (2.49) unstable; urgency=low9mountall (2.49) unstable; urgency=low
210
3 [ James Hunt ]11 [ James Hunt ]
412
=== modified file 'debian/control'
--- debian/control 2012-06-28 15:59:27 +0000
+++ debian/control 2013-07-31 12:28:30 +0000
@@ -2,7 +2,7 @@
2Section: admin2Section: admin
3Priority: required3Priority: required
4Maintainer: Steve Langasek <vorlon@debian.org>4Maintainer: Steve Langasek <vorlon@debian.org>
5Uploaders: Scott James Remnant <scott@ubuntu.com>, James Hunt <james.hunt@ubuntu.com>5Uploaders: Scott James Remnant <scott@ubuntu.com>, James Hunt <james.hunt@ubuntu.com>, Dmitrijs Ledkovs <xnox@debian.org>
6Standards-Version: 3.9.36Standards-Version: 3.9.3
7Build-Depends: debhelper (>= 9.20120410), pkg-config (>= 0.22), libnih-dev (>= 1.0.0), libnih-dbus-dev (>= 1.0.0), nih-dbus-tool (>= 1.0.0), libdbus-1-dev (>= 1.2.16), libexpat1-dev (>= 2.0.0), libudev-dev (>= 146), plymouth-dev (>= 0.8.5.1) | libplymouth-dev (>= 0.8.1-3)7Build-Depends: debhelper (>= 9.20120410), pkg-config (>= 0.22), libnih-dev (>= 1.0.0), libnih-dbus-dev (>= 1.0.0), nih-dbus-tool (>= 1.0.0), libdbus-1-dev (>= 1.2.16), libexpat1-dev (>= 2.0.0), libudev-dev (>= 146), plymouth-dev (>= 0.8.5.1) | libplymouth-dev (>= 0.8.1-3)
8Vcs-Bzr: lp:ubuntu/mountall8Vcs-Bzr: lp:ubuntu/mountall
99
=== modified file 'src/mountall.c'
--- src/mountall.c 2013-04-05 21:11:08 +0000
+++ src/mountall.c 2013-07-31 12:28:30 +0000
@@ -210,6 +210,7 @@
210void run_swapon_finished (Mount *mnt, pid_t pid, int status);210void run_swapon_finished (Mount *mnt, pid_t pid, int status);
211211
212int missing_fsck (Mount *mnt);212int missing_fsck (Mount *mnt);
213int major_zero (Mount *mnt);
213void run_fsck (Mount *mnt);214void run_fsck (Mount *mnt);
214void run_fsck_finished (Mount *mnt, pid_t pid, int status);215void run_fsck_finished (Mount *mnt, pid_t pid, int status);
215216
@@ -2392,6 +2393,7 @@
2392 "ext3",2393 "ext3",
2393 "ext4",2394 "ext4",
2394 "ext4dev",2395 "ext4dev",
2396 "btrfs",
2395 "jfs",2397 "jfs",
2396 "reiserfs",2398 "reiserfs",
2397 "xfs",2399 "xfs",
@@ -2425,6 +2427,31 @@
2425 return TRUE;2427 return TRUE;
2426}2428}
24272429
2430/**
2431 * major_zero:
2432 *
2433 * Returns TRUE if major device number of the filesystem is zero.
2434 */
2435int
2436major_zero (Mount *mnt)
2437{
2438 struct stat st;
2439
2440 if (lstat (mnt->mountpoint, &st) != 0) {
2441 nih_debug ("%s: lstat failed.", MOUNT_NAME (mnt));
2442 return FALSE;
2443 }
2444
2445 if (!S_ISDIR(st.st_mode)) {
2446 nih_debug ("%s: not a directory.", MOUNT_NAME (mnt));
2447 return FALSE;
2448 }
2449
2450 if (major (st.st_dev) == 0)
2451 return TRUE;
2452
2453 return FALSE;
2454}
24282455
2429void2456void
2430run_fsck (Mount *mnt)2457run_fsck (Mount *mnt)
@@ -2446,6 +2473,11 @@
2446 mnt->ready = TRUE;2473 mnt->ready = TRUE;
2447 try_mount (mnt, FALSE);2474 try_mount (mnt, FALSE);
2448 return;2475 return;
2476 } else if (major_zero (mnt)) {
2477 nih_debug ("%s: no need to check", MOUNT_NAME (mnt));
2478 mnt->ready = TRUE;
2479 try_mount (mnt, FALSE);
2480 return;
2449 } else if (missing_fsck (mnt)) {2481 } else if (missing_fsck (mnt)) {
2450 nih_debug ("%s: no appropriate fsck.* present",2482 nih_debug ("%s: no appropriate fsck.* present",
2451 MOUNT_NAME (mnt));2483 MOUNT_NAME (mnt));

Subscribers

People subscribed via source and target branches