Christian Kujau | 17 May 2013 14:02
Picon

xattr performance

Hi,

a while ago I was setting & reading extended attributes to ~25000 files 
in a directory structure on an XFS filesystem. The files were usually a 
few MB in size, but some where up to 2GB in size.

Anyway, I *felt* that setting or reading these xattrs was going very
slowly. While the storage may be not the fastest, stat()'ing these
files was fine, but getfattr/setfattr took very long.

I got curious and while it turned out that the slowness was related to the 
wrapper script I used to read/set those values, I created a little test 
suite to 1) create a few thousand files and 2) do xattr operations on 
them and see if xattr performance was filesystem specific:

   http://nerdbynature.de/bits/xattr/

Not very sophisticated, true. But it was interesting to see that 
ext3/ext4/xfs behaved kinda well for all these tests; btrfs/jfs/reiserfs
sometimes took way longer than the others.

Christian.
--

-- 
BOFH excuse #43:

boss forgot system password

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
(Continue reading)

Dave Kleikamp | 3 May 2013 17:37
Picon
Favicon

[GIT PULL] jfs for 3.10

The following changes since commit 5f243b9b46a22e5790dbbc36f574c2417af49a41:

  Merge tag 'arm64-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64 (2013-01-04 10:41:54 -0800)

are available in the git repository at:

  git://github.com/kleikamp/linux-shaggy.git tags/jfs-3.10

for you to fetch changes up to 73aaa22d5ffb2630456bac2f9a4ed9b81d0d7271:

  jfs: fix a couple races (2013-05-01 11:16:59 -0500)

----------------------------------------------------------------
Dave Kleikamp (1):
      jfs: fix a couple races

Nickolai Zeldovich (1):
      jfs: avoid undefined behavior from left-shifting by 32 bits

 fs/jfs/inode.c      | 2 +-
 fs/jfs/jfs_imap.c   | 2 +-
 fs/jfs/jfs_logmgr.c | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
(Continue reading)

Craig Huff | 24 Jan 2013 21:17
Picon

Negative value for inode???

Short form is that I used jfs_debugfs to query for inode info for block 135537084 using "d 135537084 0 i" and di_number was returned as a negative value.  I got the same value for iagnum using the command "d 135537084 0 I".  What gives?  Is this an instance of a note I found on the web about a bug that would put a JFS error number in the inode and as a result corrupt file data on the partition (for one file? for the directory containing the affected file? for the whole partition?)?

Do I need to offload the files from the partition before taking any corrective action?  Should fsck fix the problem?  Will I need to reformat the partition to resolve this?

Any advice appreciated.

Craig.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Jfs-discussion mailing list
Jfs-discussion <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jfs-discussion
Dave Kleikamp | 7 Jan 2013 15:33
Picon
Favicon

Re: [PATCH] jfs: avoid undefined behavior from left-shifting by 32 bits

On 01/05/2013 01:19 PM, Nickolai Zeldovich wrote:
> Shifting a 32-bit int by 32 bits is undefined behavior in C, and
> results in different behavior on different architectures (e.g., x86
> and PowerPC).  diAlloc() in fs/jfs/jfs_imap.c computes a mask using
> 0xffffffffu<<(32-bitno), which can left-shift by 32 bits.  To avoid
> unexpected behavior, explicitly check for bitno==0 and use a 0 mask.

Thanks. Pushed to
git://github.com/kleikamp/linux-shaggy.git jfs-next

Shaggy

> 
> Signed-off-by: Nickolai Zeldovich <nickolai <at> csail.mit.edu>
> ---
>  fs/jfs/jfs_imap.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
> index 6ba4006..f7e042b 100644
> --- a/fs/jfs/jfs_imap.c
> +++ b/fs/jfs/jfs_imap.c
>  <at>  <at>  -1493,7 +1493,7  <at>  <at>  int diAlloc(struct inode *pip, bool dir, struct inode *ip)
>  		/* mask any prior bits for the starting words of the
>  		 * summary map.
>  		 */
> -		mask = ONES << (EXTSPERSUM - bitno);
> +		mask = (bitno == 0) ? 0 : (ONES << (EXTSPERSUM - bitno));
>  		inosmap = le32_to_cpu(iagp->inosmap[sword]) | mask;
>  		extsmap = le32_to_cpu(iagp->extsmap[sword]) | mask;
>  
> 

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
Marco Stornelli | 15 Dec 2012 11:54
Picon

