Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
+2.0.24:
+ - Small internal cleanups.
+ - Support for sendfile system call. (Christoph Hellwig)
2.0.23:
- Massive internal locking changes to mft record locking. Fixes
various race conditions and deadlocks.
- Find and fix bugs.
- Enable NFS exporting of NTFS.
+2.0.24 - Cleanups.
+
+ - Treat BUG_ON() as ASSERT() not VERIFY(), i.e. do not use side effects
+ inside BUG_ON(). (Adam J. Richter)
+ - Split logical OR expressions inside BUG_ON() into individual BUG_ON()
+ calls for improved debugging. (Adam J. Richter)
+ - Add errors flag to the ntfs volume state, accessed via
+ NVol{,Set,Clear}Errors(vol).
+ - Do not allow read-write remounts of read-only volumes with errors.
+ - Clarify comment for ntfs file operation sendfile which was added by
+ Christoph Hellwig a while ago (just using generic_file_sendfile())
+ to say that ntfs ->sendfile is only used for the case where the
+ source data is on the ntfs partition and the destination is
+ somewhere else, i.e. nothing we need to concern ourselves with.
+ - Add generic_file_write() as our ntfs file write operation.
+
2.0.23 - Major bug fixes (races, deadlocks, non-i386 architectures).
- Massive internal locking changes to mft record locking. Fixes lock
ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
mst.o namei.o super.o sysctl.o time.o unistr.o upcase.o
-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.23\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.24\"
ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
static inline BOOL ntfs_are_rl_mergeable(run_list_element *dst,
run_list_element *src)
{
- BUG_ON(!dst || !src);
+ BUG_ON(!dst);
+ BUG_ON(!src);
if ((dst->lcn < 0) || (src->lcn < 0)) /* Are we merging holes? */
return FALSE;
BOOL right;
int magic;
- BUG_ON(!dst || !src);
+ BUG_ON(!dst);
+ BUG_ON(!src);
/* First, check if the right hand end needs merging. */
right = ntfs_are_rl_mergeable(src + ssize - 1, dst + loc + 1);
BOOL hole = FALSE; /* Following a hole */
int magic;
- BUG_ON(!dst || !src);
+ BUG_ON(!dst);
+ BUG_ON(!src);
/* disc => Discontinuity between the end of @dst and the start of @src.
* This means we might need to insert a hole.
BOOL right;
int magic;
- BUG_ON(!dst || !src);
+ BUG_ON(!dst);
+ BUG_ON(!src);
/* First, merge the left and right ends, if necessary. */
right = ntfs_are_rl_mergeable(src + ssize - 1, dst + loc + 1);
static inline run_list_element *ntfs_rl_split(run_list_element *dst, int dsize,
run_list_element *src, int ssize, int loc)
{
- BUG_ON(!dst || !src);
+ BUG_ON(!dst);
+ BUG_ON(!src);
/* Space required: @dst size + @src size + one new hole. */
dst = ntfs_rl_realloc(dst, dsize, dsize + ssize + 1);
* Bad things happen if we get here for anything that is not an
* unnamed $DATA attribute.
*/
- BUG_ON(ni->type != AT_DATA || ni->name_len);
+ BUG_ON(ni->type != AT_DATA);
+ BUG_ON(ni->name_len);
pages = kmalloc(nr_pages * sizeof(struct page *), GFP_NOFS);
struct file_operations ntfs_file_ops = {
.llseek = generic_file_llseek, /* Seek inside file. */
.read = generic_file_read, /* Read from file. */
+#ifdef NTFS_RW
+ .write = generic_file_write, /* Write to a file. */
+#endif
.mmap = generic_file_mmap, /* Mmap file. */
- .sendfile = generic_file_sendfile,/* Zero-copy data send. */
+ .sendfile = generic_file_sendfile,/* Zero-copy data send with the
+ data source being on the
+ ntfs partition. We don't
+ need to care about the data
+ destination. */
.open = ntfs_file_open, /* Open file. */
};
ntfs_inode *ni = NTFS_I(inode);
ntfs_debug("Entering.");
- BUG_ON(ni->page || !atomic_dec_and_test(&ni->count));
+ BUG_ON(ni->page);
+ if (!atomic_dec_and_test(&ni->count))
+ BUG();
kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode));
}
void ntfs_destroy_extent_inode(ntfs_inode *ni)
{
ntfs_debug("Entering.");
- BUG_ON(ni->page || !atomic_dec_and_test(&ni->count));
+ BUG_ON(ni->page);
+ if (!atomic_dec_and_test(&ni->count))
+ BUG();
kmem_cache_free(ntfs_inode_cache, ni);
}
ntfs_debug("Entering with remount options string: %s", opt);
+#ifndef NTFS_RW
+ /* For read-only compiled driver, enforce all read-only flags. */
+ *flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
+#else
+ /*
+ * For the read-write compiled driver, if we are remounting read-write,
+ * make sure there aren't any volume errors.
+ */
+ if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
+ if (NVolErrors(vol)) {
+ ntfs_error(sb, "Volume has errors and is read-only."
+ "Cannot remount read-write.");
+ return -EROFS;
+ }
+ }
+#endif
+
// FIXME/TODO: If left like this we will have problems with rw->ro and
// ro->rw, as well as with sync->async and vice versa remounts.
// Note: The VFS already checks that there are no pending deletes and
if (!parse_options(vol, opt))
return -EINVAL;
-#ifndef NTFS_RW
- *flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
-#endif
-
return 0;
}
* Defined bits for the flags field in the ntfs_volume structure.
*/
typedef enum {
+ NV_Errors, /* 1: Volume has errors, prevent remount rw. */
NV_ShowSystemFiles, /* 1: Return system files in ntfs_readdir(). */
NV_CaseSensitive, /* 1: Treat file names as case sensitive and
create filenames in the POSIX namespace.
}
/* Emit the ntfs volume bitops functions. */
+NVOL_FNS(Errors)
NVOL_FNS(ShowSystemFiles)
NVOL_FNS(CaseSensitive)