All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix minixfs block limit check
@ 2012-05-09 20:11 Vladimir 'φ-coder/phcoder' Serbinenko
  2012-05-09 21:58 ` Fwd: " Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-05-09 20:11 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

Hello, all. On minix2 and minix3 usually max_size is 7fffffff and the
check in question prohibits creation of last block spanning right before
7fffffff. Here is a fix:

--- fs/minix/itree_v2.c    2011-04-23 01:34:36.363725380 +0200
+++ /home/phcoder/projects/fs/minix/itree_v2.c    2012-05-09
21:47:52.335621065 +0200
@@ -32,7 +32,8 @@
     if (block < 0) {
         printk("MINIX-fs: block_to_path: block %ld < 0 on dev %s\n",
             block, bdevname(sb->s_bdev, b));
-    } else if (block >=
(minix_sb(inode->i_sb)->s_max_size/sb->s_blocksize)) {
+    } else if ((u64) block * (u64) sb->s_blocksize
+           >= minix_sb(inode->i_sb)->s_max_size) {
         if (printk_ratelimit())
             printk("MINIX-fs: block_to_path: "

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

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

* Fwd: [PATCH] fix minixfs block limit check
  2012-05-09 20:11 [PATCH] fix minixfs block limit check Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-05-09 21:58 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-05-09 21:58 UTC (permalink / raw)
  To: linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]


Since it was ignored on LKML, I guess this should be the right place to
send this patch to.

-------- Original Message --------
Subject: 	[PATCH] fix minixfs block limit check
Date: 	Wed, 09 May 2012 22:11:01 +0200
From: 	Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>
To: 	linux-kernel@vger.kernel.org



Hello, all. On minix2 and minix3 usually max_size is 7fffffff and the
check in question prohibits creation of last block spanning right before
7fffffff. Here is a fix:

--- fs/minix/itree_v2.c    2011-04-23 01:34:36.363725380 +0200
+++ /home/phcoder/projects/fs/minix/itree_v2.c    2012-05-09
21:47:52.335621065 +0200
@@ -32,7 +32,8 @@
     if (block < 0) {
         printk("MINIX-fs: block_to_path: block %ld < 0 on dev %s\n",
             block, bdevname(sb->s_bdev, b));
-    } else if (block >=
(minix_sb(inode->i_sb)->s_max_size/sb->s_blocksize)) {
+    } else if ((u64) block * (u64) sb->s_blocksize
+           >= minix_sb(inode->i_sb)->s_max_size) {
         if (printk_ratelimit())
             printk("MINIX-fs: block_to_path: "

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko






[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

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

end of thread, other threads:[~2012-05-09 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-09 20:11 [PATCH] fix minixfs block limit check Vladimir 'φ-coder/phcoder' Serbinenko
2012-05-09 21:58 ` Fwd: " Vladimir 'φ-coder/phcoder' Serbinenko

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.