[PATCH 12/21] jfs: drop vmtruncate

Removed vmtruncate

Signed-off-by: Marco Stornelli <marco.stornelli <at> gmail.com>
---
 fs/jfs/file.c  |    6 ++++--
 fs/jfs/inode.c |   20 ++++++++++++++------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 9d3afd1..dd7442c 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
 <at>  <at>  -119,9 +119,12  <at>  <at>  int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 	    iattr->ia_size != i_size_read(inode)) {
 		inode_dio_wait(inode);

-		rc = vmtruncate(inode, iattr->ia_size);
+		rc = inode_newsize_ok(inode, iattr->ia_size);
 		if (rc)
 			return rc;
+
+		truncate_setsize(inode, iattr->ia_size);
+		jfs_truncate(inode);
 	}

 	setattr_copy(inode, iattr);
 <at>  <at>  -133,7 +136,6  <at>  <at>  int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 }

 const struct inode_operations jfs_file_inode_operations = {
-	.truncate	= jfs_truncate,
 	.setxattr	= jfs_setxattr,
 	.getxattr	= jfs_getxattr,
 	.listxattr	= jfs_listxattr,
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 4692bf3..b7dc47b 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
 <at>  <at>  -300,6 +300,16  <at>  <at>  static int jfs_readpages(struct file *file, struct address_space *mapping,
 	return mpage_readpages(mapping, pages, nr_pages, jfs_get_block);
 }

+static void jfs_write_failed(struct address_space *mapping, loff_t to)
+{
+	struct inode *inode = mapping->host;
+
+	if (to > inode->i_size) {
+		truncate_pagecache(inode, to, inode->i_size);
+		jfs_truncate(inode);
+	}
+}
+
 static int jfs_write_begin(struct file *file, struct address_space *mapping,
 				loff_t pos, unsigned len, unsigned flags,
 				struct page **pagep, void **fsdata)
 <at>  <at>  -308,11 +318,8  <at>  <at>  static int jfs_write_begin(struct file *file, struct address_space *mapping,

 	ret = nobh_write_begin(mapping, pos, len, flags, pagep, fsdata,
 				jfs_get_block);
-	if (unlikely(ret)) {
-		loff_t isize = mapping->host->i_size;
-		if (pos + len > isize)
-			vmtruncate(mapping->host, isize);
-	}
+	if (unlikely(ret))
+		jfs_write_failed(mapping, pos + len);

 	return ret;
 }
 <at>  <at>  -326,6 +333,7  <at>  <at>  static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
 	const struct iovec *iov, loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
+	struct address_space *mapping = file->f_mapping;
 	struct inode *inode = file->f_mapping->host;
 	ssize_t ret;

 <at>  <at>  -341,7 +349,7  <at>  <at>  static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
 		loff_t end = offset + iov_length(iov, nr_segs);

 		if (end > isize)
-			vmtruncate(inode, isize);
+			jfs_write_failed(mapping, end);
 	}

 	return ret;
--

-- 
1.7.3.4

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
Marco Stornelli | 3 Nov 2012 10:28
Picon

[PATCH 12/21] jfs: drop vmtruncate

Removed vmtruncate

