summaryrefslogtreecommitdiff
path: root/quotasys.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2003-11-05 20:07:51 +0000
committerjkar8572 <jkar8572>2003-11-05 20:07:51 +0000
commit7a5e60424e444a124fef1577064264ce0f755e8e (patch)
treec5cd7ede4d291bdc116845e338713f923ab8370d /quotasys.c
parent3912b14a2db657893abce87cf9b9a0b2e1df0c5c (diff)
Fixed handling of device-backed loop mounts (Jari Ruusu)
Diffstat (limited to 'quotasys.c')
-rw-r--r--quotasys.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/quotasys.c b/quotasys.c
index 210e068..836c655 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -810,7 +810,12 @@ static int cache_mnt_table(int flags)
free((char *)devname);
continue;
}
- if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode)) { /* Some 'bind' or 'loop' mount? */
+ if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode) && !S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode)) {
+ unsupporteddev:
+ errstr(_("Device (%s) filesystem is mounted on unsupported device type. Skipping.\n"), devname);
+ free((char *)devname);
+ continue;
+ } else {
char *opt;
if (hasmntopt(mnt, MNTOPT_BIND)) {
@@ -843,15 +848,12 @@ static int cache_mnt_table(int flags)
dev = st.st_rdev;
free((char *)devname);
devname = sstrdup(loopdev);
- }
- else {
- errstr(_("Device (%s) filesystem is mounted on isn't block or character device nor it's loopback or bind mount. Skipping.\n"), devname);
- free((char *)devname);
- continue;
+ } else {
+ if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode))
+ goto unsupporteddev;
+ dev = st.st_rdev;
}
}
- else
- dev = st.st_rdev;
for (i = 0; i < mnt_entries_cnt && mnt_entries[i].me_dev != dev; i++);
}
/* Cope with network filesystems or new mountpoint */