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
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-07-02 23:10:21 +0000
3+++ debian/changelog 2013-07-31 12:28:30 +0000
4@@ -1,3 +1,11 @@
5+mountall (2.50) unstable; urgency=low
6+
7+ * Allow skipping fsck, when no fsck utility found for btrfs.
8+ * Skip automatic checking of filesystems with major 0, such as btrfs.
9+ * Add myself to uploaders.
10+
11+ -- Dmitrijs Ledkovs <xnox@debian.org> Wed, 31 Jul 2013 11:32:23 +0100
12+
13 mountall (2.49) unstable; urgency=low
14
15 [ James Hunt ]
16
17=== modified file 'debian/control'
18--- debian/control 2012-06-28 15:59:27 +0000
19+++ debian/control 2013-07-31 12:28:30 +0000
20@@ -2,7 +2,7 @@
21 Section: admin
22 Priority: required
23 Maintainer: Steve Langasek <vorlon@debian.org>
24-Uploaders: Scott James Remnant <scott@ubuntu.com>, James Hunt <james.hunt@ubuntu.com>
25+Uploaders: Scott James Remnant <scott@ubuntu.com>, James Hunt <james.hunt@ubuntu.com>, Dmitrijs Ledkovs <xnox@debian.org>
26 Standards-Version: 3.9.3
27 Build-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)
28 Vcs-Bzr: lp:ubuntu/mountall
29
30=== modified file 'src/mountall.c'
31--- src/mountall.c 2013-04-05 21:11:08 +0000
32+++ src/mountall.c 2013-07-31 12:28:30 +0000
33@@ -210,6 +210,7 @@
34 void run_swapon_finished (Mount *mnt, pid_t pid, int status);
35
36 int missing_fsck (Mount *mnt);
37+int major_zero (Mount *mnt);
38 void run_fsck (Mount *mnt);
39 void run_fsck_finished (Mount *mnt, pid_t pid, int status);
40
41@@ -2392,6 +2393,7 @@
42 "ext3",
43 "ext4",
44 "ext4dev",
45+ "btrfs",
46 "jfs",
47 "reiserfs",
48 "xfs",
49@@ -2425,6 +2427,31 @@
50 return TRUE;
51 }
52
53+/**
54+ * major_zero:
55+ *
56+ * Returns TRUE if major device number of the filesystem is zero.
57+ */
58+int
59+major_zero (Mount *mnt)
60+{
61+ struct stat st;
62+
63+ if (lstat (mnt->mountpoint, &st) != 0) {
64+ nih_debug ("%s: lstat failed.", MOUNT_NAME (mnt));
65+ return FALSE;
66+ }
67+
68+ if (!S_ISDIR(st.st_mode)) {
69+ nih_debug ("%s: not a directory.", MOUNT_NAME (mnt));
70+ return FALSE;
71+ }
72+
73+ if (major (st.st_dev) == 0)
74+ return TRUE;
75+
76+ return FALSE;
77+}
78
79 void
80 run_fsck (Mount *mnt)
81@@ -2446,6 +2473,11 @@
82 mnt->ready = TRUE;
83 try_mount (mnt, FALSE);
84 return;
85+ } else if (major_zero (mnt)) {
86+ nih_debug ("%s: no need to check", MOUNT_NAME (mnt));
87+ mnt->ready = TRUE;
88+ try_mount (mnt, FALSE);
89+ return;
90 } else if (missing_fsck (mnt)) {
91 nih_debug ("%s: no appropriate fsck.* present",
92 MOUNT_NAME (mnt));

Subscribers

People subscribed via source and target branches