Compare commits
No commits in common. 'i8c' and 'c9' have entirely different histories.
@ -1 +1 @@
|
||||
SOURCES/quota-4.04.tar.gz
|
||||
SOURCES/quota-4.06.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
38e6cc7538d504891a8454bbdabef058bd1adc11 SOURCES/quota-4.04.tar.gz
|
||||
98288699cc14da42f762301c2b6731ec7c777681 SOURCES/quota-4.06.tar.gz
|
||||
|
@ -1,180 +0,0 @@
|
||||
From a92dcf5a6cc49660d75a67966b0eb093b88e3b4c Mon Sep 17 00:00:00 2001
|
||||
From: "Tinguely, Mark" <mark.tinguely@hpe.com>
|
||||
Date: Wed, 9 May 2018 16:50:25 +0200
|
||||
Subject: [PATCH] Aadd HPE XFS support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
HPE XFS has a different superblock magic and type name
|
||||
to allow the community XFS and HPE XFS to coexist in
|
||||
the same linux kernel.
|
||||
|
||||
This patch add HPE XFS support to the quota-tools so
|
||||
our customers can use it.
|
||||
|
||||
Signed-off-by: Mark Tinguely <mark.tinguely@hpe.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
bylabel.c | 4 +++-
|
||||
mntopt.h | 1 +
|
||||
quot.c | 3 ++-
|
||||
quotacheck.c | 5 +++--
|
||||
quotaio.c | 3 ++-
|
||||
quotaon.c | 6 ++++--
|
||||
quotasys.c | 10 +++++++---
|
||||
7 files changed, 22 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/bylabel.c b/bylabel.c
|
||||
index ff10422..5313461 100644
|
||||
--- a/bylabel.c
|
||||
+++ b/bylabel.c
|
||||
@@ -48,6 +48,7 @@ struct ext2_super_block {
|
||||
|
||||
#define XFS_SUPER_MAGIC "XFSB"
|
||||
#define XFS_SUPER_MAGIC2 "BSFX"
|
||||
+#define EXFS_SUPER_MAGIC "EXFS"
|
||||
struct xfs_super_block {
|
||||
u_char s_magic[4];
|
||||
u_char s_dummy[28];
|
||||
@@ -107,7 +108,8 @@ static int get_label_uuid(const char *device, char **label, char *uuid)
|
||||
else if (lseek(fd, 0, SEEK_SET) == 0
|
||||
&& read(fd, (char *)&xfsb, sizeof(xfsb)) == sizeof(xfsb)
|
||||
&& (strncmp((char *)&xfsb.s_magic, XFS_SUPER_MAGIC, 4) == 0 ||
|
||||
- strncmp((char *)&xfsb.s_magic, XFS_SUPER_MAGIC2, 4) == 0)) {
|
||||
+ strncmp((char *)&xfsb.s_magic, XFS_SUPER_MAGIC2, 4) == 0 ||
|
||||
+ strncmp((char *)&xfsb.s_magic, EXFS_SUPER_MAGIC, 4) == 0)) {
|
||||
memcpy(uuid, xfsb.s_uuid, sizeof(xfsb.s_uuid));
|
||||
namesize = sizeof(xfsb.s_fsname);
|
||||
*label = smalloc(namesize + 1);
|
||||
diff --git a/mntopt.h b/mntopt.h
|
||||
index 7913048..0f3b0c5 100644
|
||||
--- a/mntopt.h
|
||||
+++ b/mntopt.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#define MNTTYPE_UDF "udf" /* OSTA UDF file system */
|
||||
#define MNTTYPE_REISER "reiserfs" /* Reiser file system */
|
||||
#define MNTTYPE_XFS "xfs" /* SGI XFS file system */
|
||||
+#define MNTTYPE_EXFS "exfs" /* HPE EXFS file system */
|
||||
#define MNTTYPE_AUTOFS "autofs" /* Automount mountpoint */
|
||||
#define MNTTYPE_JFS "jfs" /* JFS file system */
|
||||
#define MNTTYPE_NFS4 "nfs4" /* NFSv4 filesystem */
|
||||
diff --git a/quot.c b/quot.c
|
||||
index 6311f77..c3a31a4 100644
|
||||
--- a/quot.c
|
||||
+++ b/quot.c
|
||||
@@ -143,7 +143,8 @@ static void mounttable(void)
|
||||
|
||||
while ((mntp = get_next_mount())) {
|
||||
/* Currently, only XFS is implemented... */
|
||||
- if (strcmp(mntp->me_type, MNTTYPE_XFS) == 0) {
|
||||
+ if (strcmp(mntp->me_type, MNTTYPE_XFS) == 0 ||
|
||||
+ strcmp(mntp->me_type, MNTTYPE_EXFS) == 0) {
|
||||
checkXFS(mntp->me_devname, mntp->me_dir);
|
||||
doit = 1;
|
||||
}
|
||||
diff --git a/quotacheck.c b/quotacheck.c
|
||||
index b1302b6..fd01dfc 100644
|
||||
--- a/quotacheck.c
|
||||
+++ b/quotacheck.c
|
||||
@@ -1042,7 +1042,8 @@ static int detect_filename_format(struct mount_entry *mnt, int type)
|
||||
int fmt;
|
||||
|
||||
if (strcmp(mnt->me_type, MNTTYPE_XFS) == 0 ||
|
||||
- strcmp(mnt->me_type, MNTTYPE_GFS2) == 0)
|
||||
+ strcmp(mnt->me_type, MNTTYPE_GFS2) == 0 ||
|
||||
+ strcmp(mnt->me_type, MNTTYPE_EXFS) == 0)
|
||||
return QF_XFS;
|
||||
|
||||
if (type == USRQUOTA) {
|
||||
@@ -1116,7 +1117,7 @@ static int compatible_fs_qfmt(char *fstype, int fmt)
|
||||
{
|
||||
/* We never check XFS, NFS, and filesystems supporting VFS metaformat */
|
||||
if (!strcmp(fstype, MNTTYPE_XFS) || nfs_fstype(fstype) ||
|
||||
- meta_qf_fstype(fstype))
|
||||
+ meta_qf_fstype(fstype) || !strcmp(fstype, MNTTYPE_EXFS))
|
||||
return 0;
|
||||
/* In all other cases we can pick a format... */
|
||||
if (fmt == -1)
|
||||
diff --git a/quotaio.c b/quotaio.c
|
||||
index df893c6..94ae458 100644
|
||||
--- a/quotaio.c
|
||||
+++ b/quotaio.c
|
||||
@@ -79,7 +79,8 @@ struct quota_handle *init_io(struct mount_entry *mnt, int type, int fmt, int fla
|
||||
}
|
||||
|
||||
if (!strcmp(mnt->me_type, MNTTYPE_XFS) || /* XFS filesystem? */
|
||||
- !strcmp(mnt->me_type, MNTTYPE_GFS2)) { /* XFS filesystem? */
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_GFS2) || /* XFS filesystem? */
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_EXFS)) { /* EXFS filesystem? */
|
||||
if (fmt != -1 && fmt != QF_XFS) { /* User wanted some other format? */
|
||||
errstr(_("Only XFS quota format is allowed on XFS filesystem.\n"));
|
||||
goto out_handle;
|
||||
diff --git a/quotaon.c b/quotaon.c
|
||||
index fe19224..cee2e25 100644
|
||||
--- a/quotaon.c
|
||||
+++ b/quotaon.c
|
||||
@@ -282,7 +282,8 @@ static int newstate(struct mount_entry *mnt, int type, char *extra)
|
||||
if (!strcmp(mnt->me_type, MNTTYPE_GFS2)) {
|
||||
errstr(_("Cannot change state of GFS2 quota.\n"));
|
||||
return 1;
|
||||
- } else if (!strcmp(mnt->me_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */
|
||||
+ } else if (!strcmp(mnt->me_type, MNTTYPE_XFS) ||
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_EXFS)) { /* XFS filesystem has special handling... */
|
||||
if (!kern_qfmt_supp(QF_XFS)) {
|
||||
errstr(_("Cannot change state of XFS quota. It's not compiled in kernel.\n"));
|
||||
return 1;
|
||||
@@ -337,7 +338,8 @@ static int print_state(struct mount_entry *mnt, int type)
|
||||
if (kern_qfmt_supp(QF_XFS)) {
|
||||
on = kern_quota_state_xfs(mnt->me_devname, type);
|
||||
if (!strcmp(mnt->me_type, MNTTYPE_XFS) ||
|
||||
- !strcmp(mnt->me_type, MNTTYPE_GFS2) || on >= 0) {
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_GFS2) || on >= 0 ||
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_EXFS)) {
|
||||
if (on < 0)
|
||||
on = 0;
|
||||
if (!(flags & FL_VERBOSE))
|
||||
diff --git a/quotasys.c b/quotasys.c
|
||||
index 9336411..d8c0e48 100644
|
||||
--- a/quotasys.c
|
||||
+++ b/quotasys.c
|
||||
@@ -781,7 +781,8 @@ static void copy_mntoptarg(char *buf, const char *optarg, int buflen)
|
||||
static int hasquota(const char *dev, struct mntent *mnt, int type, int flags)
|
||||
{
|
||||
if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2) ||
|
||||
- !strcmp(mnt->mnt_type, MNTTYPE_XFS))
|
||||
+ !strcmp(mnt->mnt_type, MNTTYPE_XFS) ||
|
||||
+ !strcmp(mnt->mnt_type, MNTTYPE_EXFS))
|
||||
return hasxfsquota(dev, mnt, type, flags);
|
||||
if (!strcmp(mnt->mnt_type, MNTTYPE_OCFS2))
|
||||
return hasvfsmetaquota(dev, mnt, type, flags);
|
||||
@@ -953,12 +954,14 @@ add_entry:
|
||||
break;
|
||||
case QF_XFS:
|
||||
if (!strcmp(mnt->me_type, MNTTYPE_XFS) ||
|
||||
- !strcmp(mnt->me_type, MNTTYPE_GFS2))
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_GFS2) ||
|
||||
+ !strcmp(mnt->me_type, MNTTYPE_EXFS))
|
||||
goto add_entry;
|
||||
break;
|
||||
default:
|
||||
if (strcmp(mnt->me_type, MNTTYPE_XFS) &&
|
||||
strcmp(mnt->me_type, MNTTYPE_GFS2) &&
|
||||
+ strcmp(mnt->me_type, MNTTYPE_EXFS) &&
|
||||
!nfs_fstype(mnt->me_type))
|
||||
goto add_entry;
|
||||
break;
|
||||
@@ -1059,7 +1062,8 @@ void init_kernel_interface(void)
|
||||
else {
|
||||
struct v2_dqstats v2_stats;
|
||||
|
||||
- if (!stat("/proc/fs/xfs/stat", &st))
|
||||
+ if (!stat("/proc/fs/xfs/stat", &st) ||
|
||||
+ !stat("/proc/fs/exfs/stat", &st))
|
||||
kernel_qfmt[kernel_qfmt_num++] = QF_XFS;
|
||||
else {
|
||||
fs_quota_stat_t dummy;
|
||||
--
|
||||
2.26.3
|
||||
|
@ -1,43 +0,0 @@
|
||||
From bbb8819fc0f6ed379a05d635a61bcf9c8986079f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
|
||||
Date: Sat, 16 Sep 2017 13:09:43 +0200
|
||||
Subject: [PATCH] Add $(TIRPC_CFLAGS) globally to CFLAGS for RPC support,
|
||||
needed for libc 2.26
|
||||
|
||||
---
|
||||
Makefile.am | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 8d80bee..278290a 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -51,6 +51,8 @@ EXTRA_DIST = \
|
||||
noinst_LIBRARIES = libquota.a
|
||||
|
||||
if WITH_RPC
|
||||
+CFLAGS += $(TIRPC_CFLAGS)
|
||||
+
|
||||
rpcsvcdir = $(includedir)/rpcsvc
|
||||
rpcsvc_DATA = \
|
||||
rquota.h \
|
||||
@@ -100,8 +102,6 @@ libquota_a_SOURCES = \
|
||||
mntopt.h \
|
||||
pot.c \
|
||||
pot.h
|
||||
-libquota_a_CFLAGS = \
|
||||
- $(TIRPC_CFLAGS)
|
||||
libquota_a_LIBADD = \
|
||||
$(RPCLIBS)
|
||||
|
||||
@@ -235,7 +235,6 @@ rpc_rquotad_SOURCES = \
|
||||
rquota_server.c \
|
||||
rquota_svc.c \
|
||||
svc_socket.c
|
||||
-rpc_rquotad_CFLAGS = $(TIRPC_CFLAGS)
|
||||
rpc_rquotad_LDADD = \
|
||||
libquota.a \
|
||||
$(WRAP_LIBS) \
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From b5ed9878d60bf2c6764ce8e1de4f69e64c4bdfaf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Wed, 6 Sep 2017 16:25:09 +0200
|
||||
Subject: [PATCH] Install rquota(3) only if RPC is enabled
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
rquote(3) documents rpcsvc header files. Thus it should be installed
|
||||
only if the the header files are installed and that is only if RPC
|
||||
configure feature is enabled.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Makefile.am | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 8d80bee..9b852d2 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -27,7 +27,6 @@ man_MANS = \
|
||||
quota.1 \
|
||||
quot.8 \
|
||||
repquota.8 \
|
||||
- rquota.3 \
|
||||
setquota.8 \
|
||||
warnquota.conf.5 \
|
||||
warnquota.8 \
|
||||
@@ -69,7 +68,10 @@ librpcclient_a_CFLAGS = -Wno-unused
|
||||
RPCLIBS = librpcclient.a
|
||||
BUILT_SOURCES = rquota.h rquota.c rquota_clnt.c
|
||||
CLEANFILES = rquota.c rquota.h rquota_clnt.c
|
||||
-man_MANS += rpc.rquotad.8
|
||||
+man_MANS += \
|
||||
+ rpc.rquotad.8 \
|
||||
+ rquota.3
|
||||
+
|
||||
endif
|
||||
|
||||
libquota_a_SOURCES = \
|
||||
--
|
||||
2.13.5
|
||||
|
@ -1,77 +0,0 @@
|
||||
From 31ecd29b3b3f51145fd78f63087c10e9fcadf999 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Dickson <steved@redhat.com>
|
||||
Date: Tue, 22 May 2018 12:41:59 +0200
|
||||
Subject: [PATCH] Listen on a TCP socket
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
rpc.rquotad spins in libtirpc's rendezvous_request() on accepting TCP
|
||||
connections because the polled TCP socket is not listening:
|
||||
|
||||
poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=5,
|
||||
events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=6,
|
||||
events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=7,
|
||||
events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 4, -1) = 2 ([{fd=5,
|
||||
revents=POLLHUP}, {fd=7, revents=POLLHUP}])
|
||||
accept(5, 0x7ffe61698700, [128]) = -1 EINVAL (Invalid argument)
|
||||
accept(7, 0x7ffe61698700, [128]) = -1 EINVAL (Invalid argument)
|
||||
|
||||
The polled descriptors are:
|
||||
|
||||
rpc.rquot 21981 root 4u IPv4 80449159 0t0 UDP *:rquotad
|
||||
rpc.rquot 21981 root 5u sock 0,9 0t0 80449162 protocol: TCP
|
||||
rpc.rquot 21981 root 6u IPv6 80449165 0t0 UDP *:rquotad
|
||||
rpc.rquot 21981 root 7u sock 0,9 0t0 80449168 protocol: TCPv6
|
||||
|
||||
That results into a high CPU usage just after staring rpc.rquotad
|
||||
process.
|
||||
|
||||
This patch adds a listen() call to svc_create_sock()
|
||||
routine which is needed with libtirpc version of svc_tli_create()
|
||||
as well as a needed IPv6 setsockopt().
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
svc_socket.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/svc_socket.c b/svc_socket.c
|
||||
index 8a44604..d2e3abf 100644
|
||||
--- a/svc_socket.c
|
||||
+++ b/svc_socket.c
|
||||
@@ -118,6 +118,15 @@ static int svc_create_sock(struct addrinfo *ai)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if (ai->ai_family == AF_INET6) {
|
||||
+ if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||
+ &optval, sizeof(optval)) < 0) {
|
||||
+ errstr(_("Cannot set IPv6 socket options: %s\n"), strerror(errno));
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0) {
|
||||
errstr(_("Cannot set socket options: %s\n"), strerror(errno));
|
||||
close(fd);
|
||||
@@ -129,6 +138,15 @@ static int svc_create_sock(struct addrinfo *ai)
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ if (ai->ai_protocol == IPPROTO_TCP) {
|
||||
+ if (listen(fd, SOMAXCONN) < 0) {
|
||||
+ errstr(_("Cannot listen to address: %s\n"), strerror(errno));
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return fd;
|
||||
}
|
||||
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 78403029375dbfe809b5b1034301dc687a94397f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Thu, 23 Aug 2018 11:09:10 +0200
|
||||
Subject: [PATCH 1/3] convertquota: Fix a file descriptor leak in
|
||||
convert_endian()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
convertquota.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/convertquota.c b/convertquota.c
|
||||
index d913e05..6c8a553 100644
|
||||
--- a/convertquota.c
|
||||
+++ b/convertquota.c
|
||||
@@ -363,6 +363,7 @@ static int convert_endian(int type, struct mount_entry *mnt)
|
||||
}
|
||||
ret = endian_scan_structures(ofd, type);
|
||||
end_io(qn);
|
||||
+ close(ofd);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,72 +0,0 @@
|
||||
From bd36c3cf438ac4fd44b6779714ad0a44453d41b5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 16 Jul 2018 11:22:53 +0200
|
||||
Subject: [PATCH] quota(1): Distinguish between none quota limits and no
|
||||
allocated resources
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If a user does not occupies any space or inodes on a file system but
|
||||
quota limits are set, quota(1) tool still reports "none":
|
||||
|
||||
# quota -u test
|
||||
Disk quotas for user test (uid 500): none
|
||||
|
||||
That's because the tool skips printing details for file systems
|
||||
without any used resources but uses the shares the message with file
|
||||
system without any quota limits.
|
||||
|
||||
This patch makes the distinction and changes "none" message into "no
|
||||
quota limits set" and "no limited resources used" respectively.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quota.c | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/quota.c b/quota.c
|
||||
index 15c2a53..0303c7d 100644
|
||||
--- a/quota.c
|
||||
+++ b/quota.c
|
||||
@@ -188,7 +188,7 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt)
|
||||
char timebuf[MAXTIMELEN];
|
||||
char name[MAXNAMELEN];
|
||||
struct quota_handle **handles;
|
||||
- int lines = 0, bover, iover, over;
|
||||
+ int lines = 0, bover, iover, over, unlimited;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
@@ -204,11 +204,16 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt)
|
||||
goto out_handles;
|
||||
}
|
||||
over = 0;
|
||||
+ unlimited = 1;
|
||||
for (q = qlist; q; q = q->dq_next) {
|
||||
bover = iover = 0;
|
||||
- if (!(flags & FL_VERBOSE) && !q->dq_dqb.dqb_isoftlimit && !q->dq_dqb.dqb_ihardlimit
|
||||
- && !q->dq_dqb.dqb_bsoftlimit && !q->dq_dqb.dqb_bhardlimit)
|
||||
- continue;
|
||||
+ if (!q->dq_dqb.dqb_isoftlimit && !q->dq_dqb.dqb_ihardlimit
|
||||
+ && !q->dq_dqb.dqb_bsoftlimit && !q->dq_dqb.dqb_bhardlimit) {
|
||||
+ if (!(flags & FL_VERBOSE))
|
||||
+ continue;
|
||||
+ } else {
|
||||
+ unlimited = 0;
|
||||
+ }
|
||||
msgi = NULL;
|
||||
if (q->dq_dqb.dqb_ihardlimit && q->dq_dqb.dqb_curinodes >= q->dq_dqb.dqb_ihardlimit) {
|
||||
msgi = _("File limit reached on");
|
||||
@@ -300,7 +305,7 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt)
|
||||
}
|
||||
}
|
||||
if (!(flags & FL_QUIET) && !lines && qlist)
|
||||
- heading(type, id, name, _("none"));
|
||||
+ heading(type, id, name, unlimited ? _("none") : _("no limited resources used"));
|
||||
freeprivs(qlist);
|
||||
out_handles:
|
||||
dispose_handle_list(handles);
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 4179911dc38af1b6499704a7f7fb710a40c95bdb Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 5 Feb 2018 15:39:12 +0100
|
||||
Subject: [PATCH] quotacheck: Avoid question in non-interactive mode
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
A question when quota file version is incorrect is asked even if
|
||||
quotacheck is run in non-interactive mode. Avoid asking the question in
|
||||
that case and fail the check instead.
|
||||
|
||||
Reproted-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotacheck_v2.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/quotacheck_v2.c b/quotacheck_v2.c
|
||||
index 4cc8558..86fbf42 100644
|
||||
--- a/quotacheck_v2.c
|
||||
+++ b/quotacheck_v2.c
|
||||
@@ -363,7 +363,8 @@ static int check_header(char *filename, int fd, int type, int version)
|
||||
"specified on command line (%d). Quota file header "
|
||||
"may be corrupted.\n"),
|
||||
le32toh(head.dqh_version), version);
|
||||
- if (!ask_yn(_("Continue checking assuming version from command line?"), 1))
|
||||
+ if (!(flags & FL_INTERACTIVE) ||
|
||||
+ !ask_yn(_("Continue checking assuming version from command line?"), 1))
|
||||
return -1;
|
||||
detected_versions[type] = version;
|
||||
} else
|
||||
--
|
||||
2.13.6
|
||||
|
@ -1,35 +0,0 @@
|
||||
From b9525abadba082073e20e54ee7ad2423fc1ae6a8 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 5 Feb 2018 16:27:59 +0100
|
||||
Subject: [PATCH] quotacheck: Fail check if quota file magic is invalid
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Currently quotacheck will just continue if quotafile magic is invalid.
|
||||
Instead ask whether we should continue assuming quota format passed from
|
||||
the command line.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotacheck_v2.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/quotacheck_v2.c b/quotacheck_v2.c
|
||||
index 86fbf42..465765b 100644
|
||||
--- a/quotacheck_v2.c
|
||||
+++ b/quotacheck_v2.c
|
||||
@@ -357,6 +357,9 @@ static int check_header(char *filename, int fd, int type, int version)
|
||||
le32toh(head.dqh_version) > known_versions[type]) {
|
||||
errstr(_("WARNING - Quota file %s has corrupted headers\n"),
|
||||
filename);
|
||||
+ if (!(flags & FL_INTERACTIVE) ||
|
||||
+ !ask_yn(_("Continue checking assuming format from command line?"), 0))
|
||||
+ return -1;
|
||||
}
|
||||
if (le32toh(head.dqh_version) != version) {
|
||||
errstr(_("Quota file format version %d does not match the one "
|
||||
--
|
||||
2.13.6
|
||||
|
@ -1,88 +0,0 @@
|
||||
From 7b6dfd6390476ec7b811c76e4e2653db2994cad4 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 5 Feb 2018 15:54:54 +0100
|
||||
Subject: [PATCH] quotacheck: Report error when caching of quota file fails
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Currently quotacheck returns with zero exit code even though caching of
|
||||
quota file fails. Fix it to return with non-zero exit code in that case
|
||||
as expected.
|
||||
|
||||
Reported-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotacheck.c | 29 ++++++++++++++++++++++-------
|
||||
1 file changed, 22 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/quotacheck.c b/quotacheck.c
|
||||
index 9d7940b..b1302b6 100644
|
||||
--- a/quotacheck.c
|
||||
+++ b/quotacheck.c
|
||||
@@ -924,6 +924,7 @@ static int check_dir(struct mount_entry *mnt)
|
||||
struct stat st;
|
||||
int remounted = 0;
|
||||
int failed = 0;
|
||||
+ int ret;
|
||||
|
||||
if (lstat(mnt->me_dir, &st) < 0)
|
||||
die(2, _("Cannot stat mountpoint %s: %s\n"), mnt->me_dir, strerror(errno));
|
||||
@@ -939,14 +940,22 @@ static int check_dir(struct mount_entry *mnt)
|
||||
*/
|
||||
if (cfmt == QF_XFS)
|
||||
goto start_scan;
|
||||
- if (ucheck)
|
||||
- if (process_file(mnt, USRQUOTA) < 0)
|
||||
+ if (ucheck) {
|
||||
+ ret = process_file(mnt, USRQUOTA);
|
||||
+ if (ret < 0) {
|
||||
+ failed |= ret;
|
||||
ucheck = 0;
|
||||
- if (gcheck)
|
||||
- if (process_file(mnt, GRPQUOTA) < 0)
|
||||
+ }
|
||||
+ }
|
||||
+ if (gcheck) {
|
||||
+ ret = process_file(mnt, GRPQUOTA);
|
||||
+ if (ret < 0) {
|
||||
+ failed |= ret;
|
||||
gcheck = 0;
|
||||
+ }
|
||||
+ }
|
||||
if (!ucheck && !gcheck) /* Nothing to check? */
|
||||
- return 0;
|
||||
+ return failed;
|
||||
if (!(flags & FL_NOREMOUNT)) {
|
||||
/* Now we try to remount fs read-only to prevent races when scanning filesystem */
|
||||
if (mount
|
||||
@@ -978,8 +987,11 @@ start_scan:
|
||||
!strcmp(mnt->me_type, MNTTYPE_EXT3) ||
|
||||
!strcmp(mnt->me_type, MNTTYPE_NEXT3) ||
|
||||
!strcmp(mnt->me_type, MNTTYPE_EXT4)) {
|
||||
- if ((failed = ext2_direct_scan(mnt->me_devname)) < 0)
|
||||
+ ret = ext2_direct_scan(mnt->me_devname);
|
||||
+ if (ret < 0) {
|
||||
+ failed |= ret;
|
||||
goto out;
|
||||
+ }
|
||||
}
|
||||
else {
|
||||
#else
|
||||
@@ -987,8 +999,11 @@ start_scan:
|
||||
#endif
|
||||
if (flags & FL_VERYVERBOSE)
|
||||
putchar('\n');
|
||||
- if ((failed = scan_dir(mnt->me_dir)) < 0)
|
||||
+ ret = scan_dir(mnt->me_dir);
|
||||
+ if (ret < 0) {
|
||||
+ failed |= ret;
|
||||
goto out;
|
||||
+ }
|
||||
}
|
||||
dirs_done++;
|
||||
if (flags & FL_VERBOSE || flags & FL_DEBUG)
|
||||
--
|
||||
2.13.6
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 0f255ef2570478a855361937445a57a168c8629d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Thu, 23 Aug 2018 11:23:43 +0200
|
||||
Subject: [PATCH 2/3] quotackeck: Fix a directory descriptor leak in scan_dir()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotacheck.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/quotacheck.c b/quotacheck.c
|
||||
index fd01dfc..2cdf475 100644
|
||||
--- a/quotacheck.c
|
||||
+++ b/quotacheck.c
|
||||
@@ -538,6 +538,7 @@ static int scan_dir(const char *pathname)
|
||||
if ((lstat(de->d_name, &st)) == -1) {
|
||||
errstr(_("lstat: Cannot stat `%s/%s': %s\nGuess you'd better run fsck first !\nexiting...\n"),
|
||||
pathname, de->d_name, strerror(errno));
|
||||
+ closedir(dp);
|
||||
goto out;
|
||||
}
|
||||
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 1806ee01060d363beac01fda28c613ab27dbc4df Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Wed, 10 Jan 2018 10:18:43 +0100
|
||||
Subject: [PATCH] repquota: Fix output when user -2 exists
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Vladimit Meshkov reported that when user -2 exists and user namespaces
|
||||
are enabled in the kernel, repquota(8) fails to output anything. He also
|
||||
analyzed this is because in such case repquota(8) tries to query info
|
||||
for user -1 which is invalid ID, gets error from the kernel, and bails
|
||||
out.
|
||||
|
||||
Fix the problem by stopping iteration over IDs when we reach ID -1.
|
||||
|
||||
Reported-by: Vladimir Meshkov <ubob74@gmail.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotaio_generic.c | 5 +++++
|
||||
quotaio_xfs.c | 5 +++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/quotaio_generic.c b/quotaio_generic.c
|
||||
index 025d712..5b23955 100644
|
||||
--- a/quotaio_generic.c
|
||||
+++ b/quotaio_generic.c
|
||||
@@ -204,6 +204,11 @@ int vfs_scan_dquots(struct quota_handle *h,
|
||||
if (ret < 0)
|
||||
break;
|
||||
id = kdqblk.dqb_id + 1;
|
||||
+ /* id -1 is invalid and the last one... */
|
||||
+ if (id == -1) {
|
||||
+ errno = ENOENT;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
free(dquot);
|
||||
|
||||
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
|
||||
index 1374cf4..56daf89 100644
|
||||
--- a/quotaio_xfs.c
|
||||
+++ b/quotaio_xfs.c
|
||||
@@ -219,6 +219,11 @@ static int xfs_kernel_scan_dquots(struct quota_handle *h,
|
||||
if (ret < 0)
|
||||
break;
|
||||
id = xdqblk.d_id + 1;
|
||||
+ /* id -1 is invalid and the last one... */
|
||||
+ if (id == -1) {
|
||||
+ errno = ENOENT;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
free(dquot);
|
||||
|
||||
--
|
||||
2.13.6
|
||||
|
@ -1,35 +0,0 @@
|
||||
From d7694c952073bf2ebb852014d9f979b5e3e7c018 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 28 May 2018 18:08:24 +0200
|
||||
Subject: [PATCH] rpc: Fix wrong limit for space usage
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Limit of maximum allowable space usage for RPC transfer was wrongly set
|
||||
to ~4GB instead of ~4TB due to overflow in constant initialization. Fix
|
||||
it.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotaio_rpc.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/quotaio_rpc.c b/quotaio_rpc.c
|
||||
index 6f25144..edc1e9f 100644
|
||||
--- a/quotaio_rpc.c
|
||||
+++ b/quotaio_rpc.c
|
||||
@@ -33,7 +33,8 @@ static int rpc_init_io(struct quota_handle *h)
|
||||
#ifdef RPC
|
||||
h->qh_info.dqi_max_b_limit = ~(uint32_t)0;
|
||||
h->qh_info.dqi_max_i_limit = ~(uint32_t)0;
|
||||
- h->qh_info.dqi_max_b_usage = (~(uint32_t)0) << QUOTABLOCK_BITS;
|
||||
+ h->qh_info.dqi_max_b_usage = ((uint64_t)(~(uint32_t)0))
|
||||
+ << QUOTABLOCK_BITS;
|
||||
h->qh_info.dqi_max_i_usage = ~(uint32_t)0;
|
||||
return 0;
|
||||
#else
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 869f514310b72169a294baa37f5a90a291f719f3 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Thu, 23 Aug 2018 11:51:47 +0200
|
||||
Subject: [PATCH 3/3] xqmstats: Fix a file descriptor leak in main()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
xqmstats.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/xqmstats.c b/xqmstats.c
|
||||
index cdac4a6..59b1d66 100644
|
||||
--- a/xqmstats.c
|
||||
+++ b/xqmstats.c
|
||||
@@ -35,6 +35,7 @@ int main(int argc, char **argv)
|
||||
if ((stats = fopen(XQMSTATS, "r")) == NULL) {
|
||||
if ((stats = fopen(STATFILE, "r")) == NULL) {
|
||||
errstr(_("The running kernel does not support XFS\n"));
|
||||
+ fclose(xqm);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,42 +0,0 @@
|
||||
From 13bb8c2daca0f1c1099ce6ba9dcb23319f7955d0 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Wed, 20 May 2020 16:22:52 +0200
|
||||
Subject: [PATCH 2/2] Fix limits setting on XFS filesystem
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
xfs_commit_dquot() always set FS_DQ_LIMIT_MASK when calling
|
||||
Q_XFS_SETQLIM. So far this wasn't a problem since quota tools didn't
|
||||
support setting of anything else for XFS but now that kernel will start
|
||||
supporting setting of grace times for XFS, we need to be more careful
|
||||
and set limits bits only if we really want to update them. Also
|
||||
FS_DQ_LIMIT_MASK contains real-time limits as well. Quota tools
|
||||
currently don't support them in any way so avoid telling kernel to set
|
||||
them.
|
||||
|
||||
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotaio_xfs.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
|
||||
index a4d6f67..3333bb1 100644
|
||||
--- a/quotaio_xfs.c
|
||||
+++ b/quotaio_xfs.c
|
||||
@@ -165,7 +165,9 @@ static int xfs_commit_dquot(struct dquot *dquot, int flags)
|
||||
if (flags & COMMIT_USAGE) /* block usage */
|
||||
xdqblk.d_fieldmask |= FS_DQ_BCOUNT;
|
||||
} else {
|
||||
- xdqblk.d_fieldmask |= FS_DQ_LIMIT_MASK;
|
||||
+ if (flags & COMMIT_LIMITS) /* warn/limit */
|
||||
+ xdqblk.d_fieldmask |= FS_DQ_BSOFT | FS_DQ_BHARD |
|
||||
+ FS_DQ_ISOFT | FS_DQ_IHARD;
|
||||
if (flags & COMMIT_TIMES) /* indiv grace period */
|
||||
xdqblk.d_fieldmask |= FS_DQ_TIMER_MASK;
|
||||
}
|
||||
--
|
||||
2.25.4
|
||||
|
@ -1,39 +0,0 @@
|
||||
From be96da2353669d433b0abddb85b26ccaf35e3451 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Sandeen <sandeen@redhat.com>
|
||||
Date: Thu, 14 May 2020 12:17:29 +0200
|
||||
Subject: [PATCH 1/2] quota-tools: Set FS_DQ_TIMER_MASK for individual xfs
|
||||
grace times
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
xfs quota code doesn't currently allow increasing an individual
|
||||
user's grace time, but kernel patches are in development for this.
|
||||
|
||||
In order for setquota to be able to send this update via
|
||||
setquota -T, we need to add the FS_DQ_TIMER_MASK when we are trying
|
||||
to update the grace times on an individual user's dquot.
|
||||
|
||||
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotaio_xfs.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
|
||||
index b22c7b4..a4d6f67 100644
|
||||
--- a/quotaio_xfs.c
|
||||
+++ b/quotaio_xfs.c
|
||||
@@ -166,6 +166,8 @@ static int xfs_commit_dquot(struct dquot *dquot, int flags)
|
||||
xdqblk.d_fieldmask |= FS_DQ_BCOUNT;
|
||||
} else {
|
||||
xdqblk.d_fieldmask |= FS_DQ_LIMIT_MASK;
|
||||
+ if (flags & COMMIT_TIMES) /* indiv grace period */
|
||||
+ xdqblk.d_fieldmask |= FS_DQ_TIMER_MASK;
|
||||
}
|
||||
|
||||
qcmd = QCMD(Q_XFS_SETQLIM, h->qh_type);
|
||||
--
|
||||
2.25.4
|
||||
|
@ -1,56 +0,0 @@
|
||||
From fdd774bf08e56872ae4c0420e0f01efa25e715d6 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Sandeen <sandeen@redhat.com>
|
||||
Date: Fri, 8 May 2020 14:36:46 -0500
|
||||
Subject: [PATCH] quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Older kernels ignored the type sent to Q_XFS_GETQSTAT, and returned
|
||||
timer information for the first quota type which was found to be
|
||||
enabled.
|
||||
|
||||
As of 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls")
|
||||
the kernel now honors the quota type requested, so send that from the
|
||||
Q_XFS_GETQSTAT calls in quota tools.
|
||||
|
||||
Older kernels ignore the type altogether, so this change should be
|
||||
backwards compatible with no change in behavior.
|
||||
|
||||
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotaio_xfs.c | 2 +-
|
||||
quotaon_xfs.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
|
||||
index 56daf89..b22c7b4 100644
|
||||
--- a/quotaio_xfs.c
|
||||
+++ b/quotaio_xfs.c
|
||||
@@ -81,7 +81,7 @@ static int xfs_init_io(struct quota_handle *h)
|
||||
struct xfs_mem_dqinfo info;
|
||||
int qcmd;
|
||||
|
||||
- qcmd = QCMD(Q_XFS_GETQSTAT, 0);
|
||||
+ qcmd = QCMD(Q_XFS_GETQSTAT, h->qh_type);
|
||||
memset(&info, 0, sizeof(struct xfs_mem_dqinfo));
|
||||
if (quotactl(qcmd, h->qh_quotadev, 0, (void *)&info) < 0)
|
||||
return -1;
|
||||
diff --git a/quotaon_xfs.c b/quotaon_xfs.c
|
||||
index d557a75..d137240 100644
|
||||
--- a/quotaon_xfs.c
|
||||
+++ b/quotaon_xfs.c
|
||||
@@ -32,7 +32,7 @@ static int xfs_state_check(int qcmd, int type, int flags, const char *dev, int r
|
||||
if (flags & STATEFLAG_ALL)
|
||||
return 0; /* noop */
|
||||
|
||||
- if (quotactl(QCMD(Q_XFS_GETQSTAT, 0), dev, 0, (void *)&info) < 0) {
|
||||
+ if (quotactl(QCMD(Q_XFS_GETQSTAT, type), dev, 0, (void *)&info) < 0) {
|
||||
errstr(_("quotactl() on %s: %s\n"), dev, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
--
|
||||
2.25.4
|
||||
|
@ -0,0 +1,43 @@
|
||||
From 1959f3768a284315250acd4d17a9f5ef0b8ea189 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 30 Nov 2020 16:35:26 +0100
|
||||
Subject: [PATCH] Drop sys/cdefs.h usage
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
quota.h header includes sys/cdefs.h because it uses __P() macro in
|
||||
quotactl syscall declaration. However glibc currently defines __P() is
|
||||
nop and it only causes issues with other libc implementations (e.g. musl
|
||||
libc). So just drop __P() usage and sys/cdefs.h include.
|
||||
|
||||
Reported-by: 2xsaiko <git@dblsaiko.net>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quota.h | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/quota.h b/quota.h
|
||||
index 4c21411..845cbbd 100644
|
||||
--- a/quota.h
|
||||
+++ b/quota.h
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef GUARD_QUOTA_H
|
||||
#define GUARD_QUOTA_H
|
||||
|
||||
-#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -182,6 +181,6 @@ enum {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
-long quotactl __P((int, const char *, qid_t, caddr_t));
|
||||
+long quotactl(int, const char *, qid_t, caddr_t);
|
||||
|
||||
#endif /* _QUOTA_ */
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 25f16b1de313ce0d411f754572f94f051bfbe3c8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Tue, 16 Mar 2021 17:28:15 +0100
|
||||
Subject: [PATCH] quota_nld: Initialize sa_mask when registering PID file
|
||||
removal
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
term_action.sa_mask is an automatic variable and and thus unitialized.
|
||||
This patch empties the signal mask.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
quota_nld.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/quota_nld.c b/quota_nld.c
|
||||
index 72d99a9..09c4775 100644
|
||||
--- a/quota_nld.c
|
||||
+++ b/quota_nld.c
|
||||
@@ -466,7 +466,7 @@ static void use_pid_file(void)
|
||||
|
||||
term_action.sa_handler = remove_pid;
|
||||
term_action.sa_flags = 0;
|
||||
- if (sigaction(SIGTERM, &term_action, NULL))
|
||||
+ if (sigemptyset(&term_action.sa_mask) || sigaction(SIGTERM, &term_action, NULL))
|
||||
errstr(_("Could not register PID file removal on SIGTERM.\n"));
|
||||
if (store_pid())
|
||||
errstr(_("Could not store my PID %jd.\n"), (intmax_t )getpid());
|
||||
--
|
||||
2.26.3
|
||||
|
@ -0,0 +1,32 @@
|
||||
From 55f1a0604bd4df6d591674b5bef123be1af84e55 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Fri, 20 Nov 2020 15:28:49 +0100
|
||||
Subject: [PATCH] quotacheck: Remove a dead code from process_file()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The ret variable inicialization is useless because it is assigned in
|
||||
all (two) subsequent code branches.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
quotacheck.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/quotacheck.c b/quotacheck.c
|
||||
index 5810ced..1b81610 100644
|
||||
--- a/quotacheck.c
|
||||
+++ b/quotacheck.c
|
||||
@@ -672,7 +672,6 @@ Please turn quotas off or use -f to force checking.\n"),
|
||||
}
|
||||
}
|
||||
|
||||
- ret = 0;
|
||||
memset(old_info + type, 0, sizeof(old_info[type]));
|
||||
if (is_tree_qfmt(cfmt))
|
||||
ret = v2_buffer_file(qfname, fd, type, cfmt);
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,72 @@
|
||||
From 43b6e31f39edbe7de4f4feeef4d0cf6be093e021 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 23 Nov 2020 17:12:27 +0100
|
||||
Subject: [PATCH] quotaio_xfs: Warn when large kernel timestamps cannot be
|
||||
handled
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When time_t is 32-bit, warn if the kernel returns anything that cannot
|
||||
fit in these time stamps. This also fixes a compilation warning that
|
||||
shift exceeds data type size. Similarly when converting data to pass to
|
||||
kernel, just avoid the pointless shift (generating compiler warning)
|
||||
when time_t is 32-bit.
|
||||
|
||||
Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
configure.ac | 2 ++
|
||||
quotaio_xfs.c | 9 +++++++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 2239b49..296b77a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -82,6 +82,8 @@ AS_IF([test x"$enable_werror" != "xno"], [
|
||||
])
|
||||
AC_SUBST([WARN_CFLAGS])
|
||||
|
||||
+AC_CHECK_SIZEOF([time_t], [], [#include <time.h>])
|
||||
+
|
||||
# =========
|
||||
# Find ldap
|
||||
# =========
|
||||
diff --git a/quotaio_xfs.c b/quotaio_xfs.c
|
||||
index 2db1c0c..5abb2c2 100644
|
||||
--- a/quotaio_xfs.c
|
||||
+++ b/quotaio_xfs.c
|
||||
@@ -45,8 +45,13 @@ report: xfs_report
|
||||
static inline time_t xfs_kern2utildqblk_ts(const struct xfs_kern_dqblk *k,
|
||||
__s32 timer, __s8 timer_hi)
|
||||
{
|
||||
+#if SIZEOF_TIME_T > 4
|
||||
if (k->d_fieldmask & FS_DQ_BIGTIME)
|
||||
return (__u32)timer | (__s64)timer_hi << 32;
|
||||
+#else
|
||||
+ if (k->d_fieldmask & FS_DQ_BIGTIME && timer_hi != 0)
|
||||
+ errstr(_("Truncating kernel returned time stamp."));
|
||||
+#endif
|
||||
return timer;
|
||||
}
|
||||
|
||||
@@ -54,10 +59,14 @@ static inline void xfs_util2kerndqblk_ts(const struct xfs_kern_dqblk *k,
|
||||
__s32 *timer_lo, __s8 *timer_hi, time_t timer)
|
||||
{
|
||||
*timer_lo = timer;
|
||||
+#if SIZEOF_TIME_T > 4
|
||||
if (k->d_fieldmask & FS_DQ_BIGTIME)
|
||||
*timer_hi = timer >> 32;
|
||||
else
|
||||
*timer_hi = 0;
|
||||
+#else
|
||||
+ *timer_hi = 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static inline int want_bigtime(time_t timer)
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,39 @@
|
||||
From 8a3321627bb9215ed40f8f7036a1e86bcaf10ad1 Mon Sep 17 00:00:00 2001
|
||||
From: "Dmitry V. Levin" <ldv@altlinux.org>
|
||||
Date: Sun, 22 Nov 2020 08:00:00 +0000
|
||||
Subject: [PATCH] quotaops: fix compilation warning
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When quota is configured using --enable-werror --disable-bsd_behaviour,
|
||||
the compilation fails with the following diagnostics:
|
||||
|
||||
quotaops.c: In function 'getprivs':
|
||||
quotaops.c:143:1: error: label 'out_err' defined but not used [-Werror=unused-label]
|
||||
|
||||
Fixes: 7942290a ("quotaops: Do not leak dquot structures on failure")
|
||||
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
quotaops.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/quotaops.c b/quotaops.c
|
||||
index ff4d16e..96086f4 100644
|
||||
--- a/quotaops.c
|
||||
+++ b/quotaops.c
|
||||
@@ -140,7 +140,9 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int ignore_noquo
|
||||
id2name(id, handles[i]->qh_type, name);
|
||||
errstr(_("error while getting quota from %s for %s (id %u): %s\n"),
|
||||
handles[i]->qh_quotadev, name, id, estr);
|
||||
+#if defined(BSD_BEHAVIOUR)
|
||||
out_err:
|
||||
+#endif
|
||||
freeprivs(qhead);
|
||||
return NULL;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
Loading…
Reference in new issue