Skip to contentSkip to conversation

lscp: always show snapshots, even if marked minor

PATCH In review Dan McGee 2 participants 3 messages Sep 1, 2014 – Sep 9, 2014 2 messages not in the archive NILFS2 filesystem

lore
Share & tools
lore

Dan McGee

author
#0 lore raw

PATCH 1/1 lscp: always show snapshots, even if marked minor

When the average user types lscp and doesn't see the snapshot they just tried to make, it can be very confusing. Add an additional check to ensure snapshots are never omitted from lscp output.

---

Thoughts? I notice this quite often due to a "snapshot-on-shutdown" job I have running on my machine, and it is very odd to not see this snapshot listed next time I boot up and run lscp -r | less.

 bin/lscp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/lscp.c +1 -1
index 2de81b6..6803657 100644
@@ -159,7 +159,7 @@ static int lscp_forward_cpinfo(struct nilfs *nilfs,
 			break;
 
 		for (cpi = cpinfos; cpi < cpinfos + n; cpi++) {
-			if (show_all || !nilfs_cpinfo_minor(cpi)) {
+			if (show_all || nilfs_cpinfo_snapshot(cpi) || !nilfs_cpinfo_minor(cpi)) {
 				lscp_print_cpinfo(cpi);
 				rest--;
 			}
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1409600926-25385-1-git-send-email-dan-fd97jBR+K/[email protected]

#2 lore raw
Quoted 19 lines · Dan McGee

When the average user types lscp and doesn't see the snapshot they just tried to make, it can be very confusing. Add an additional check to ensure snapshots are never omitted from lscp output.

---

Thoughts? I notice this quite often due to a "snapshot-on-shutdown" job I have running on my machine, and it is very odd to not see this snapshot listed next time I boot up and run lscp -r | less.

 bin/lscp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/lscp.c +0 -0
index 2de81b6..6803657 100644

bin/lscp.c static int lscp_forward_cpinfo(struct nilfs *nilfs, · line 165

Quoted 8 lines
bin/lscp.c +1 -1
@@ -159,7 +159,7 @@ static int lscp_forward_cpinfo(struct nilfs *nilfs,
 			break;
 
 		for (cpi = cpinfos; cpi < cpinfos + n; cpi++) {
-			if (show_all || !nilfs_cpinfo_minor(cpi)) {
+			if (show_all || nilfs_cpinfo_snapshot(cpi) || !nilfs_cpinfo_minor(cpi)) {
 				lscp_print_cpinfo(cpi);
 				rest--;
 			}

"lscp -r" still doesn't show snapshots on minor checkpoints. The same change looks to be needed for lscp_backward_cpinfo().

Also, this patch suffered a checkpatch warning:

 $ scripts/checkpatch.pl ~/lscp-always-show-snapshots-even-if-marked-minor.patch
 WARNING: line over 80 characters
 #75: FILE: bin/lscp.c:162:
 +		if (show_all || nilfs_cpinfo_snapshot(cpi) || !nilfs_cpinfo_minor(cpi)) {

total: 0 errors, 1 warnings, 8 lines checked

Please insert line feeds as follows:

		if (show_all || nilfs_cpinfo_snapshot(cpi) ||
		    !nilfs_cpinfo_minor(cpi)) {

Thanks,
Ryusuke Konishi
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20140903.023057.865227985663964185.konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org

#4 lore raw
Quoted 32 lines · Ryusuke Konishi
Quoted 19 lines · Dan McGee

When the average user types lscp and doesn't see the snapshot they just tried to make, it can be very confusing. Add an additional check to ensure snapshots are never omitted from lscp output.

---

Thoughts? I notice this quite often due to a "snapshot-on-shutdown" job I have running on my machine, and it is very odd to not see this snapshot listed next time I boot up and run lscp -r | less.

 bin/lscp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/lscp.c +0 -0
index 2de81b6..6803657 100644

bin/lscp.c static int lscp_forward_cpinfo(struct nilfs *nilfs, · line 165

Quoted 8 lines
bin/lscp.c +1 -1
@@ -159,7 +159,7 @@ static int lscp_forward_cpinfo(struct nilfs *nilfs,
 			break;
 
 		for (cpi = cpinfos; cpi < cpinfos + n; cpi++) {
-			if (show_all || !nilfs_cpinfo_minor(cpi)) {
+			if (show_all || nilfs_cpinfo_snapshot(cpi) || !nilfs_cpinfo_minor(cpi)) {
 				lscp_print_cpinfo(cpi);
 				rest--;
 			}

"lscp -r" still doesn't show snapshots on minor checkpoints. The same change looks to be needed for lscp_backward_cpinfo().

Quoted 8 lines

Also, this patch suffered a checkpatch warning:

 $ scripts/checkpatch.pl ~/lscp-always-show-snapshots-even-if-marked-minor.patch
 WARNING: line over 80 characters
 #75: FILE: bin/lscp.c:162:
 +		if (show_all || nilfs_cpinfo_snapshot(cpi) || !nilfs_cpinfo_minor(cpi)) {

total: 0 errors, 1 warnings, 8 lines checked

I merged this patch anyway fixing the above checkpatch warning, and added a complemental change to apply the same change for the reverse mode ("lscp -r").

Regards,
Ryusuke Konishi
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html