All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] befs: check return of sb_min_blocksize
@ 2016-06-12  2:57 Luis de Bethencourt
  2016-06-12  2:57 ` [PATCH 2/3] befs: fix function name in documentation Luis de Bethencourt
  2016-06-12  2:57 ` [PATCH 3/3] befs: remove unused functions Luis de Bethencourt
  0 siblings, 2 replies; 3+ messages in thread
From: Luis de Bethencourt @ 2016-06-12  2:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, salah.triki, viro, hannes, vdavydov, Luis de Bethencourt

Confirm sb_min_blocksize() succeeded before continuing.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
Hi,

This is the main fix I wanted to send. I noticed other file systems check
the return of sb_min_blocksize(), it can fail so it is worth checking before
continuing.

Thanks :)
Luis

 fs/befs/linuxvfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index c734f21..453bb68 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -756,6 +756,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 	long ret = -EINVAL;
 	const unsigned long sb_block = 0;
 	const off_t x86_sb_off = 512;
+	int blocksize;
 
 	save_mount_options(sb, data);
 
@@ -788,7 +789,11 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
 	 * least 1k to get the second 512 bytes of the volume.
 	 * -WD 10-26-01
 	 */ 
-	sb_min_blocksize(sb, 1024);
+	blocksize = sb_min_blocksize(sb, 1024);
+	if (!blocksize) {
+		befs_error(sb, "unable to set blocksize");
+		goto unacquire_priv_sbp;
+	}
 
 	if (!(bh = sb_bread(sb, sb_block))) {
 		if (!silent)
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] befs: fix function name in documentation
  2016-06-12  2:57 [PATCH 1/3] befs: check return of sb_min_blocksize Luis de Bethencourt
@ 2016-06-12  2:57 ` Luis de Bethencourt
  2016-06-12  2:57 ` [PATCH 3/3] befs: remove unused functions Luis de Bethencourt
  1 sibling, 0 replies; 3+ messages in thread
From: Luis de Bethencourt @ 2016-06-12  2:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, salah.triki, viro, hannes, vdavydov, Luis de Bethencourt

Documentation of function befs_load_cb lists it as load_befs_sb. Fixing the
misnomer.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
 fs/befs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/befs/super.c b/fs/befs/super.c
index aeafc4d..9d1b56c 100644
--- a/fs/befs/super.c
+++ b/fs/befs/super.c
@@ -14,7 +14,7 @@
 #include "super.h"
 
 /**
- * load_befs_sb -- Read from disk and properly byteswap all the fields
+ * befs_load_sb -- Read from disk and properly byteswap all the fields
  * of the befs superblock
  *
  *
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] befs: remove unused functions
  2016-06-12  2:57 [PATCH 1/3] befs: check return of sb_min_blocksize Luis de Bethencourt
  2016-06-12  2:57 ` [PATCH 2/3] befs: fix function name in documentation Luis de Bethencourt
@ 2016-06-12  2:57 ` Luis de Bethencourt
  1 sibling, 0 replies; 3+ messages in thread
From: Luis de Bethencourt @ 2016-06-12  2:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: akpm, salah.triki, viro, hannes, vdavydov, Luis de Bethencourt

befs_iaddr_is_empty() and befs_brun_size() are unused. Removing them.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---
 fs/befs/befs.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/fs/befs/befs.h b/fs/befs/befs.h
index e0f59263a..c5c6cd1 100644
--- a/fs/befs/befs.h
+++ b/fs/befs/befs.h
@@ -140,18 +140,6 @@ befs_iaddrs_per_block(struct super_block *sb)
 	return BEFS_SB(sb)->block_size / sizeof (befs_disk_inode_addr);
 }
 
-static inline int
-befs_iaddr_is_empty(const befs_inode_addr *iaddr)
-{
-	return (!iaddr->allocation_group) && (!iaddr->start) && (!iaddr->len);
-}
-
-static inline size_t
-befs_brun_size(struct super_block *sb, befs_block_run run)
-{
-	return BEFS_SB(sb)->block_size * run.len;
-}
-
 #include "endian.h"
 
 #endif				/* _LINUX_BEFS_H */
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-12  2:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12  2:57 [PATCH 1/3] befs: check return of sb_min_blocksize Luis de Bethencourt
2016-06-12  2:57 ` [PATCH 2/3] befs: fix function name in documentation Luis de Bethencourt
2016-06-12  2:57 ` [PATCH 3/3] befs: remove unused functions Luis de Bethencourt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.