diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_elf.c | 2 | ||||
-rw-r--r-- | fs/dcache.c | 13 | ||||
-rw-r--r-- | fs/ecryptfs/miscdev.c | 2 | ||||
-rw-r--r-- | fs/gfs2/glock.c | 14 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 5 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 5 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 13 | ||||
-rw-r--r-- | fs/namei.c | 66 | ||||
-rw-r--r-- | fs/ntfs/attrib.c | 6 | ||||
-rw-r--r-- | fs/ntfs/mft.c | 6 | ||||
-rw-r--r-- | fs/ntfs/super.c | 4 |
11 files changed, 86 insertions, 50 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index bcb884e2d613..07d096c49920 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1421,7 +1421,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, | |||
1421 | for (i = 1; i < view->n; ++i) { | 1421 | for (i = 1; i < view->n; ++i) { |
1422 | const struct user_regset *regset = &view->regsets[i]; | 1422 | const struct user_regset *regset = &view->regsets[i]; |
1423 | do_thread_regset_writeback(t->task, regset); | 1423 | do_thread_regset_writeback(t->task, regset); |
1424 | if (regset->core_note_type && | 1424 | if (regset->core_note_type && regset->get && |
1425 | (!regset->active || regset->active(t->task, regset))) { | 1425 | (!regset->active || regset->active(t->task, regset))) { |
1426 | int ret; | 1426 | int ret; |
1427 | size_t size = regset->n * regset->size; | 1427 | size_t size = regset->n * regset->size; |
diff --git a/fs/dcache.c b/fs/dcache.c index fe19ac13f75f..138be96e25b6 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -104,7 +104,7 @@ static unsigned int d_hash_shift __read_mostly; | |||
104 | 104 | ||
105 | static struct hlist_bl_head *dentry_hashtable __read_mostly; | 105 | static struct hlist_bl_head *dentry_hashtable __read_mostly; |
106 | 106 | ||
107 | static inline struct hlist_bl_head *d_hash(struct dentry *parent, | 107 | static inline struct hlist_bl_head *d_hash(const struct dentry *parent, |
108 | unsigned long hash) | 108 | unsigned long hash) |
109 | { | 109 | { |
110 | hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES; | 110 | hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES; |
@@ -1717,8 +1717,9 @@ EXPORT_SYMBOL(d_add_ci); | |||
1717 | * child is looked up. Thus, an interlocking stepping of sequence lock checks | 1717 | * child is looked up. Thus, an interlocking stepping of sequence lock checks |
1718 | * is formed, giving integrity down the path walk. | 1718 | * is formed, giving integrity down the path walk. |
1719 | */ | 1719 | */ |
1720 | struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, | 1720 | struct dentry *__d_lookup_rcu(const struct dentry *parent, |
1721 | unsigned *seq, struct inode **inode) | 1721 | const struct qstr *name, |
1722 | unsigned *seqp, struct inode **inode) | ||
1722 | { | 1723 | { |
1723 | unsigned int len = name->len; | 1724 | unsigned int len = name->len; |
1724 | unsigned int hash = name->hash; | 1725 | unsigned int hash = name->hash; |
@@ -1748,6 +1749,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, | |||
1748 | * See Documentation/filesystems/path-lookup.txt for more details. | 1749 | * See Documentation/filesystems/path-lookup.txt for more details. |
1749 | */ | 1750 | */ |
1750 | hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { | 1751 | hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { |
1752 | unsigned seq; | ||
1751 | struct inode *i; | 1753 | struct inode *i; |
1752 | const char *tname; | 1754 | const char *tname; |
1753 | int tlen; | 1755 | int tlen; |
@@ -1756,7 +1758,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, | |||
1756 | continue; | 1758 | continue; |
1757 | 1759 | ||
1758 | seqretry: | 1760 | seqretry: |
1759 | *seq = read_seqcount_begin(&dentry->d_seq); | 1761 | seq = read_seqcount_begin(&dentry->d_seq); |
1760 | if (dentry->d_parent != parent) | 1762 | if (dentry->d_parent != parent) |
1761 | continue; | 1763 | continue; |
1762 | if (d_unhashed(dentry)) | 1764 | if (d_unhashed(dentry)) |
@@ -1771,7 +1773,7 @@ seqretry: | |||
1771 | * edge of memory when walking. If we could load this | 1773 | * edge of memory when walking. If we could load this |
1772 | * atomically some other way, we could drop this check. | 1774 | * atomically some other way, we could drop this check. |
1773 | */ | 1775 | */ |
1774 | if (read_seqcount_retry(&dentry->d_seq, *seq)) | 1776 | if (read_seqcount_retry(&dentry->d_seq, seq)) |
1775 | goto seqretry; | 1777 | goto seqretry; |
1776 | if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { | 1778 | if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { |
1777 | if (parent->d_op->d_compare(parent, *inode, | 1779 | if (parent->d_op->d_compare(parent, *inode, |
@@ -1788,6 +1790,7 @@ seqretry: | |||
1788 | * order to do anything useful with the returned dentry | 1790 | * order to do anything useful with the returned dentry |
1789 | * anyway. | 1791 | * anyway. |
1790 | */ | 1792 | */ |
1793 | *seqp = seq; | ||
1791 | *inode = i; | 1794 | *inode = i; |
1792 | return dentry; | 1795 | return dentry; |
1793 | } | 1796 | } |
diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c index 349209dc6a91..3a06f4043df4 100644 --- a/fs/ecryptfs/miscdev.c +++ b/fs/ecryptfs/miscdev.c | |||
@@ -429,7 +429,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf, | |||
429 | goto memdup; | 429 | goto memdup; |
430 | } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) { | 430 | } else if (count < MIN_MSG_PKT_SIZE || count > MAX_MSG_PKT_SIZE) { |
431 | printk(KERN_WARNING "%s: Acceptable packet size range is " | 431 | printk(KERN_WARNING "%s: Acceptable packet size range is " |
432 | "[%d-%lu], but amount of data written is [%zu].", | 432 | "[%d-%zu], but amount of data written is [%zu].", |
433 | __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count); | 433 | __func__, MIN_MSG_PKT_SIZE, MAX_MSG_PKT_SIZE, count); |
434 | return -EINVAL; | 434 | return -EINVAL; |
435 | } | 435 | } |
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 376816fcd040..351a3e797789 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -167,14 +167,19 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl) | |||
167 | spin_unlock(&lru_lock); | 167 | spin_unlock(&lru_lock); |
168 | } | 168 | } |
169 | 169 | ||
170 | static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) | 170 | static void __gfs2_glock_remove_from_lru(struct gfs2_glock *gl) |
171 | { | 171 | { |
172 | spin_lock(&lru_lock); | ||
173 | if (!list_empty(&gl->gl_lru)) { | 172 | if (!list_empty(&gl->gl_lru)) { |
174 | list_del_init(&gl->gl_lru); | 173 | list_del_init(&gl->gl_lru); |
175 | atomic_dec(&lru_count); | 174 | atomic_dec(&lru_count); |
176 | clear_bit(GLF_LRU, &gl->gl_flags); | 175 | clear_bit(GLF_LRU, &gl->gl_flags); |
177 | } | 176 | } |
177 | } | ||
178 | |||
179 | static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl) | ||
180 | { | ||
181 | spin_lock(&lru_lock); | ||
182 | __gfs2_glock_remove_from_lru(gl); | ||
178 | spin_unlock(&lru_lock); | 183 | spin_unlock(&lru_lock); |
179 | } | 184 | } |
180 | 185 | ||
@@ -217,11 +222,12 @@ void gfs2_glock_put(struct gfs2_glock *gl) | |||
217 | struct gfs2_sbd *sdp = gl->gl_sbd; | 222 | struct gfs2_sbd *sdp = gl->gl_sbd; |
218 | struct address_space *mapping = gfs2_glock2aspace(gl); | 223 | struct address_space *mapping = gfs2_glock2aspace(gl); |
219 | 224 | ||
220 | if (atomic_dec_and_test(&gl->gl_ref)) { | 225 | if (atomic_dec_and_lock(&gl->gl_ref, &lru_lock)) { |
226 | __gfs2_glock_remove_from_lru(gl); | ||
227 | spin_unlock(&lru_lock); | ||
221 | spin_lock_bucket(gl->gl_hash); | 228 | spin_lock_bucket(gl->gl_hash); |
222 | hlist_bl_del_rcu(&gl->gl_list); | 229 | hlist_bl_del_rcu(&gl->gl_list); |
223 | spin_unlock_bucket(gl->gl_hash); | 230 | spin_unlock_bucket(gl->gl_hash); |
224 | gfs2_glock_remove_from_lru(gl); | ||
225 | GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders)); | 231 | GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders)); |
226 | GLOCK_BUG_ON(gl, mapping && mapping->nrpages); | 232 | GLOCK_BUG_ON(gl, mapping && mapping->nrpages); |
227 | trace_gfs2_glock_put(gl); | 233 | trace_gfs2_glock_put(gl); |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index a7d611b93f0f..56987460cdae 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -391,10 +391,6 @@ static int alloc_dinode(struct gfs2_inode *dip, u64 *no_addr, u64 *generation) | |||
391 | int error; | 391 | int error; |
392 | int dblocks = 1; | 392 | int dblocks = 1; |
393 | 393 | ||
394 | error = gfs2_rindex_update(sdp); | ||
395 | if (error) | ||
396 | fs_warn(sdp, "rindex update returns %d\n", error); | ||
397 | |||
398 | error = gfs2_inplace_reserve(dip, RES_DINODE); | 394 | error = gfs2_inplace_reserve(dip, RES_DINODE); |
399 | if (error) | 395 | if (error) |
400 | goto out; | 396 | goto out; |
@@ -1043,6 +1039,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry) | |||
1043 | rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr); | 1039 | rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr); |
1044 | if (!rgd) | 1040 | if (!rgd) |
1045 | goto out_inodes; | 1041 | goto out_inodes; |
1042 | |||
1046 | gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); | 1043 | gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2); |
1047 | 1044 | ||
1048 | 1045 | ||
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6aacf3f230a2..24f609c9ef91 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -800,6 +800,11 @@ static int init_inodes(struct gfs2_sbd *sdp, int undo) | |||
800 | fs_err(sdp, "can't get quota file inode: %d\n", error); | 800 | fs_err(sdp, "can't get quota file inode: %d\n", error); |
801 | goto fail_rindex; | 801 | goto fail_rindex; |
802 | } | 802 | } |
803 | |||
804 | error = gfs2_rindex_update(sdp); | ||
805 | if (error) | ||
806 | goto fail_qinode; | ||
807 | |||
803 | return 0; | 808 | return 0; |
804 | 809 | ||
805 | fail_qinode: | 810 | fail_qinode: |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 981bfa32121a..49ada95209d0 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -683,16 +683,21 @@ int gfs2_rindex_update(struct gfs2_sbd *sdp) | |||
683 | struct gfs2_glock *gl = ip->i_gl; | 683 | struct gfs2_glock *gl = ip->i_gl; |
684 | struct gfs2_holder ri_gh; | 684 | struct gfs2_holder ri_gh; |
685 | int error = 0; | 685 | int error = 0; |
686 | int unlock_required = 0; | ||
686 | 687 | ||
687 | /* Read new copy from disk if we don't have the latest */ | 688 | /* Read new copy from disk if we don't have the latest */ |
688 | if (!sdp->sd_rindex_uptodate) { | 689 | if (!sdp->sd_rindex_uptodate) { |
689 | mutex_lock(&sdp->sd_rindex_mutex); | 690 | mutex_lock(&sdp->sd_rindex_mutex); |
690 | error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh); | 691 | if (!gfs2_glock_is_locked_by_me(gl)) { |
691 | if (error) | 692 | error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh); |
692 | return error; | 693 | if (error) |
694 | return error; | ||
695 | unlock_required = 1; | ||
696 | } | ||
693 | if (!sdp->sd_rindex_uptodate) | 697 | if (!sdp->sd_rindex_uptodate) |
694 | error = gfs2_ri_update(ip); | 698 | error = gfs2_ri_update(ip); |
695 | gfs2_glock_dq_uninit(&ri_gh); | 699 | if (unlock_required) |
700 | gfs2_glock_dq_uninit(&ri_gh); | ||
696 | mutex_unlock(&sdp->sd_rindex_mutex); | 701 | mutex_unlock(&sdp->sd_rindex_mutex); |
697 | } | 702 | } |
698 | 703 | ||
diff --git a/fs/namei.c b/fs/namei.c index a780ea515c47..e2ba62820a0f 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1374,6 +1374,34 @@ static inline int can_lookup(struct inode *inode) | |||
1374 | return 1; | 1374 | return 1; |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | unsigned int full_name_hash(const unsigned char *name, unsigned int len) | ||
1378 | { | ||
1379 | unsigned long hash = init_name_hash(); | ||
1380 | while (len--) | ||
1381 | hash = partial_name_hash(*name++, hash); | ||
1382 | return end_name_hash(hash); | ||
1383 | } | ||
1384 | EXPORT_SYMBOL(full_name_hash); | ||
1385 | |||
1386 | /* | ||
1387 | * We know there's a real path component here of at least | ||
1388 | * one character. | ||
1389 | */ | ||
1390 | static inline unsigned long hash_name(const char *name, unsigned int *hashp) | ||
1391 | { | ||
1392 | unsigned long hash = init_name_hash(); | ||
1393 | unsigned long len = 0, c; | ||
1394 | |||
1395 | c = (unsigned char)*name; | ||
1396 | do { | ||
1397 | len++; | ||
1398 | hash = partial_name_hash(c, hash); | ||
1399 | c = (unsigned char)name[len]; | ||
1400 | } while (c && c != '/'); | ||
1401 | *hashp = end_name_hash(hash); | ||
1402 | return len; | ||
1403 | } | ||
1404 | |||
1377 | /* | 1405 | /* |
1378 | * Name resolution. | 1406 | * Name resolution. |
1379 | * This is the basic name resolution function, turning a pathname into | 1407 | * This is the basic name resolution function, turning a pathname into |
@@ -1394,31 +1422,22 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1394 | 1422 | ||
1395 | /* At this point we know we have a real path component. */ | 1423 | /* At this point we know we have a real path component. */ |
1396 | for(;;) { | 1424 | for(;;) { |
1397 | unsigned long hash; | ||
1398 | struct qstr this; | 1425 | struct qstr this; |
1399 | unsigned int c; | 1426 | long len; |
1400 | int type; | 1427 | int type; |
1401 | 1428 | ||
1402 | err = may_lookup(nd); | 1429 | err = may_lookup(nd); |
1403 | if (err) | 1430 | if (err) |
1404 | break; | 1431 | break; |
1405 | 1432 | ||
1433 | len = hash_name(name, &this.hash); | ||
1406 | this.name = name; | 1434 | this.name = name; |
1407 | c = *(const unsigned char *)name; | 1435 | this.len = len; |
1408 | |||
1409 | hash = init_name_hash(); | ||
1410 | do { | ||
1411 | name++; | ||
1412 | hash = partial_name_hash(c, hash); | ||
1413 | c = *(const unsigned char *)name; | ||
1414 | } while (c && (c != '/')); | ||
1415 | this.len = name - (const char *) this.name; | ||
1416 | this.hash = end_name_hash(hash); | ||
1417 | 1436 | ||
1418 | type = LAST_NORM; | 1437 | type = LAST_NORM; |
1419 | if (this.name[0] == '.') switch (this.len) { | 1438 | if (name[0] == '.') switch (len) { |
1420 | case 2: | 1439 | case 2: |
1421 | if (this.name[1] == '.') { | 1440 | if (name[1] == '.') { |
1422 | type = LAST_DOTDOT; | 1441 | type = LAST_DOTDOT; |
1423 | nd->flags |= LOOKUP_JUMPED; | 1442 | nd->flags |= LOOKUP_JUMPED; |
1424 | } | 1443 | } |
@@ -1437,12 +1456,18 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1437 | } | 1456 | } |
1438 | } | 1457 | } |
1439 | 1458 | ||
1440 | /* remove trailing slashes? */ | 1459 | if (!name[len]) |
1441 | if (!c) | ||
1442 | goto last_component; | 1460 | goto last_component; |
1443 | while (*++name == '/'); | 1461 | /* |
1444 | if (!*name) | 1462 | * If it wasn't NUL, we know it was '/'. Skip that |
1463 | * slash, and continue until no more slashes. | ||
1464 | */ | ||
1465 | do { | ||
1466 | len++; | ||
1467 | } while (unlikely(name[len] == '/')); | ||
1468 | if (!name[len]) | ||
1445 | goto last_component; | 1469 | goto last_component; |
1470 | name += len; | ||
1446 | 1471 | ||
1447 | err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW); | 1472 | err = walk_component(nd, &next, &this, type, LOOKUP_FOLLOW); |
1448 | if (err < 0) | 1473 | if (err < 0) |
@@ -1775,24 +1800,21 @@ static struct dentry *lookup_hash(struct nameidata *nd) | |||
1775 | struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) | 1800 | struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) |
1776 | { | 1801 | { |
1777 | struct qstr this; | 1802 | struct qstr this; |
1778 | unsigned long hash; | ||
1779 | unsigned int c; | 1803 | unsigned int c; |
1780 | 1804 | ||
1781 | WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); | 1805 | WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); |
1782 | 1806 | ||
1783 | this.name = name; | 1807 | this.name = name; |
1784 | this.len = len; | 1808 | this.len = len; |
1809 | this.hash = full_name_hash(name, len); | ||
1785 | if (!len) | 1810 | if (!len) |
1786 | return ERR_PTR(-EACCES); | 1811 | return ERR_PTR(-EACCES); |
1787 | 1812 | ||
1788 | hash = init_name_hash(); | ||
1789 | while (len--) { | 1813 | while (len--) { |
1790 | c = *(const unsigned char *)name++; | 1814 | c = *(const unsigned char *)name++; |
1791 | if (c == '/' || c == '\0') | 1815 | if (c == '/' || c == '\0') |
1792 | return ERR_PTR(-EACCES); | 1816 | return ERR_PTR(-EACCES); |
1793 | hash = partial_name_hash(c, hash); | ||
1794 | } | 1817 | } |
1795 | this.hash = end_name_hash(hash); | ||
1796 | /* | 1818 | /* |
1797 | * See if the low-level filesystem might want | 1819 | * See if the low-level filesystem might want |
1798 | * to use its own hash.. | 1820 | * to use its own hash.. |
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index f14fde2b03d6..e0281992ddc3 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project. | 2 | * attrib.c - NTFS attribute operations. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2007 Anton Altaparmakov | 4 | * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. |
5 | * Copyright (c) 2002 Richard Russon | 5 | * Copyright (c) 2002 Richard Russon |
6 | * | 6 | * |
7 | * This program/include file is free software; you can redistribute it and/or | 7 | * This program/include file is free software; you can redistribute it and/or |
@@ -345,10 +345,10 @@ LCN ntfs_attr_vcn_to_lcn_nolock(ntfs_inode *ni, const VCN vcn, | |||
345 | unsigned long flags; | 345 | unsigned long flags; |
346 | bool is_retry = false; | 346 | bool is_retry = false; |
347 | 347 | ||
348 | BUG_ON(!ni); | ||
348 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.", | 349 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, %s_locked.", |
349 | ni->mft_no, (unsigned long long)vcn, | 350 | ni->mft_no, (unsigned long long)vcn, |
350 | write_locked ? "write" : "read"); | 351 | write_locked ? "write" : "read"); |
351 | BUG_ON(!ni); | ||
352 | BUG_ON(!NInoNonResident(ni)); | 352 | BUG_ON(!NInoNonResident(ni)); |
353 | BUG_ON(vcn < 0); | 353 | BUG_ON(vcn < 0); |
354 | if (!ni->runlist.rl) { | 354 | if (!ni->runlist.rl) { |
@@ -469,9 +469,9 @@ runlist_element *ntfs_attr_find_vcn_nolock(ntfs_inode *ni, const VCN vcn, | |||
469 | int err = 0; | 469 | int err = 0; |
470 | bool is_retry = false; | 470 | bool is_retry = false; |
471 | 471 | ||
472 | BUG_ON(!ni); | ||
472 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.", | 473 | ntfs_debug("Entering for i_ino 0x%lx, vcn 0x%llx, with%s ctx.", |
473 | ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out"); | 474 | ni->mft_no, (unsigned long long)vcn, ctx ? "" : "out"); |
474 | BUG_ON(!ni); | ||
475 | BUG_ON(!NInoNonResident(ni)); | 475 | BUG_ON(!NInoNonResident(ni)); |
476 | BUG_ON(vcn < 0); | 476 | BUG_ON(vcn < 0); |
477 | if (!ni->runlist.rl) { | 477 | if (!ni->runlist.rl) { |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 382857f9c7db..3014a36a255b 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /** | 1 | /** |
2 | * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project. | 2 | * mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc. | 4 | * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. |
5 | * Copyright (c) 2002 Richard Russon | 5 | * Copyright (c) 2002 Richard Russon |
6 | * | 6 | * |
7 | * This program/include file is free software; you can redistribute it and/or | 7 | * This program/include file is free software; you can redistribute it and/or |
@@ -1367,7 +1367,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol) | |||
1367 | ntfs_error(vol->sb, "Failed to merge runlists for mft " | 1367 | ntfs_error(vol->sb, "Failed to merge runlists for mft " |
1368 | "bitmap."); | 1368 | "bitmap."); |
1369 | if (ntfs_cluster_free_from_rl(vol, rl2)) { | 1369 | if (ntfs_cluster_free_from_rl(vol, rl2)) { |
1370 | ntfs_error(vol->sb, "Failed to dealocate " | 1370 | ntfs_error(vol->sb, "Failed to deallocate " |
1371 | "allocated cluster.%s", es); | 1371 | "allocated cluster.%s", es); |
1372 | NVolSetErrors(vol); | 1372 | NVolSetErrors(vol); |
1373 | } | 1373 | } |
@@ -1805,7 +1805,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol) | |||
1805 | ntfs_error(vol->sb, "Failed to merge runlists for mft data " | 1805 | ntfs_error(vol->sb, "Failed to merge runlists for mft data " |
1806 | "attribute."); | 1806 | "attribute."); |
1807 | if (ntfs_cluster_free_from_rl(vol, rl2)) { | 1807 | if (ntfs_cluster_free_from_rl(vol, rl2)) { |
1808 | ntfs_error(vol->sb, "Failed to dealocate clusters " | 1808 | ntfs_error(vol->sb, "Failed to deallocate clusters " |
1809 | "from the mft data attribute.%s", es); | 1809 | "from the mft data attribute.%s", es); |
1810 | NVolSetErrors(vol); | 1810 | NVolSetErrors(vol); |
1811 | } | 1811 | } |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 5a4a8af5c406..f907611cca73 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project. | 2 | * super.c - NTFS kernel super block handling. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2011 Anton Altaparmakov and Tuxera Inc. | 4 | * Copyright (c) 2001-2012 Anton Altaparmakov and Tuxera Inc. |
5 | * Copyright (c) 2001,2002 Richard Russon | 5 | * Copyright (c) 2001,2002 Richard Russon |
6 | * | 6 | * |
7 | * This program/include file is free software; you can redistribute it and/or | 7 | * This program/include file is free software; you can redistribute it and/or |
@@ -1239,7 +1239,6 @@ static int check_windows_hibernation_status(ntfs_volume *vol) | |||
1239 | { | 1239 | { |
1240 | MFT_REF mref; | 1240 | MFT_REF mref; |
1241 | struct inode *vi; | 1241 | struct inode *vi; |
1242 | ntfs_inode *ni; | ||
1243 | struct page *page; | 1242 | struct page *page; |
1244 | u32 *kaddr, *kend; | 1243 | u32 *kaddr, *kend; |
1245 | ntfs_name *name = NULL; | 1244 | ntfs_name *name = NULL; |
@@ -1290,7 +1289,6 @@ static int check_windows_hibernation_status(ntfs_volume *vol) | |||
1290 | "is not the system volume.", i_size_read(vi)); | 1289 | "is not the system volume.", i_size_read(vi)); |
1291 | goto iput_out; | 1290 | goto iput_out; |
1292 | } | 1291 | } |
1293 | ni = NTFS_I(vi); | ||
1294 | page = ntfs_map_page(vi->i_mapping, 0); | 1292 | page = ntfs_map_page(vi->i_mapping, 0); |
1295 | if (IS_ERR(page)) { | 1293 | if (IS_ERR(page)) { |
1296 | ntfs_error(vol->sb, "Failed to read from hiberfil.sys."); | 1294 | ntfs_error(vol->sb, "Failed to read from hiberfil.sys."); |