Signed-off-by: Marco Stornelli <marco.stornelli <at> gmail.com>
---
 fs/jfs/file.c  |    6 ++++--
 fs/jfs/inode.c |   20 ++++++++++++++------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 9d3afd1..dd7442c 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
 <at>  <at>  -119,9 +119,12  <at>  <at>  int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 	    iattr->ia_size != i_size_read(inode)) {
 		inode_dio_wait(inode);

-		rc = vmtruncate(inode, iattr->ia_size);
+		rc = inode_newsize_ok(inode, iattr->ia_size);
 		if (rc)
 			return rc;
+
+		truncate_setsize(inode, iattr->ia_size);
+		jfs_truncate(inode);
 	}

 	setattr_copy(inode, iattr);
 <at>  <at>  -133,7 +136,6  <at>  <at>  int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 }

 const struct inode_operations jfs_file_inode_operations = {
-	.truncate	= jfs_truncate,
 	.setxattr	= jfs_setxattr,
 	.getxattr	= jfs_getxattr,
 	.listxattr	= jfs_listxattr,
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 4692bf3..b7dc47b 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
 <at>  <at>  -300,6 +300,16  <at>  <at>  static int jfs_readpages(struct file *file, struct address_space *mapping,
 	return mpage_readpages(mapping, pages, nr_pages, jfs_get_block);
 }

+static void jfs_write_failed(struct address_space *mapping, loff_t to)
+{
+	struct inode *inode = mapping->host;
+
+	if (to > inode->i_size) {
+		truncate_pagecache(inode, to, inode->i_size);
+		jfs_truncate(inode);
+	}
+}
+
 static int jfs_write_begin(struct file *file, struct address_space *mapping,
 				loff_t pos, unsigned len, unsigned flags,
 				struct page **pagep, void **fsdata)
 <at>  <at>  -308,11 +318,8  <at>  <at>  static int jfs_write_begin(struct file *file, struct address_space *mapping,

 	ret = nobh_write_begin(mapping, pos, len, flags, pagep, fsdata,
 				jfs_get_block);
-	if (unlikely(ret)) {
-		loff_t isize = mapping->host->i_size;
-		if (pos + len > isize)
-			vmtruncate(mapping->host, isize);
-	}
+	if (unlikely(ret))
+		jfs_write_failed(mapping, pos + len);

 	return ret;
 }
 <at>  <at>  -326,6 +333,7  <at>  <at>  static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
 	const struct iovec *iov, loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
+	struct address_space *mapping = file->f_mapping;
 	struct inode *inode = file->f_mapping->host;
 	ssize_t ret;

 <at>  <at>  -341,7 +349,7  <at>  <at>  static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
 		loff_t end = offset + iov_length(iov, nr_segs);

 		if (end > isize)
-			vmtruncate(inode, isize);
+			jfs_write_failed(mapping, end);
 	}

 	return ret;
--

-- 
1.7.3.4

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
Dave Kleikamp | 23 Oct 2012 00:24
Picon
Favicon

[GIT PULL] jfs bug fix for 3.7

The following changes since commit 8d2b6b3ae280dcf6f6c7a95623670a57cdf562ed:

  Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh (2012-10-16 19:24:00 -0700)

are available in the git repository at:

  git://github.com/kleikamp/linux-shaggy.git tags/jfs-3.7-2

for you to fetch changes up to 4e7a4b01222343481d8ff084dbef9b80f7089a19:

  jfs: Fix FITRIM argument handling (2012-10-17 09:18:38 -0500)

----------------------------------------------------------------
Bug fix: Fix FITRIM argument handling

----------------------------------------------------------------
Lukas Czerner (1):
      jfs: Fix FITRIM argument handling

 fs/jfs/jfs_discard.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
Marco Stornelli | 20 Oct 2012 14:22
Picon

[PATCH 12/21] jfs: drop vmtruncate

Removed vmtruncate

Signed-off-by: Marco Stornelli <marco.stornelli <at> gmail.com>
---
 fs/jfs/file.c  |    6 ++++--
 fs/jfs/inode.c |   20 ++++++++++++++------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 9d3afd1..dd7442c 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
 <at>  <at>  -119,9 +119,12  <at>  <at>  int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 	    iattr->ia_size != i_size_read(inode)) {
 		inode_dio_wait(inode);

-		rc = vmtruncate(inode, iattr->ia_size);
+		rc = inode_newsize_ok(inode, iattr->ia_size);
 		if (rc)
 			return rc;
+
+		truncate_setsize(inode, iattr->ia_size);
+		jfs_truncate(inode);
 	}

 	setattr_copy(inode, iattr);
 <at>  <at>  -133,7 +136,6  <at>  <at>  int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 }

 const struct inode_operations jfs_file_inode_operations = {
-	.truncate	= jfs_truncate,
 	.setxattr	= jfs_setxattr,
 	.getxattr	= jfs_getxattr,
 	.listxattr	= jfs_listxattr,
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 4692bf3..b7dc47b 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
 <at>  <at>  -300,6 +300,16  <at>  <at>  static int jfs_readpages(struct file *file, struct address_space *mapping,
 	return mpage_readpages(mapping, pages, nr_pages, jfs_get_block);
 }

+static void jfs_write_failed(struct address_space *mapping, loff_t to)
+{
+	struct inode *inode = mapping->host;
+
+	if (to > inode->i_size) {
+		truncate_pagecache(inode, to, inode->i_size);
+		jfs_truncate(inode);
+	}
+}
+
 static int jfs_write_begin(struct file *file, struct address_space *mapping,
 				loff_t pos, unsigned len, unsigned flags,
 				struct page **pagep, void **fsdata)
 <at>  <at>  -308,11 +318,8  <at>  <at>  static int jfs_write_begin(struct file *file, struct address_space *mapping,

 	ret = nobh_write_begin(mapping, pos, len, flags, pagep, fsdata,
 				jfs_get_block);
-	if (unlikely(ret)) {
-		loff_t isize = mapping->host->i_size;
-		if (pos + len > isize)
-			vmtruncate(mapping->host, isize);
-	}
+	if (unlikely(ret))
+		jfs_write_failed(mapping, pos + len);

 	return ret;
 }
 <at>  <at>  -326,6 +333,7  <at>  <at>  static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
 	const struct iovec *iov, loff_t offset, unsigned long nr_segs)
 {
 	struct file *file = iocb->ki_filp;
+	struct address_space *mapping = file->f_mapping;
 	struct inode *inode = file->f_mapping->host;
 	ssize_t ret;

 <at>  <at>  -341,7 +349,7  <at>  <at>  static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
 		loff_t end = offset + iov_length(iov, nr_segs);

 		if (end > isize)
-			vmtruncate(inode, isize);
+			jfs_write_failed(mapping, end);
 	}

 	return ret;
--

-- 
1.7.3.4

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
Marco Stornelli | 20 Oct 2012 14:14
Picon

[PATCH 00/21 v3] drop vmtruncate

Hi all,

I sent the third version of the patch series. After a couple of comments 
by Al and Christoph, now the patches are no more 1:1 replace of 
vmtruncate. A lot of inode_newsize_ok() and truncate_setsize() are now 
gone. For each fs, where needed, I wrote a new fs_write_failed() (as 
suggested by Al watching the ext2 code). The modifications are a bit 
deeper and they are *not* tested. I ask for comments to each fs 
maintainers. I hope the series can be pushed for 3.8.

Changes:
v3: reworked after Al and Christoph comments
v2: add documentation cleaning
v1: first draft

Marco Stornelli (21):
   ufs: drop vmtruncate
   sysv: drop vmtruncate
   reiserfs: drop vmtruncate
   procfs: drop vmtruncate
   omfs: drop vmtruncate
   ocfs2: drop vmtruncate
   adfs: drop vmtruncate
   affs: drop vmtruncate
   bfs: drop vmtruncate
   hfs: drop vmtruncate
   hpfs: drop vmtruncate
   jfs: drop vmtruncate
   hfsplus: drop vmtruncate
   logfs: drop vmtruncate
   minix: drop vmtruncate
   ncpfs: drop vmtruncate
   nilfs2: drop vmtruncate
   ntfs: drop vmtruncate
   vfs: drop vmtruncate
   mm: drop vmtruncate
   Documentation: drop vmtruncate

  Documentation/filesystems/Locking |    6 ------
  Documentation/filesystems/porting |    2 +-
  Documentation/filesystems/vfs.txt |   11 -----------
  fs/adfs/inode.c                   |   15 ++++++++++-----
  fs/affs/file.c                    |   18 ++++++++++++------
  fs/affs/inode.c                   |    5 ++++-
  fs/bfs/file.c                     |   15 ++++++++++-----
  fs/hfs/inode.c                    |   26 ++++++++++++++++++--------
  fs/hfsplus/inode.c                |   27 ++++++++++++++++-----------
  fs/hpfs/file.c                    |   18 ++++++++++++------
  fs/hpfs/inode.c                   |    5 ++++-
  fs/jfs/file.c                     |    6 ++++--
  fs/jfs/inode.c                    |   20 ++++++++++++++------
  fs/libfs.c                        |    2 --
  fs/logfs/readwrite.c              |   10 ++++++++--
  fs/minix/file.c                   |    6 ++++--
  fs/minix/inode.c                  |   17 ++++++++++++-----
  fs/ncpfs/inode.c                  |    4 +---
  fs/nilfs2/file.c                  |    1 -
  fs/nilfs2/inode.c                 |   24 +++++++++++++++---------
  fs/nilfs2/nilfs.h                 |    1 +
  fs/nilfs2/recovery.c              |    3 ++-
  fs/ntfs/file.c                    |   16 +++++++++++++---
  fs/ntfs/inode.c                   |    8 ++++++--
  fs/ntfs/inode.h                   |    4 ++++
  fs/ocfs2/file.c                   |   19 +------------------
  fs/omfs/file.c                    |   22 +++++++++++++++-------
  fs/proc/base.c                    |    3 ++-
  fs/proc/generic.c                 |    3 ++-
  fs/proc/proc_sysctl.c             |    3 ++-
  fs/reiserfs/file.c                |    3 +--
  fs/reiserfs/inode.c               |   15 +++++++++++----
  fs/reiserfs/reiserfs.h            |    1 +
  fs/sysv/file.c                    |    5 +++--
  fs/sysv/itree.c                   |   17 ++++++++++++-----
  fs/ufs/inode.c                    |   15 ++++++++++-----
  include/linux/fs.h                |    1 -
  include/linux/mm.h                |    1 -
  mm/truncate.c                     |   23 -----------------------
  39 files changed, 231 insertions(+), 170 deletions(-)

--

-- 
1.7.3.4
---

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
Lukas Czerner | 16 Oct 2012 11:38
Picon
Favicon

[PATCH] jfs: Fix FITRIM argument handling

Currently when 'range->start' is beyond the end of file system
nothing is done and that fact is ignored, where in fact we should return
EINVAL. The same problem is when 'range.len' is smaller than file system
block.

Fix this by adding check for such conditions and return EINVAL
appropriately.

Signed-off-by: Lukas Czerner <lczerner <at> redhat.com>
---
 fs/jfs/jfs_discard.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/fs/jfs/jfs_discard.c b/fs/jfs/jfs_discard.c
index 9947563..dfcd503 100644
--- a/fs/jfs/jfs_discard.c
+++ b/fs/jfs/jfs_discard.c
 <at>  <at>  -83,7 +83,7  <at>  <at>  int jfs_ioc_trim(struct inode *ip, struct fstrim_range *range)
 	struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap;
 	struct super_block *sb = ipbmap->i_sb;
 	int agno, agno_end;
-	s64 start, end, minlen;
+	u64 start, end, minlen;
 	u64 trimmed = 0;

 	/**
 <at>  <at>  -93,15 +93,19  <at>  <at>  int jfs_ioc_trim(struct inode *ip, struct fstrim_range *range)
 	 * minlen:	minimum extent length in Bytes
 	 */
 	start = range->start >> sb->s_blocksize_bits;
-	if (start < 0)
-		start = 0;
 	end = start + (range->len >> sb->s_blocksize_bits) - 1;
-	if (end >= bmp->db_mapsize)
-		end = bmp->db_mapsize - 1;
 	minlen = range->minlen >> sb->s_blocksize_bits;
-	if (minlen <= 0)
+	if (minlen == 0)
 		minlen = 1;

+	if (minlen > bmp->db_agsize ||
+	    start >= bmp->db_mapsize ||
+	    range->len < sb->s_blocksize)
+		return -EINVAL;
+
+	if (end >= bmp->db_mapsize)
+		end = bmp->db_mapsize - 1;
+
 	/**
 	 * we trim all ag's within the range
 	 */
--

-- 
1.7.7.6

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
Robert Henney | 12 Oct 2012 17:33

finding inodes via block

I have a jfs partition on a linux 2.6.32 install on which 3 sectors recently
became unreadable.  I was able to write zeros to those sectors using dd and
the disk appears to think they're fine and readable again; at least no
sectors are marked reallocated or currently pending by the disk.

  dd of=/dev/sdc if=/dev/zero seek=640 count=1 bs=4096
  dd of=/dev/sdc if=/dev/zero seek=935 count=1 bs=4096
  dd of=/dev/sdc if=/dev/zero seek=1283 count=1 bs=4096

I would like to find out which files on the disk were in those blocks and
thus are now damaged.  Since I have the logical block numbers I assume I 
can get inode numbers from them somehow.

Tried using the 'd' command in jfs_debugfs but am not able to get anything 
that remotely looks correct.  Probably I'm not using a correct offset value, but
I have no idea what I should give it.  Is there a better method?

  Disk /dev/sdc: 3907029168s
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start  End          Size         File system  Name     Flags
   1      2048s  3907028991s  3907026944s  jfs          primary

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

Gmane